本文整理汇总了Python中pybedtools.BedTool.window_maker方法的典型用法代码示例。如果您正苦于以下问题:Python BedTool.window_maker方法的具体用法?Python BedTool.window_maker怎么用?Python BedTool.window_maker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pybedtools.BedTool
的用法示例。
在下文中一共展示了BedTool.window_maker方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeBedWindows
# 需要导入模块: from pybedtools import BedTool [as 别名]
# 或者: from pybedtools.BedTool import window_maker [as 别名]
def makeBedWindows(windowWidth, bedtool, step=None):
"""
Generate windows with width=windowWidth given a pybedtools.BedTool object and
return dictionary of HTSeq.GenomicInterval objects.
windowWidth=int.
bedtool=pybedtools.BedTool object.
"""
from pybedtools import BedTool
import HTSeq
if step is None:
step = windowWidth
w = BedTool.window_maker(BedTool(), b=bedtool, w=windowWidth, s=step)
windows = dict()
for interval in w:
feature = HTSeq.GenomicInterval(
interval.chrom,
interval.start,
interval.end
)
name = "_".join(interval.fields)
windows[name] = feature
return windows
示例2: makeGenomeWindows
# 需要导入模块: from pybedtools import BedTool [as 别名]
# 或者: from pybedtools.BedTool import window_maker [as 别名]
def makeGenomeWindows(windowWidth, genome, step=None):
"""
Generate windows genome-wide for a given genome with width=windowWidth and
return dictionary of HTSeq.GenomicInterval objects.
windowWidth=int.
genome=str.
"""
from pybedtools import BedTool
import HTSeq
if step is None:
step = windowWidth
w = BedTool.window_maker(BedTool(), genome=genome, w=windowWidth, s=step)
windows = dict()
for interval in w:
feature = HTSeq.GenomicInterval(
interval.chrom,
interval.start,
interval.end
)
name = "_".join(interval.fields)
windows[name] = feature
return windows