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

Haplotypecaller terminate with ExitCode 245, but without error

0

7 comments

  • Avatar
    James Emery

    Hello Xiaomeng Mao

    I'm sorry to hear about your crashing on these data inputs. From experience, very often when you get no-message failures from HaplotpeCaller it is an out-of memory failure of one kind or another (very often running out of memory on the VM instance). It looks like you are setting 

    -Xms512M -Xmx5G 

    so if you increase the available memory on the instance without increasing the java -xmx (which is the maximum memory java will restrict itself to using) value you aren't actually allowing java to utilize the extra space. Furthermore, I would be careful to also make sure that the -xmx is not too close to the total available memory for the total machine, as GATK has a number of non-java elements (namely compression/decompression libraries, smith waterman accelerators, etc...) that require memory as well so you must leave at least 1GB (and often 2GB is necessary in very messy edge cases). 

    The next comment I would make is that you are trying to use LongReads with HaplotypeCaller. HaplotypeCaller has been optimized for short reads but should be fine to run over the long reads but some older versions (the GATK/4.1.4.1 version you are using being several years old at this point) had compatibility issues that caused poor behavior with long-reads. I would recommend upgrading to a newer release (we a on 4.3.0.0 right now), as there have been a number of low level improvements to HTSJDK in the intervening years that might result in better performance on long reads. 

    0
    Comment actions Permalink
  • Avatar
    Xiaomeng Mao

    Hi James Emery,

    Thanks for your reply and suggestions!

    I retried by adding the below java options to the previous command line. (requiring 4 cores, each has a maximum of 6.8G RAM) But it still crushed at the same loci even though I chose the starting point from 100Kb before the breakpoint. 

    --java-options "-Xms1G -Xmx20G"

    And in the log file,  it contains both the new java memory setting and the default one. I am not sure if the increasing memory setting works. 

    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 -Xms512M -Xmx5G -Xms1G -Xmx20G -jar /sw/bioinfo/GATK/4.2.0.0/rackham/gatk-package-4.2.0.0-local.jar HaplotypeCaller --pcr-indel-model NONE -L HiC_scaffold_13:11789610-13990640 -R ../index/she_h1_curated.fasta -I she_h1.3ddna.map-hifi.addgroup.bam -O gvcf/she_h1.3ddna.map-hifi.05-1-2.g.vcf.gz -ERC GVCF

    The second suggestion didn't work in GATK/4.3.0.0. I came across the same problem as issued in https://gatk.broadinstitute.org/hc/en-us/community/posts/11440622639387/comments/12925222020763 The bam file generated from Minimap2 looks incompatible with the latest version. When I changed to version 4.2.0.0, the problem disappeared. 

    Well, it is not surprising that it works when calling SNP from the several kb regions after the breaking point but this will leave a blank around the breaking point. I rechecked the input bam file but still didn't find any problems. Here's how I generate the bam file. Would you have other suggestions?

    echo "##step1.mapping"
    minimap2 -xasm20 -a -t 12 ../index/$ref $hifi_reads > $output.sam
    samtools view -Sb -q 20 -@ 12 -T ../index/$ref $output.sam  | samtools sort -@ 12 -o $output.sort.bam 

    echo "##step2.addgroup"
    java -jar $PICARD_ROOT/picard.jar AddOrReplaceReadGroups I=$output.sort.bam O=$output.addgroup.bam RGID=$group RGLB=$group RGSM=$group RGPL=PacBio RGPU=none VALIDATION_STRINGENCY=LENIENT

    Thanks!

    Best wishes,

    Xiaomeng

     

    0
    Comment actions Permalink
  • Avatar
    James Emery

    Interesting... a few comments:
    - Regarding the multiple XMX-XMS commands in your inputs, can you post the full command line you are using for running GATK? Are you running the jar directly or running with the launcher script (./gatk)? Do you see a corresponding increase in the memory utilization to 20G in the profiling plots? Make sure that you haven't set any environment variables in your shell related to java (`JAVA_OPTS` for example) with those xmx/xms values. 
    - Regarding your issue with 4.3.0.0. I apologize, that was a mistake on my part 4.4.0.0 is actually the current version. However, from looking at the code it appears the same bug is present in 4.4.0.0, we are going to try to get it fixed by the next release, you can see the github ticket here: https://github.com/broadinstitute/gatk/issues/8335. If you want to use newer versions of GATK you are going to need to remove the offending tp tags from your bams (or wait for 4.4.1.0 which will hopefully have this fix). 

    I would not be surprised if the breakpoint is causing assembly to explode in GATK if it has to assemble megabases worth of softlcips/novel sequence from the long reads its possible that not amount of extra memory is going to work on it. First its worth determining if that is truly what is going on here or if we are just memory-starved from the codebase. What do the reads around that breakpoint look like in IGV? If it still fails after confirming that the memory bump is indeed being propagated (you should see java allocating upwards of 20GB) then we might want to look at where all of the memory is going in your case. 

    0
    Comment actions Permalink
  • Avatar
    Tanya Sarkin Jain

    Was this issue resolved? I am getting the same issue but I should be using the latest release of GATK 4.5.0.0 and am seeing the process gets terminated always at the same point (chr19), with an exit status of 245. Am using long read data

    0
    Comment actions Permalink
  • Avatar
    Gökalp Çelik

    Hi Tanya Sarkin Jain

    The issue should have been resolved by now and 4.5.0.0 and onwards should be OK to use. Can you provide more details of the problem that you are facing? Can you post your logs about the error?

    Regards. 

    0
    Comment actions Permalink
  • Avatar
    Tanya Sarkin Jain

    Sure - 

    Command executed:

     

      gatk --java-options "-Xmx9830M -XX:-UsePerfData" \

          HaplotypeCaller \

          --input m21009_241011_231041.sorted.bam \

          --output m21009_241011_231041.vcf.gz \

          --reference Homo_sapiens_assembly38.fasta \

          --native-pair-hmm-threads 6 \

          --dbsnp dbsnp_146.hg38.vcf.gz \

           \

           \

           \

          --tmp-dir . \

     

     

      cat <<-END_VERSIONS > versions.yml

      "NFCORE_PACVAR:PACVAR:BAM_SNP_VARIANT_CALLING:GATK4_HAPLOTYPECALLER":

          gatk4: $(echo $(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*$//')

      END_VERSIONS

     

    Command exit status:

      245

     

    Command output:

      (empty)

     

    Command error:

      07:33:55.190 INFO  ProgressMeter -   chr18:61584966            743.8              14881240          20008.1

      07:34:05.210 INFO  ProgressMeter -   chr18:62125822            743.9              14884480          20007.9

      07:34:15.218 INFO  ProgressMeter -   chr18:62704969            744.1              14887800          20007.9

      07:34:25.225 INFO  ProgressMeter -   chr18:63281102            744.3              14891030          20007.8

      07:34:35.236 INFO  ProgressMeter -   chr18:63822402            744.4              14894200          20007.5

      07:34:45.264 INFO  ProgressMeter -   chr18:64479591            744.6              14897730          20007.8

      07:34:55.283 INFO  ProgressMeter -   chr18:65051914            744.8              14901110          20007.8

      07:35:05.323 INFO  ProgressMeter -   chr18:65568712            744.9              14904160          20007.4

      07:35:15.329 INFO  ProgressMeter -   chr18:66196826            745.1              14907590          20007.6

      07:35:25.350 INFO  ProgressMeter -   chr18:66729421            745.3              14910830          20007.4

      07:35:35.354 INFO  ProgressMeter -   chr18:67334591            745.4              14914280          20007.6

      07:35:45.480 INFO  ProgressMeter -   chr18:67919545            745.6              14917640          20007.5

      07:35:55.493 INFO  ProgressMeter -   chr18:68356184            745.8              14920420          20006.8

      07:36:05.500 INFO  ProgressMeter -   chr18:68899768            745.9              14923720          20006.7

      07:36:15.543 INFO  ProgressMeter -   chr18:69483439            746.1              14927150          20006.9

      07:36:25.558 INFO  ProgressMeter -   chr18:69999103            746.3              14930250          20006.5

      07:36:35.582 INFO  ProgressMeter -   chr18:70516866            746.4              14933330          20006.2

      07:36:45.617 INFO  ProgressMeter -   chr18:71130787            746.6              14936950          20006.6

      07:36:55.625 INFO  ProgressMeter -   chr18:71692998            746.8              14940240          20006.5

      07:37:05.628 INFO  ProgressMeter -   chr18:72207527            746.9              14943360          20006.2

      07:37:15.640 INFO  ProgressMeter -   chr18:72758107            747.1              14946780          20006.3

      07:37:25.640 INFO  ProgressMeter -   chr18:73399854            747.3              14950470          20006.8

      07:37:35.651 INFO  ProgressMeter -   chr18:73989062            747.4              14954030          20007.1

      07:37:45.673 INFO  ProgressMeter -   chr18:74410500            747.6              14956820          20006.3

      07:37:55.710 INFO  ProgressMeter -   chr18:75118828            747.8              14960820          20007.2

      07:38:05.730 INFO  ProgressMeter -   chr18:75751537            747.9              14964530          20007.7

      07:38:15.749 INFO  ProgressMeter -   chr18:76372481            748.1              14968200          20008.2

      07:38:25.750 INFO  ProgressMeter -   chr18:76975058            748.3              14971840          20008.6

      07:38:35.756 INFO  ProgressMeter -   chr18:77431794            748.4              14974790          20008.0

      07:38:45.774 INFO  ProgressMeter -   chr18:78108644            748.6              14978950          20009.1

      07:38:55.776 INFO  ProgressMeter -   chr18:78788990            748.8              14982800          20009.8

      07:39:05.804 INFO  ProgressMeter -   chr18:79779727            748.9              14988010          20012.3

      07:39:15.828 INFO  ProgressMeter -         chr19:173182            749.1              14991950          20013.1

      07:39:25.834 INFO  ProgressMeter -         chr19:822325            749.3              14996110          20014.2

      07:39:35.847 INFO  ProgressMeter -        chr19:1532160            749.4              15000880          20016.1

      07:39:45.856 INFO  ProgressMeter -        chr19:2193534            749.6              15005210          20017.4

      07:39:55.892 INFO  ProgressMeter -        chr19:2840168            749.8              15009330          20018.5

      07:40:05.906 INFO  ProgressMeter -        chr19:3311870            749.9              15012570          20018.3

      07:40:12.724 WARN  HaplotypeCallerGenotypingEngine - At position chr19:3742670-3742670 removed alt alleles where ploidy is 2 and original allele count is 49, whereas after trimming the allele count becomes 44. Alleles kept are:[T*, TGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCAGATCACGAGGTCAGGAGATCAAGACCATCCTGGCTAACACGGTGAAACCCCGTCTCTACTAAAAACACAAAAAATTAGCCGGGCGTGGTCGAGGGCGCCTGTGGTCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATGGCGTGAACCC$

      07:40:15.913 INFO  ProgressMeter -        chr19:3942947            750.1              15016690          20019.4

      07:40:25.960 INFO  ProgressMeter -        chr19:4531990            750.3              15020550          20020.1

      07:40:36.010 INFO  ProgressMeter -        chr19:5091661            750.4              15024220          20020.5

      07:40:46.031 INFO  ProgressMeter -        chr19:5828332            750.6              15028710          20022.0

      07:40:56.144 WARN  HaplotypeCallerGenotypingEngine - At position chr19:6429376-6429376 removed alt alleles where ploidy is 2 and 


    I've run this a few times and it keeps stoping at chromosome 19

    0
    Comment actions Permalink
  • Avatar
    Gökalp Çelik

    Hi again.

    Are you using this on long reads?

    There may be unforseen bugs in our long read compatibility due to assembly engine failing for very complex regions. So you sample might have hit a certain edge case therefore it may not be working properly. You may wish to divide chr19 into several parts and see exactly where the tool fails and you may want to omit that region completely to reach a conclusion.

    I hope this helps.

    Regards. 

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk