本文整理匯總了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)