Convert cstag format from short to long, vice versa
Project description
cstag
cstag
is a Python module to manipulate minimap2's CS tag.
cstag.shorten()
: to convert a cs tag from long to short formatcstag.lengthen()
: to convert a cs tag from short to long formatcstag.consensus()
: to generate a consensus cs tag from multiple cs tagscstag.to_html()
: to output html report
Installation
From PyPI:
pip install cstag
Examples
Shorten/Lengthen
import cstag
"""
Convert long format of cs tag into short format
"""
cs = "cs:Z:=ACGT*ag=CGT"
cstag.shorten(cs)
# => cs:Z::4*ag:3
"""
Convert short format of cs tag into long format
"""
cs = "cs:Z::4*ag:3"
cigar = "8M"
seq = "ACGTACGT"
cstag.lengthen(cs, cigar, seq)
# => cs:Z:=ACGT*ag=CGT
Call consensus
import cstag
cs_list = ["cs:Z:=ACGT", "cs:Z:=AC*gt=T", "cs:Z:=C*gt=T", "cs:Z:=C*gt=T", "cs:Z:=ACT+ccc=T"]
cigar_list = ["4M", "4M", "1S3M", "3M", "3M3I1M"]
pos_list = [1, 1, 1, 2, 1]
cstag.consensus(cs_list, cigar_list, pos)
# => cs:Z:=AC*gt*T
Output HTML report
import cstag
cs = "cs:Z:=AC+GGG=T-ACGT*at~gt10cg=GNNN"
output = "report"
description = "Example"
cstag.to_html(cs, output, description)
# => Output "report.html"
The report.html
is :point_down:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cstag-0.1.1.tar.gz
(5.7 kB
view hashes)
Built Distribution
cstag-0.1.1-py3-none-any.whl
(6.8 kB
view hashes)