Skip to content

Commit

Permalink
More absolute path fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlees committed Jul 2, 2018
1 parent 1a7bed6 commit d4e858e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions PopPUNK/mash.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,10 @@ def queryDatabase(qFile, klist, dbPrefix, queryPrefix, self = True, number_plot_
mash_cmd = mash_exec + " dist -p " + str(threads) + " " + ref_dbname + " " + query_dbname

if no_stream:
tmpHandle, tmpName = mkstemp(prefix=dbPrefix, suffix=".tmp", dir="./" + dbPrefix)
tmpHandle, tmpName = mkstemp(prefix=os.path.basename(dbPrefix),
suffix=".tmp", dir="./" + os.path.basename(dbPrefix))
mash_cmd += " > " + tmpName
mash_cmd += " 2> " + dbPrefix + ".err.log"
mash_cmd += " 2> " + os.path.basename(dbPrefix) + ".err.log"
sys.stderr.write(mash_cmd + "\n")

try:
Expand Down
4 changes: 2 additions & 2 deletions PopPUNK/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ def addQueryToNetwork(rlist, qlist, qfile, G, kmers, assignments, model,
sys.stderr.write("Found novel query clusters. Calculating distances between them:\n")

# write unassigned queries to file as if a list of references
tmpDirName = mkdtemp(prefix=queryDB, suffix="_tmp", dir="./")
tmpHandle, tmpFile = mkstemp(prefix=queryDB, suffix="_tmp", dir=tmpDirName)
tmpDirName = mkdtemp(prefix=os.path.basename(queryDB), suffix="_tmp", dir="./")
tmpHandle, tmpFile = mkstemp(prefix=os.path.basename(queryDB), suffix="_tmp", dir=tmpDirName)
with open(tmpFile, 'w') as tFile:
for query in unassigned:
tFile.write(query + '\n')
Expand Down
2 changes: 1 addition & 1 deletion PopPUNK/prune_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def main():
sys.stderr.write("Resketching sequences\n")

# Write names to file
tmpHandle, tmpName = mkstemp(prefix=args.output, suffix=".tmp", dir=".")
tmpHandle, tmpName = mkstemp(prefix=os.path.basename(args.output), suffix=".tmp", dir=".")
with open(tmpName, 'w') as tmpRefFile:
for newRefSeq in newRefList:
tmpRefFile.write(newRefSeq + "\n")
Expand Down

0 comments on commit d4e858e

Please sign in to comment.