Skip to content

Commit

Permalink
Creates PCR output directory if it does not exist
Browse files Browse the repository at this point in the history
Earlier commit did not deal with the case when the output/pcr-data/
directory did not exist on the current working directory from which
the script is executed. Now, the output/pcr-data sub-directory is
created when it does not exist.
  • Loading branch information
darthshak committed Mar 29, 2019
1 parent 770f40f commit 51c8028
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions PCR.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import sys
from os.path import isfile, join
from os.path import isfile, join, isdir
from os import makedirs
from scipy.sparse import dok_matrix
from scipy.stats import binom

Expand Down Expand Up @@ -161,7 +162,11 @@ def computePCRdist( self, pAmp ):
data sets." Nucleic acids research 43.21 (2015): e143-e143.
"""

possFilePath = join( sys.path[0], 'output', 'pcr-data', '{}-{}.npy'.format( self.nCycles, pAmp ) )
outputPcrPath = join( sys.path[0], 'output', 'pcr-data' )
if not isdir( outputPcrPath ):
makedirs( join( outputPcrPath ) )

possFilePath = join( outputPcrPath, '{}-{}.npy'.format( self.nCycles, pAmp ) )

#In case the distribution has been already computed before, retrieve it
#and return it instead of re-computing it afresh.
Expand Down

0 comments on commit 51c8028

Please sign in to comment.