Skip to content

Commit

Permalink
Fixing issue smirarab#70
Browse files Browse the repository at this point in the history
  • Loading branch information
smirarab committed Aug 16, 2019
1 parent b54b00b commit 9eed2c3
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions sepp/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,25 +435,28 @@ def read_results(self):
Reads the search output file and returns a dictionary that contains
the e-values of the searched fragments
'''
if self.fake_run:
return {}
if self.pipe:
outfile = (self.stdoutdata.split("\n"))
return self.read_results_from_temp(outfile)
else:
assert os.path.exists(self.outfile)
assert os.stat(self.outfile)[stat.ST_SIZE] != 0
if self.results_on_temp:
if self.results_on_temp:
if self.fake_run:
res = {}
else:
assert os.path.exists(self.outfile)
assert os.stat(self.outfile)[stat.ST_SIZE] != 0
with open(self.outfile, 'r') as outfile:
res = self.read_results_from_temp(outfile)
with open(self.outfile, 'w') as target:
target.write(str(res))
return self.outfile
with open(self.outfile, 'w') as target:
target.write(str(res))
return self.outfile
else:
if self.fake_run:
res = {}
elif self.pipe:
outfile = self.stdoutdata.split("\n")
res = self.read_results_from_temp(outfile)
else:
outfile = open(self.outfile, 'r')
res = self.read_results_from_temp(outfile)
outfile.close()
return res
return res

# Group 1 (e-value) 2 (bitscore) and 9 (taxon name) contain the
# relevant information, other ones can be ignored unless we plan to
Expand Down

0 comments on commit 9eed2c3

Please sign in to comment.