Module cstag.lengthen

Functions

def lengthen(cs_tag: str, cigar: str, seq: str, prefix: bool = False) ‑> str

Convert short format of cs tag into long format

Args

cs_tag : str
cs tag in short form
cigar : str
CIGAR string (6th column in SAM file)
seq : str
segment sequence (10th column in SAM file)
prefix : bool, optional
Whether to add the prefix 'cs:Z:' to the cs tag. Defaults to False

Return

str: cs tag in long form

Example

>>> import cstag
>>> cs = ":4*ag:3"
>>> cigar = "8M"
>>> seq = "ACGTACGT"
>>> cstag.lengthen(cs, cigar, seq)
'=ACGT*ag=CGT'