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

Make bam_tag2cigar's CG tag handling more lenient. #1317

Merged
merged 1 commit into from
Aug 9, 2021

Conversation

jkbonfield
Copy link
Contributor

@jkbonfield jkbonfield commented Aug 9, 2021

The SAM specification explicitly states the type for this tag is
CG:B:I. However Htsjdk (sometimes or always?) writes these tags as
CG:B:i. Htslib then silently ignores the tag, assuming it's some
unofficial (and incorrect) abuse of an uppercase tag for some local
purpose.

Given that there is data published in the wild using the incorrect
data type, it would be less problematic for us to simply handle the
incorrect value sign than the minimal risk of misinterpretting
someone's private tag data as CIGAR. (Plus they'd bring such woe onto
themselves by using the official name-space.)

Fixes samtools/samtools#1477

See also samtools/htsjdk#1560

The SAM specification explicitly states the type for this tag is
CG:B:I.  However Htsjdk (sometimes or always?) writes these tags as
CG:B:i.  Htslib then silently ignores the tag, assuming it's some
unofficial (and incorrect) abuse of an uppercase tag for some local
purpose.

Given that there is data published in the wild using the incorrect
data type, it would be less problematic for us to simple handle the
incorrect value sign than the minimal risk of misinterpretting
someone's private tag data as CIGAR. (Plus they'd bring such woe onto
themselves by using the official name-space.)

Fixes samtools/samtools#1477

See also samtools/htsjdk#1560
@daviesrob
Copy link
Member

This seems safe enough. I doubt CG:B:i has been used for any other purpose, and as you say it would be unwise to do so after CG was added to SAMtags.

@daviesrob daviesrob merged commit 4811c2d into samtools:develop Aug 9, 2021
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

Successfully merging this pull request may close these issues.

CG tag in BAM/CRAM output?
2 participants