本文整理汇总了Python中rgt.GenomicRegionSet.GenomicRegionSet.mergebyname方法的典型用法代码示例。如果您正苦于以下问题:Python GenomicRegionSet.mergebyname方法的具体用法?Python GenomicRegionSet.mergebyname怎么用?Python GenomicRegionSet.mergebyname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rgt.GenomicRegionSet.GenomicRegionSet
的用法示例。
在下文中一共展示了GenomicRegionSet.mergebyname方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from rgt.GenomicRegionSet import GenomicRegionSet [as 别名]
# 或者: from rgt.GenomicRegionSet.GenomicRegionSet import mergebyname [as 别名]
print("output:\t" + args.o)
with open(args.i) as f, open(args.o, "w") as g:
for line in f:
line = line.strip()
print(line+"\t"+args.v, file=g)
############### BED merge by name ########################################
elif args.mode == "bed_merge_by_name":
print(tag+": [BED] Merge regions by name")
print("input:\t" + args.i)
print("output:\t" + args.o)
bed1 = GenomicRegionSet("input")
bed1.read_bed(args.i)
bed2 = bed1.mergebyname()
bed2.write_bed(args.o)
############### BED rename regions #######################################
elif args.mode == "bed_rename":
print(tag+": [BED] Rename regions by associated genes")
print("input:\t" + args.i)
print("output:\t" + args.o)
print("organism:\t" + args.organism)
bed = GenomicRegionSet(args.i)
bed.read_bed(args.i)
renamebed = bed.gene_association(gene_set=None, organism=args.organism,
promoterLength=args.l,
threshDist=args.t, show_dis=args.d)
renamebed.write_bed(args.o)