本文整理汇总了Python中rgt.GenomicRegionSet.GenomicRegionSet.extend方法的典型用法代码示例。如果您正苦于以下问题:Python GenomicRegionSet.extend方法的具体用法?Python GenomicRegionSet.extend怎么用?Python GenomicRegionSet.extend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rgt.GenomicRegionSet.GenomicRegionSet
的用法示例。
在下文中一共展示了GenomicRegionSet.extend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: merge_delete
# 需要导入模块: from rgt.GenomicRegionSet import GenomicRegionSet [as 别名]
# 或者: from rgt.GenomicRegionSet.GenomicRegionSet import extend [as 别名]
def merge_delete(ext_size, merge, peak_list, pvalue_list):
# peaks_gain = read_diffpeaks(path)
regions_plus = GenomicRegionSet('regions') #pot. mergeable
regions_minus = GenomicRegionSet('regions') #pot. mergeable
regions_unmergable = GenomicRegionSet('regions')
last_orientation = ""
for i, t in enumerate(peak_list):
chrom, start, end, c1, c2, strand, ratio = t[0], t[1], t[2], t[3], t[4], t[5], t[6]
r = GenomicRegion(chrom = chrom, initial = start, final = end, name = '', \
orientation = strand, data = str((c1, c2, pvalue_list[i], ratio)))
if end - start > ext_size:
if strand == '+':
if last_orientation == '+':
region_plus.add(r)
else:
regions_unmergable.add(r)
elif strand == '-':
if last_orientation == '-':
region_mins.add(r)
else:
regions_unmergable.add(r)
if merge:
regions_plus.extend(ext_size/2, ext_size/2)
regions_plus.merge()
regions_plus.extend(-ext_size/2, -ext_size/2)
merge_data(regions_plus)
regions_minus.extend(ext_size/2, ext_size/2)
regions_minus.merge()
regions_minus.extend(-ext_size/2, -ext_size/2)
merge_data(regions_minus)
results = GenomicRegionSet('regions')
for el in regions_plus:
results.add(el)
for el in regions_minus:
results.add(el)
for el in regions_unmergable:
results.add(el)
results.sort()
return results