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

mergeBamAlignment error: inappropriate call if not paired read

0

4 comments

  • Avatar
    Alex van Vliet

    I'm thinking maybe there is a problem with bwa-- I started getting an additional error:

    java.lang.IllegalStateException: Aligned record iterator (HS31_27052:1:1101:10000:11450) is behind the unmapped reads (HS33_27105:2:1101:10000:33014)

     

    although I can't figure out what would be going wrong for this sample and not the rest. I'm just going to run everything again from the top.

    One read goes missing after alignment:

    $ samtools view -h <original ubam> | grep "HS33_27105:2:1101:10000:33014"
    HS33_27105:2:1101:10000:33014    163    2    182413796    60    75M    =    182413847    126    ACTAAATTTTTCAGCTTATTGCTATTTCCTATAAAACATGGTCAAAGAAACGAAGTTAAAGTAGATAGGCAAGGT    BBBBBFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<BBFFFFFFFFFFFFFFFFFFFB    AS:i:75    XS:i:21    MQ:i:60    ms:i:2745    mc:i:182413921    MC:Z:75M    MD:Z:75    NM:i:0    RG:Z:27105_2#1
    HS33_27105:2:1101:10000:33014    83    2    182413847    60    75M    =    182413796    -126    GAAGTTAAAGTAGATAGGCAAGGTAAACACAGATTTAACAGTAGTTTAGTGTTACATATACCTGAGCTTATATGC    FFFFF<FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBBBBB    AS:i:75    XS:i:0    BC:Z:TGTCTATC-TCTTTCCC    QT:Z:BBBBBFFF /<BBBFFF    MQ:i:60    ms:i:2729    mc:i:182413796    MC:Z:75M    MD:Z:75    NM:i:0    RG:Z:27105_2#1
    $ samtools view -h <ubam with adapters marked> | grep "HS33_27105:2:1101:10000:33014"
    HS33_27105:2:1101:10000:33014    77    *    0    0    *    *    0    0    GCATATAAGCTCAGGTATATGTAACACTAAACTACTGTTAAATCTGTGTTTACCTTGCCTATCTACTTTAACTTBBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<FFFFF    BC:Z:TGTCTATC-TCTTTCCC    RG:Z:27105_2#1    XS:i:0    QT:Z:BBBBBFFF /<BBBFFF    mc:i:182413796    ms:i:2729
    HS33_27105:2:1101:10000:33014    141    *    0    0    *    *    0    0    ACTAAATTTTTCAGCTTATTGCTATTTCCTATAAAACATGGTCAAAGAAACGAAGTTAAAGTAGATAGGCAAGGBBBBBFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<BBFFFFFFFFFFFFFFFFFFFB    RG:Z:27105_2#1    XS:i:21    mc:i:182413921    ms:i:2745
    $ samtools view -h <aligned and sorted bam> | grep "HS33_27105:2:1101:10000:33014"
    HS33_27105:2:1101:10000:33014    0    2    181549069    60    75M    *    0    0    ACTAAATTTTTCAGCTTATTGCTATTTCCTATAAAACATGGTCAAAGAAACGAAGTTAAAGTAGATAGGCAAGGT    8988:979::8<;>=;;:;<>><;;<<>><;<<>>>==<?@<?=>>@=>>=9:<=<=<>=@<<@<<<@@>=>??8    NM:i:0    MD:Z:75    AS:i:75    XS:i:21
    0
    Comment actions Permalink
  • Avatar
    Anthony DiCi

    Hi Alex van Vliet,

    Thank you for writing to the GATK forum! I hope that we can help you sort this out.
    I reviewed your inquiry with our developers and received some feedback to share with you.
    It appears that you are encountering an error with BWA rather than GATK. 

    Could you please clarify which tool you are using to sort? There are differences between different sort tools that may be contributing to your troubles. You could use samtool's sort tool if you haven't already.

    We suggest you try different tools for sorting or sort at a different place in your pipeline. You should also take a look at the fastq to see if both reads are there as well. If they both are, try running sort re-alignment separately and try to identify where the read gets dropped.

    I hope this helps! Please let me know if this leads you to success. If you have further questions, please do not hesitate to reach out.

    Best,
    Anthony

    0
    Comment actions Permalink
  • Avatar
    Anthony DiCi

    Hi Alex van Vliet,

    It has been a while since we've heard from you, so we'll be closing out this ticket in our system. However, please note that if you still require assistance, you need only respond to this thread, and we can swiftly re-open your ticket and pick up where we left off!

    Thank you for being a valued contributor to the GATK community!

    Best,

    Anthony

    0
    Comment actions Permalink
  • Avatar
    Alex van Vliet

    Hi Anthony,

    I ended up solving this by figuring out my fastq was not interleaved. I have no idea how this happened for one file, I suspect it had something to do with an abrupt Snakemake stop and intermediate files not being removed.

    Anyone encountering this issue, I suggest you first run samtools flagstat on your aligned bam to check if the reads are paired or not. If not, there must be an issue with the bwa mem input files. If you are following GATK best practices, you know to use the -p option for interleaved fastq's in bwa mem. Generate your interleaved fastq with SamToFastq and make sure it's actually interleaved (I just used less -S to take a peek at the file and saw that every header line ended in /1, when it should be /1 and /2 alternating).

    1
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk