Skip to content
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

Supplementary reads not processed - aligned_bam_to_cpg_scores #46

Closed
Audald opened this issue May 3, 2023 · 4 comments
Closed

Supplementary reads not processed - aligned_bam_to_cpg_scores #46

Audald opened this issue May 3, 2023 · 4 comments

Comments

@Audald
Copy link

Audald commented May 3, 2023

CRAM/BAM files with supplementary reads cannot be processed by aligned_bam_to_cpg_scores (both for version 2.2 and 2.3). The job is immediately stopped with the error thread '<unnamed>' panicked at 'Read sequence is too short for MM tag in record: {qname}'.

The BED and BigWig files are successfully generated if the secondary and supplementary alignments are filtered out from the CRAM/BAM files with -F 2308.

I am reporting this issue in case you want to consider filtering as a user option.

@ctsa
Copy link
Member

ctsa commented May 3, 2023

Thanks @Audald -

I suppose this must be from supplementary reads with hard-clipping? If so, the bam spec doesn't provide much on how hard-clip and methylation tags should interact. By my reading, once hard-clipping is introduced there's no way the MM/ML tags could be interpretable unless they were clipped as well. Can I ask what read mapper and settings you're using for this case?

@ctsa
Copy link
Member

ctsa commented May 3, 2023

More discussion on this topic here:

samtools/hts-specs#646

Looks like to avoid this issue you need to add the -Y flag if you're using minimap2, or use pbmm2. I will update the README to note this.

@Audald
Copy link
Author

Audald commented May 4, 2023

Thanks @ctsa for looking into this. The hts-specs discussion is very helpful and the suggested flag in minimap2 should be enough. Thanks for indicating it also in the documentation!

@ctsa
Copy link
Member

ctsa commented May 4, 2023

Sounds good. Updated readme:

https://github.com/PacificBiosciences/pb-CpG-tools#input-alignment-file

Closing this issue as explained.

@ctsa ctsa closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants