Heads up:
We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra

Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.
We will be out of the office for a Broad Institute event from Dec 10th to Dec 11th 2019. We will be back to monitor the GATK forum on Dec 12th 2019. In the meantime we encourage you to help out other community members with their queries.
Thank you for your patience!

How do I direct Queue to output files to a different directory?

louwslouws San FranciscoMember


Thanks to previous replies can run Queue and the relevant walker on a distributed computing server. The question was if I define my scala script to require an argument for the output file, using the -o parameter like so:

            // Required arguments.  All initialized to empty values.

             @Input(doc="Output file.", shortName="o")
                              var outputFile: File = _

How do I direct the output to pipe the result to a specified directory? Currently I have the code:
genotyper.out = swapExt(qscript.bamFile, "bam", outputFile, "unfiltered.vcf")

Currently when I include the string -o /path/to/my/output/files/MyResearch.vcf

The script creates a series of folders within the directory where I execute Queue from. In this case my results were sent to:

when all I wanted was the output to appear in the path:

As always any help is much appreciated.

Best Answers


  • louwslouws San FranciscoMember

    Thank Thibault! I got results. Instead of creating a series of new folders the results were written to the folder from which I executed the Queue.jar file.

    So instead of:

    it produced:
    /Queue-2-8-1-g932cd3a/MyResearch.unfiltered.vcf which is certainly definitely an improvement

    Ultimately I hope to write the output to the path I specify in the -o parameter:
    - o /path/to/my/output/files/MyResearch.unfiltered.vcf

    But I think your help puts me on the right track to solve this issue. Is there perhaps a reference or source for all the methods, traits, and objects for the various scala scripts (swapExt being an example). Knowing how something like swapExt is defined would be tremendously helpful. I tried searching through the GitHub repos but it's not clear to me which package to look at.

    Thank you again.

  • louwslouws San FranciscoMember

    @Geraldine_VdAuwera thank you for the tip. Doing that right now.

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    In case you need it, here's a doc on setting up maven and IntelliJ for GATK 3+ : http://www.broadinstitute.org/gatk/guide/article?id=4023

  • louwslouws San FranciscoMember

    Thanks to @thibault‌ and @Geraldine_VdAuwera‌ I managed to produce what I needed.

    To send the output to different directory using the -o parameter I had to structure the swapExt( ) thus:
    swapExt(outputFile, qscript.bamFile, "bam", "unfiltered.vcf")

    This created a folder named MyResearch.vcf as the name in the path I specified like so:
    /path/to/my/output/files/Myreseach.vcf/MyResearch.unfiltered.vcf almost but not exactly what I was looking for.

    To simply place the file in my specified path I had to specify the -o parameter like so:
    -o path/to/my/output/files/ without making the output file name explicit (allowing the scala script to define the file name instead)

    Once this was done everything worked as expected (or exactly as it is specified in the Qscript.scala file)

Sign In or Register to comment.