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

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

Best Answers

Answers

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

    So instead of:
    /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.

  • louwslouws San FranciscoPosts: 24Member

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

  • Geraldine_VdAuweraGeraldine_VdAuwera Posts: 7,122Administrator, GATK Developer 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

    Geraldine Van der Auwera, PhD

  • louwslouws 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)

Sign In or Register to comment.