01API
1.创建BedTool对象
##读取bed文件
>>> import pybedtools
>>> # use a BED file that ships with pybedtools...
>>> a = pybedtools.example_bedtool('a.bed')
>>> # ...or use your own by passing a filename
>>> a = pybedtools.BedTool('peaks.bed')2.两个bed文件取交集intersection
intersection>>> a = pybedtools.example_bedtool('a.bed')
>>> b = pybedtools.example_bedtool('b.bed')
>>> a_and_b = a.intersect(b)
##使用loj参数
a_b=a.intersect(b,loj=True)
## 遍历结果文件
a_b.head()3.保存结果文件saveas
saveas4.过滤初始的输入bed文件
5.根据bed文件提取序列
6.改变bed文件
7.删除临时文件
8.批量取交集
Last updated