Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Code_v1.5.1/python.calculateReadsDepthOfAmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions Code_v1.5.1/python.getCNVPerSample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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)
# print("Maybe all values are nan for "+inSample)
2 changes: 1 addition & 1 deletion Code_v1.5.1/python.scoreCNV.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<idx2):
FalseIDList.append(ID2)
FalseIDList.append(ID2)

outVsList=[]
for ID in outVDic.keys():
Expand Down