1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
Author: Tim Booth <tbooth@ceh.ac.uk>
Last-Changed: Fri, 25 Apr 2014 17:27:42 +0100
Description: Get Cogent to work with newer CD-HIT that doesn't leave
a temporary file sitting around. This patch has only been quickly tested and
there may be deeper issues.
--- PyCogent-1.5.3.orig/cogent/app/cd_hit.py
+++ PyCogent-1.5.3/cogent/app/cd_hit.py
@@ -257,7 +257,10 @@
# perform cleanup
res.cleanUp()
shutil.rmtree(working_dir)
- remove(params['-o'] + '.bak.clstr')
+ try:
+ remove(params['-o'] + '.bak.clstr')
+ except OSError:
+ pass #maybe there was no file
return remapped_clusters
@@ -299,7 +302,10 @@
# perform cleanup
res.cleanUp()
shutil.rmtree(working_dir)
- remove(params['-o'] + '.bak.clstr')
+ try:
+ remove(params['-o'] + '.bak.clstr')
+ except OSError:
+ pass #maybe there was no file
return SequenceCollection(new_seqs, MolType=moltype)
|