-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrintReads introduces N bases when encoding some CRAMs and changes sequence #8768
Comments
These reads don't even look the same ?
|
That is true! Should I update the title of the issue to reflect this? |
Can you check the REF_CACHE? Or alternatively you may provide samtools the reference fasta during cram view. |
Thanks @gokalpcelik!
|
@ilyasoifer Is there any way I can access the original cram (or better yet, a small subset thereof consisting of just MT) that illustrates this issue) and the reference ? It might be hard to debug without that. If thats not possible, a few suggestions: can you try using PrintReads to write the original cram (I would try just MT) first to a cram, then to a sam, and also the original cram to a sam, and see how those compare? It would also be useful to see what that read looks like if you use samtools view on the ORIGINAL cram. Do you know what software/version was used to write the original cram ? |
Hi @cmnbroad - thanks! I can upload to one of the buckets that are shared between Ultima and the Broad. The original file was created using samtools v1.17.
|
@ilyasoifer [email protected]. And don't worry about doing the PrintReads conversions I requested - if I have access to the original file and the reference I can debug this directly. |
@cmnbroad, OK, great. Shared the files with Megan, she will transfer them over! |
@cmnbroad - the reference is from here: |
Thanks for reporting this @ilyasoifer - it looks like a serious bug. I see whats going on and am working on a fix. |
Thank you, good to hear that it was useful |
@cmnbroad - hope all is well. I was wondering if there is any ETA when the fix that you made will be released? Thanks! |
@ilyasoifer It will be part of the GATK 4.6 release, which should come out this month. We've also implemented a cram scanning tool that users can use to scan their crams to see if any are affected. |
Ah, great, thanks for updating me! |
Summary information about this bug: This issue affects GATK versions 4.3.0.0 through 4.5.0.0, and is fixed in GATK 4.6.0.0. The PR with the fix is: #8900 This issue also affects Picard versions 2.27.3 through 3.1.1, and is fixed in Picard 3.2.0. This bug is triggered when writing a CRAM file using one of the affected GATK/Picard versions, and both of the following conditions are met:
When both of these conditions are met, the resulting CRAM file may have corrupt containers associated with that contig containing reads with an incorrect sequence. Since many common references such as hg38 have N's at the very beginning of the autosomes and X/Y, many pipelines will not be affected by this bug. However, users of a telomere-to-telomere reference, users doing mitochondrial calling, and users with reads aligned to the alt sequences will want to scan their CRAM files for possible corruption. The other mitigating circumstance is that when a CRAM is affected, the signal will be overwhelmingly obvious, with the mismatch rate typically jumping from sub-1% to 80-90% for the affected regions, making it likely to be caught by standard QC processes. A CRAM scanning tool called |
A new diagnostic tool, CRAMIssue8768Detector, that analyzes a CRAM file to look for possible base corruption caused by #8768 This issue affects GATK versions 4.3.0.0 through 4.5.0.0, and is fixed in GATK 4.6.0.0. This issue also affects Picard versions 2.27.3 through 3.1.1, and is fixed in Picard 3.2.0. The bug is triggered when writing a CRAM file using one of the affected GATK/Picard versions, and both of the following conditions are met: * At least one read is mapped to the very first base of a reference contig * The file contains more than one CRAM container (10,000 reads) with reads mapped to that same reference contig When both of these conditions are met, the resulting CRAM file may have corrupt containers containing reads with an incorrect sequence. This tool writes a report to an output text file indicating whether the CRAM file appears to have read base corruption caused by issue 8768, and listing the affected containers. By default, the output report will have a summary of the average mismatch rate for all suspected bad containers and a few presumed good containers in order to determine if there is a large difference in the base mismatch rate. Optionally, a TSV file with the same information as the textual report, but in tabular form, can be written using the "--output-tsv" argument. --------- Co-authored-by: David Roazen <[email protected]>
Bug Report
Affected tool(s) or class(es)
gatk PrintReads
,picard MarkDuplicates
Affected version(s)
Description
I apologize in advance if this issue belongs to
htsjdk
. When we work with some of the CRAMs and pass them through PrintReads or picard MarkDuplicates, "N" bases get introduced.We think that the problem happens when PrintReads write the CRAM rather than reading it, because if the output of PrintReads is a BAM, it does not happen.
We also noticed that this issue does not happen with earlier GATK (4.2.6.1), HTSJDK 2.24.1.
Happy to share the input files
Steps to reproduce
Expected behavior
BAM and CRAM outputs should behave the same
Actual behavior
BAM and CRAM outputs behave differently
The text was updated successfully, but these errors were encountered: