Skip to content

Commit

Permalink
Fixed length 0 cluster issue
Browse files Browse the repository at this point in the history
Fixed a bug that was introduced by the previous update
  • Loading branch information
OmarOakheart authored Oct 28, 2020
1 parent 24ea7f9 commit 326bd2f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions bin/nPhase.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,14 +763,15 @@ def nPhase(longReadSNPAssignments,strainName,contextDepthsFilePath,outFolder,mai
if len(chrms)>2:
print("MULTI-CHROMOSOME CLUSTER ERROR",chrms)
exit(1)
for readName in clusterInfo["names"]:
readName=readName.replace("chimeric-","")
if readName in splitTrackingDict:
splitReads=splitTrackingDict[readName][list(chrms)[0]]
for splitRead in splitReads:
clusterReadText+="\t".join([clusterName,splitRead])+"\n"
else:
clusterReadText+="\t".join([clusterName,readName])+"\n"
if len(chrms)>0:
for readName in clusterInfo["names"]:
readName=readName.replace("chimeric-","")
if readName in splitTrackingDict:
splitReads=splitTrackingDict[readName][list(chrms)[0]]
for splitRead in splitReads:
clusterReadText+="\t".join([clusterName,splitRead])+"\n"
else:
clusterReadText+="\t".join([clusterName,readName])+"\n"

clusterReadFilePath=os.path.join(outFolder,strainName+"_"+str(minOvl)+"_"+str(minSim)+"_"+str(maxID)+"_"+str(minLen)+"_clusterReadNames.tsv")
clusterReadFile=open(clusterReadFilePath,"w")
Expand Down

0 comments on commit 326bd2f

Please sign in to comment.