diff --git a/Code_v1.5.1/python.calculateReadsDepthOfAmp.py b/Code_v1.5.1/python.calculateReadsDepthOfAmp.py index 88656b5..9a49859 100644 --- a/Code_v1.5.1/python.calculateReadsDepthOfAmp.py +++ b/Code_v1.5.1/python.calculateReadsDepthOfAmp.py @@ -177,7 +177,7 @@ def MapReadinBamPCR(inBamFile, ampliconDic, ampTree, dedupOp, MQList): if(read.is_duplicate): if(dedupOp=="true"): continue - overlapAmpTreeList=ampTree[inBam.getrname(read.rname).replace("chr","")].search(read.pos+1, read.pos+read.alen+1) ## [start, end) + overlapAmpTreeList=ampTree[inBam.getrname(read.rname).replace("chr","")].overlap(read.pos+1, read.pos+read.alen+1) ## [start, end) if(len(overlapAmpTreeList)==0): pass else: @@ -242,7 +242,7 @@ def MapReadinBamHYB(inBamFile, ampliconDic, ampTree, dedupOp, MQList): if(read.is_duplicate): if(dedupOp=="true"): continue - overlapAmpTreeList=ampTree[inBam.getrname(read.rname).replace("chr","")].search(read.pos+1, read.pos+read.alen+1) ## [start, end) + overlapAmpTreeList=ampTree[inBam.getrname(read.rname).replace("chr","")].overlap(read.pos+1, read.pos+read.alen+1) ## [start, end) if(len(overlapAmpTreeList)==0): pass else: diff --git a/Code_v1.5.1/python.getCNVPerSample.py b/Code_v1.5.1/python.getCNVPerSample.py index c9dffad..a27df84 100644 --- a/Code_v1.5.1/python.getCNVPerSample.py +++ b/Code_v1.5.1/python.getCNVPerSample.py @@ -137,20 +137,20 @@ def getCandidateRegion(self, qType, CBSTree): #### UnifiedRegions ############################## UnifiedRegion={} ID=1 - segmentList=CBSTree[self.chrom].search(self.start, self.end+1) + segmentList=CBSTree[self.chrom].overlap(self.start, self.end+1) segmentList=sorted(segmentList,key=itemgetter(1)) for segment in segmentList: [segChr, segStart, segEnd, segNo, segMean]=segment[-1] if(self.qType=="dup"): dupList=[] - for overlapAmps in list(self.dupTree[segChr].search(segStart, segEnd)): + for overlapAmps in list(self.dupTree[segChr].overlap(segStart, segEnd)): dupList.append(overlapAmps[-1]) if(dupList!=[] and len(dupList)>=minAmpCntInRegion): dupList=sorted(dupList,key=attrgetter('inS')) UnifiedRegion[self.sample+"_"+self.gene+"_"+"dup"+":"+str(ID)]=dupList if(self.qType=="del"): delList=[] - for overlapAmps in list(self.delTree[segChr].search(segStart, segEnd)): + for overlapAmps in list(self.delTree[segChr].overlap(segStart, segEnd)): delList.append(overlapAmps[-1]) if(delList!=[] and len(delList)>=minAmpCntInRegion): delList=sorted(delList,key=attrgetter('inS')) @@ -519,4 +519,4 @@ def readCBSFile(inFileName, dupTh, delTh): getRegionCandidate(genePerSampleDic, outFileName, pTh, CBSTree,minAmpCntInRegion, dupTh, delTh, MQ) #except: # print("Unexpected error:", sys.exc_info()[0]) - # print("Maybe all values are nan for "+inSample) \ No newline at end of file + # print("Maybe all values are nan for "+inSample) diff --git a/Code_v1.5.1/python.scoreCNV.py b/Code_v1.5.1/python.scoreCNV.py index 1b3d18d..bdd49bd 100644 --- a/Code_v1.5.1/python.scoreCNV.py +++ b/Code_v1.5.1/python.scoreCNV.py @@ -260,7 +260,7 @@ def filterOutSmallCNVs(outVDic, sampleCNVDic): if(score1>=score2 and cnvType1==cnvType2 and sample1==sample2 and chr1==chr2 and start1<=start2 and end1>=end2): if (score1==score2 and cnvType1==cnvType2 and sample1==sample2 and chr1==chr2 and start1==start2 and end1==end2): if(idx1