The current GATK version is 3.7-0
Examples: Monday, today, last week, Mar 26, 3/26/04

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Get notifications!

You can opt in to receive email notifications, for example when your questions get answered or when there are new announcements, by following the instructions given here.

Got a problem?

1. Search using the upper-right search box, e.g. using the error message.
2. Try the latest version of tools.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

Did we ask for a bug report?

Then follow instructions in Article#1894.

Formatting tip!

Wrap blocks of code, error messages and BAM/VCF snippets--especially content with hashes (#)--with lines with three backticks ( ``` ) each to make a code block as demonstrated here.

Jump to another community
Picard 2.10.2 is now available at
GATK version 4.beta.2 (i.e. the second beta release) is out. See the GATK4 BETA page for download and details.

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

    In case you need it, here's a doc on setting up maven and IntelliJ for GATK 3+ :

  • 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.