当前位置: 首页>>代码示例>>Python>>正文


Python IntervalFile.seek方法代码示例

本文整理汇总了Python中pybedtools.IntervalFile.seek方法的典型用法代码示例。如果您正苦于以下问题:Python IntervalFile.seek方法的具体用法?Python IntervalFile.seek怎么用?Python IntervalFile.seek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pybedtools.IntervalFile的用法示例。


在下文中一共展示了IntervalFile.seek方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: open

# 需要导入模块: from pybedtools import IntervalFile [as 别名]
# 或者: from pybedtools.IntervalFile import seek [as 别名]
    if not os.path.exists(A_idx_file):
        index_bed.index(A_file)
    if not os.path.exists(B_idx_file):
        index_bed.index(B_file)
    
    # load the indices for A and B
    A_map = [] # list of chrom/offset tuples
    for line in open(A_idx_file):
        fields = line.strip().split("\t")
        A_map.append((fields[0], int(fields[1]), int(fields[2]), int(fields[3]), int(fields[4])))
    B_map = [] # list of chrom/offset tuples
    for line in open(B_idx_file):
        fields = line.strip().split("\t")
        B_map.append((fields[0], int(fields[1]), int(fields[2]), int(fields[3]), int(fields[4])))

    # sweep for each chrom in A, the "query file"
    for entry in A_map:
        a_chrom = entry[0]
        a_offset = entry[1]
        b_offset = entry[1]

        # jump to the offset for this chrom
        A.seek(a_offset)
        B.seek(b_offset)
        
        # sweep this chrom in A and B
        A_cardinality = entry[3]
        B_cardinality = entry[3]
        sweep(A, B, A_cardinality, B_cardinality)

开发者ID:arq5x,项目名称:chrom_sweep,代码行数:31,代码来源:chrom_sweep_with_index.py


注:本文中的pybedtools.IntervalFile.seek方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。