目录

pyTwobit

Package for fetching sequence from twobit files from local paths or URLs.

Installing

pip install pyTwobit

Usage

To fetch sequence for a genomic region create a TwoBit object with either a local file path or url. Sequence is fetched with the fetch function which takes chromosome name, start, and end coordinates. The UCSC coordinate convention is used (0 start, half-open).

Local file


from pytwobit import TwoBit

twobit = TwoBit('test.2bit')
seq = twobit.fetch("chr1", 50, 57)  # -> "CTATCTA"

Remote file


from pytwobit import TwoBit

twobit = TwoBit("https://igv.org/genomes/data/hg38/hg38.2bit")
seq = twobit.fetch("chr1", 120565294, 120565335)  # -> "TATGAACTTTTGTTCGTTGGTgctcagtcctagaccctttt"
关于

Python库,用于读取和操作TwoBit格式的基因组序列文件

47.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号