FAQ — pysam 0.18.0 documentation
pysam.readthedocs.io › en › latestIt is important to remember that pysam will always conform to the python convention and translate to/from the file format automatically. The only exception is the region string in the fetch () and pileup () methods. This string follows the convention of the samtools command line utilities.
生物信息基础:基因组文件读写(pysam) - 知乎
https://zhuanlan.zhihu.com/p/297858072import pysam # 构建FastaFile对象,随机访问需要先创建faidx,没有的话在这里会自动创建faidx fa = pysam. FastaFile ("ex1.fa") # Fasta文件中序列的数量,结果是一个整数 print ("number of reference sequences: %d " % fa. nreferences) # Fasta文件中序列的名称,结果是一个列表 print ("names of reference sequences: "+ ",". join (fa. references ...
Introduction — pysam 0.18.0 documentation
pysam.readthedocs.io › en › latestPysam is a python module that makes it easy to read and manipulate mapped short read sequence data stored in SAM/BAM files. It is a lightweight wrapper of the htslib C-API. This page provides a quick introduction in using pysam followed by the API. See Working with BAM/CRAM/SAM-formatted files for more detailed usage instructions.