用于操作 minimap2 的 CS 标签的 Python 模块
项目描述
cstag
cstag
是一个 Python 模块,用于操作minimap2 的 CS 标签。
cstag.shorten()
: 将 cs 标签从长格式转换为短格式cstag.lengthen()
: 将 cs 标签从短格式转换为长格式cstag.consensus()
: 从多个 cs 标签生成一个共识 cs 标签cstag.mask()
: 屏蔽 cs 标签中的低质量碱基cstag.to_html()
:输出html报告
有关更多信息,请参阅文档。
安装
来自PyPI:
pip install cstag
来自Bioconda:
conda install -c bioconda cstag
例子
缩短/延长
import cstag
# Convert a cs tag from long to short
cs = "cs:Z:=ACGT*ag=CGT"
cstag.shorten(cs)
# => cs:Z::4*ag:3
# Convert a cs tag from short to long
cs = "cs:Z::4*ag:3"
cigar = "8M"
seq = "ACGTACGT"
cstag.lengthen(cs, cigar, seq)
# => cs:Z:=ACGT*ag=CGT
调用共识
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_list)
# => cs:Z:=AC*gt*T
屏蔽 cs 标签中的低质量碱基
import cstag
cs = "cs:Z:=ACGT*ac+gg-cc=T"
cigar = "5M2I2D1M"
qual = "AA!!!!AA"
phred_threshold = 10
cstag.mask(cs, cigar, qual, phred_threshold)
# => cs:Z:=ACNN*an+ng-cc=T
输出 HTML 报告
import cstag
from pathlib import Path
cs = "cs:Z:=AC+GGG=T-ACGT*at~gt10cg=GNNN"
description = "Example"
cstag_html = cstag.to_html(cs, description)
Path("report.html").write_text(cstag_html)
# => Output "report.html"
是report.html
:point_down:
项目详情
关
cstag-0.3.1.zip的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 62197215419ee94de7fbb5ff91bafd361f5a2df7ab0a3ee134c8fce399c4f531 |
|
MD5 | 7e2a9f3e70f6dbc97871d3238c6ccaa4 |
|
布莱克2-256 | 953aa8902dbf66edcdd137d9f1ac825c3acf3d2ea89758f1088de2c112e40600 |