python 学习之 fasta/fastq 处理利器--pyfastx
作者:互联网
001、 fasta序列迭代
(base) root@PC1:/home/test2# cat a.fasta ## 测试fasta文件 >gene1 myc AGCTGCCTAAGC GGCATAGCTAATCG >gene2 jun ACCGAATCGGAGCGATG GGCATTAAAGATCTAGCT >gene3 malat1 AGGCTAGCGAG GCGCGAG GATTAGGCG >>> import pyfastx ## 导入包 >>> fa = pyfastx.Fastx('a.fasta') ## 读取fasta文件 >>> type(fa) <class 'Fastx'> >>> for i,j,k in fa: ## 迭代, i默认那么; j序列; k注释。 ... print(i) ... print(j) ... print(k) ... gene1 AGCTGCCTAAGCGGCATAGCTAATCG myc gene2 ACCGAATCGGAGCGATGGGCATTAAAGATCTAGCT jun gene3 AGGCTAGCGAGGCGCGAGGATTAGGCG malat1
标签:...,fa,python,fastq,--,print,fasta,pyfastx,## 来源: https://www.cnblogs.com/liujiaxin2018/p/16579502.html