def loadHiC(expression): seen=set() with open(HIC,"rt") as IN: for line in IN: fields=line.rstrip().split() (chr1,begin1,end1,chr2,begin2,end2)=fields if(chr1!=chr2): continue array=expression.get(chr1,None) if(array is None): return anchor1=Interval(int(begin1),int(end1)) anchor2=Interval(int(begin2),int(end2)) anchor1.type=anchor2.type="anchor" anchor1.mate=anchor2 anchor2.mate=anchor1 anchor1.objects=[]; anchor2.objects=[] key1=chr1+" "+begin1+" "+end1 key2=chr2+" "+begin2+" "+end2 if(key1 not in seen): array.append(anchor1) if(key2 not in seen): array.append(anchor2) seen.add(key1); seen.add(key2)
def loadHiC(expression): seen=set() with open(HIC,"rt") as IN: for line in IN: fields=line.rstrip().split() (chr1,begin1,end1,chr2,begin2,end2)=fields array=expression.get(chr1,None) if(array is None): return tad=Interval(int(begin1),int(end1)) tad.type="anchor" tad.objects=[] key=chr1+" "+begin1+" "+end1 if(key not in seen): array.append(tad) seen.add(key)