The current GATK version is 3.4-0

#### Howdy, Stranger!

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

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

San FranciscoPosts: 24Member

Hi,

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:
/Queue-2-8-1-g932cd3a/MyResearch./path/to/my/output/files/MyResearch.unfiltered.vcf

when all I wanted was the output to appear in the path:
/path/to/my/output/files/MyResearch.unfiltered.vcf

As always any help is much appreciated.

Tagged:

• San FranciscoPosts: 24Member

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.

/Queue-2-8-1-g932cd3a/MyResearch./path/to/my/output/files/MyResearch.unfiltered.vcf

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.

• San FranciscoPosts: 24Member
• San FranciscoPosts: 24Member

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

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

Geraldine Van der Auwera, PhD

• San FranciscoPosts: 24Member

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)
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7632995247840881, "perplexity": 3437.73408898954}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-22/segments/1432207930259.97/warc/CC-MAIN-20150521113210-00121-ip-10-180-206-219.ec2.internal.warc.gz"}