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

Truncated bam file after running ReplaceSamHeader(Picard)

0

4 comments

  • Avatar
    Genevieve Brandt

    Hi kostas alexiou, what is your question? One note - I would recommend updating your GATK version, you are using a very old version of PICARD. 

    0
    Comment actions Permalink
  • Avatar
    kostas alexiou

    Hi Genevieve Brandt. Sorry. I was not very clear in my message. My question was why I am getting a truncated bam file, after running the ReplaceSamHeader tool from picard. As you have suggested, I have run picard with the latest release (v2.23.8) but still getting a truncated bam file. Below is the command that I am using and the flagstat of the output and input files.

    java -jar ~/local/software/picard.jar ReplaceSamHeader -I Olea01_genes.bam -HEADER header.bam -O x.bam

    $ samtools flagstat x.bam
    [bam_flagstat_core] Truncated file? Continue anyway.
    155 + 0 in total (QC-passed reads + QC-failed reads)
    0 + 0 secondary
    0 + 0 supplementary
    0 + 0 duplicates
    155 + 0 mapped (100.00% : N/A)
    155 + 0 paired in sequencing
    76 + 0 read1
    79 + 0 read2
    149 + 0 properly paired (96.13% : N/A)
    155 + 0 with itself and mate mapped
    0 + 0 singletons (0.00% : N/A)
    4 + 0 with mate mapped to a different chr
    4 + 0 with mate mapped to a different chr (mapQ>=5)

    $ samtools flagstat Olea01_genes.bam
    484958 + 0 in total (QC-passed reads + QC-failed reads)
    0 + 0 secondary
    0 + 0 supplementary
    0 + 0 duplicates
    484958 + 0 mapped (100.00% : N/A)
    484958 + 0 paired in sequencing
    243866 + 0 read1
    241092 + 0 read2
    447722 + 0 properly paired (92.32% : N/A)
    482402 + 0 with itself and mate mapped
    2556 + 0 singletons (0.53% : N/A)
    31940 + 0 with mate mapped to a different chr
    27693 + 0 with mate mapped to a different chr (mapQ>=5)

     

    Thanks!

    0
    Comment actions Permalink
  • Avatar
    kostas alexiou

    I have managed to solve the problem of the truncated file. After all, the reheading was not working because there were reads whose mate was mapping to a different chromosome/scaffold and that this wasn't present in the new header.

    Best

    Kostas

    0
    Comment actions Permalink
  • Avatar
    Genevieve Brandt

    Hi kostas alexiou, thank you for the update, glad you were able to solve the problem!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk