Genome Analysis Toolkit

Variant Discovery in High-Throughput Sequencing Data

GATK process banner

Need Help?

Search our documentation

Community Forum

Hi, How can we help?

Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools with a primary focus on variant discovery and genotyping. Its powerful processing engine and high-performance computing features make it capable of taking on projects of any size. Learn more

--tmp-dir option user error

Answered
0

13 comments

  • Avatar
    Genevieve Brandt (she/her)

    Hi Brynjar Sigurðsson, is this the entire stack trace?

    0
    Comment actions Permalink
  • Avatar
    Brynjar Sigurðsson

    It prints the entire help for GenotypeGVCFs but other than that yes.

    0
    Comment actions Permalink
  • Avatar
    Brynjar Sigurðsson

    I see in the help message the format of the option has changed to

    --tmp-dir:GATKPath

    So colon instead of equals, I guess this was my problem.

    0
    Comment actions Permalink
  • Avatar
    Brynjar Sigurðsson

    The example used in the docs still uses '=' and there is no mention of this command line syntax change, if this is how it works now.

    https://gatk.broadinstitute.org/hc/en-us/articles/360047218551-GenotypeGVCFs

    0
    Comment actions Permalink
  • Avatar
    Genevieve Brandt (she/her)

    Brynjar Sigurðsson, great, glad you fixed the issue! I'll make a note to update the documentation.

    0
    Comment actions Permalink
  • Avatar
    Christopher Fiscus

    I too ran into this issue.

     

    --tmp-dir:GATKPath did not work for me and is indeed what is present in the help message. Got error "No argument value found for tagged argument:" 

     

    The following syntax works:

    --tmp-dir /path/to/dir

     

    Additionally, the issue is also present with the GenotypeGVCFs command and its documentation:  https://gatk.broadinstitute.org/hc/en-us/articles/360047218551-GenotypeGVCFs

     

    0
    Comment actions Permalink
  • Avatar
    Genevieve Brandt (she/her)

    Hi Brynjar Sigurðsson and Christopher Fiscus, thanks for bringing this to our attention. The correct syntax for the temp directory is the same as all of the other GATK arguments

    --tmp-dir /path/to/dir

    We will be updating the GenotypeGVCF and GenomicsDBImport articles to correctly reflect this. Regarding the help message, --tmp-dir:GATKPath does not work as written with a colon. All arguments are written this way in our help message with the argument type after the colon. However, this is definitely confusing, and we are looking at changing how it is written

    Sorry for the confusion that this has caused, thanks for writing in and bringing this to our attention!

    0
    Comment actions Permalink
  • Avatar
    Brynjar Sigurðsson

    Yes, I ended up using a whitespace. I think however it is more important for you to keep backwards compatibility with the "=" syntax. It is highly questionable to change this in a minor version update.

    0
    Comment actions Permalink
  • Avatar
    Genevieve Brandt (she/her)

    Brynjar Sigurðsson unfortunately the "=" syntax should have previously thrown an error, it has never been the correct syntax with GATK4. (It is the correct syntax while using Picard tools). We are sorry for the confusion with this. Going forward the syntax will continue to be a space.

    0
    Comment actions Permalink
  • Avatar
    Karina Martins

    Dear colleagues


    I'm trying to run MergeBamAlignment and got this same error message mentioned in this thread.
    ...
    Can't parse option name containing an embedded '=' (ALIGNED_BAM=/scratch/job.207362/output/inter/AC01.aligned.bam)
    Tool returned:
    1
    Using GATK jar /gatk/gatk-package-4.2.4.1-local.jar
    Running:
    java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -Xmx16G -jar /gatk/gatk-package-4.2.4.1-local.jar MergeBamAlignment --ALIGNED_BAM=/scratch/job.207362/output/inter/AC01.aligned.bam --UNMAPPED_BAM=/scratch/job.207362/output/inter/AC01.unmapped.marked.bam
    srun: error: c13: task 0: Exited with exit code 4
    ...

    I'm running gatk 4.2.4.1 in a docker container (singularity pull docker://broadinstitute/gatk:latest), in a cluster on Linux 3.10.0-1160.el7.x86_64 amd64; OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08; Deflater: Intel; Inflater: Intel; Provider GCS is available; Picard version: Version:4.2.4.1

    Part of my script:

    ____________

    local_job="/scratch/job.${SLURM_JOB_ID}"
    local_in="${local_job}/input"
    local_in1="${local_in}/rawreads"
    local_in2="${local_in}/ref"
    local_out="${local_job}/output"
    local_out1="${local_out}/vcf"
    local_out2="${local_out}/inter"

    files="AC01
    PA13
    BA01"

    echo "Merge BAM Alignment"

    for file in $files
    do
    gatk --java-options "-Xmx16G" MergeBamAlignment --ALIGNED_BAM="${local_out2}/${file}.aligned.bam" \
    --UNMAPPED_BAM="${local_out2}/${file}.unmapped.marked.bam" \
    -O="${local_out2}/${file}.mergebamalignment.bam" \
    -R="${local_in2}/ref.fasta" --CREATE_INDEX=true --ADD_MATE_CIGAR=true \
    --CLIP_ADAPTERS=true --CLIP_OVERLAPPING_READS=true \
    --INCLUDE_SECONDARY_ALIGNMENTS=true --MAX_INSERTIONS_OR_DELETIONS=-1 \
    --PRIMARY_ALIGNMENT_STRATEGY=MostDistant --ATTRIBUTES_TO_RETAIN=XS \
    --TMPDIR="${local_job}"
    done

    ____

    FastqToSam, MarkIlluminaAdapters and BWASpark worked very well. This is a test script, but the final one will be with more than 300 samples. That's why I'm using a for loop.

    Thanks!

    0
    Comment actions Permalink
  • Avatar
    Genevieve Brandt (she/her)

    Karina Martins try submitting your arguments like this:

    gatk --java-options "-Xmx16G" MergeBamAlignment \
    --ALIGNED_BAM "${local_out2}/${file}.aligned.bam" \
    --UNMAPPED_BAM "${local_out2}/${file}.unmapped.marked.bam" \
    -O "${local_out2}/${file}.mergebamalignment.bam" \
    -R "${local_in2}/ref.fasta" \
    --CREATE_INDEX true --ADD_MATE_CIGAR true \
    --CLIP_ADAPTERS true --CLIP_OVERLAPPING_READS true \
    --INCLUDE_SECONDARY_ALIGNMENTS true --MAX_INSERTIONS_OR_DELETIONS -1 \
    --PRIMARY_ALIGNMENT_STRATEGY MostDistant --ATTRIBUTES_TO_RETAIN XS \
    --TMPDIR "${local_job}"

    Let me know if that fixes the issue.

    Best,

    Genevieve

    0
    Comment actions Permalink
  • Avatar
    Karina Martins

    Hi Genevieve

    Thank you! I had to change --TMPDIR "${local_job}" to --TMP_DIR "${local_job}". After this, it worked.

    I tried this syntax before (several times...), but never worked. Maybe I was commiting an error or typo I didn't identified. The error message was:

    ________

    Illegal argument value: Positional arguments were provided ', }' but no positional argument is defined for this tool.
    Tool returned:
    1
    Using GATK jar /gatk/gatk-package-4.2.4.1-local.jar
    Running:
    java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -Xmx16G -jar /gatk/gatk-package-4.2.4.1-local.jar MergeBamAlignment --ALIGNED_BAM /scratch/job.207243/output/inter/AC01.aligned.bam --UNMAPPED_BAM /scratch/job.207243/output/inter/AC01.unmapped.marked.bam
    srun: error: c16: task 0: Exited with exit code 4 

    _____

    I then found in another thread of this forum that the syntax was wrong. I then followed the correct syntax informed in the help message of this GATK version, as pasted below:

    USAGE: MergeBamAlignment [arguments]
    ...
    <h3>Usage example:</h3>

    java -jar picard.jar MergeBamAlignment \
    ALIGNED=aligned.bam \
    UNMAPPED=unmapped.bam \
    O=merge_alignments.bam \
    R=reference_sequence.fasta

    ________

    Maybe, updating the help message of MergeBam Aligment for this GATK version would be nice.

    Thank you again for helping me. 

    Karina

    0
    Comment actions Permalink
  • Avatar
    Genevieve Brandt (she/her)

    Thanks Karina for the update! That makes sense regarding the temp dir, I should have caught that. Glad you have it working!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk