应用单倍型参考dna序列的文库
happer的Python项目详细描述
快乐者
Daniel Standage,2018年
https://github.com/bioforensics/happer
happer是生成完整单倍型序列的最小Python库。 给定一个参考序列和以bed格式注释的单倍型等位基因,happer将突变参考并产生与指定单倍型匹配的序列。
安装
要安装:
pip3 install happer
要确保软件包安装正确:
pip3 install pytest py.test --pyargs happer
happer需要python版本3。
用法
参考序列必须以fasta格式提供,单体型等位基因必须以bed格式指定,如下所示。
对应于基因座上不同单倍型的等位基因由|
特征分开,因此例如,二倍体个体在每个基因座上应该有2|
分开的等位基因注释,而四倍体则有4个等位基因。
在下面的例子中,CCGA
等位基因是分阶段的,代表一个单倍型,而TATG
等位基因是分阶段的,代表另一个单倍型。
#SeqID Start End Alleles chr1 38827 38828 C|T chr1 59288 59289 C|A chr2 24771 24772 G|T chr4 201191 201192 A|G
从命令行调用happer:
[standage@lappy ~]$ happer --out haploseqs.fasta refr.fasta alleles.bed
在python中直接调用happer:
>>>importhapper>>>seqfile=open('refr.fasta','r')>>>alleles=open('alleles.bed','r')>>>forlabel,haploseqinhapper.mutate.mutate(seqfile,alleles):...# do whatever you'd like with the sequences