Module cstag.mask

Functions

def mask(cs_tag: str, cigar: str, qual: str, threshold: int = 10, prefix: bool = False) ‑> str

Mask low-quality bases to 'N'

Args

cs_tag : str
cs tag in the long format
cigar : str
cigar strings (6th column in SAM file)
qual : str
ASCII of Phred-scaled base quaiity+33 (11th column in SAM file)
threshold : int, optional
Phred Quality Score (defalt = 10). The low-quality bases are defined as 'less than or equal to the threshold'
prefix : bool, optional
Whether to add the prefix 'cs:Z:' to the cs tag. Defaults to False

Return

str: Masked cs tag

Example

>>> import cstag
>>> cs_tag = "=ACGT*ac+gg-cc=T"
>>> cigar = "5M2I2D1M"
>>> qual = "AA!!!!AA"
>>> cstag.mask(cs_tag, cigar, qual)
'=ACNN*an+ng-cc=T'