Commit 4cdba9e5 by Riccardo Vicedomini

filter_hits now works even if input files do not exist

parent 8f9ed6a3
...@@ -8,6 +8,8 @@ from collections import defaultdict ...@@ -8,6 +8,8 @@ from collections import defaultdict
from mclade_utils import * from mclade_utils import *
script_name = os.path.splitext( os.path.basename(__file__) )[0]
# ARGUMENTS # ARGUMENTS
RESULT_FILE = "result_file" RESULT_FILE = "result_file"
OUT_RESULT_FILE = "out_result_files" OUT_RESULT_FILE = "out_result_files"
...@@ -30,6 +32,8 @@ def main(): ...@@ -30,6 +32,8 @@ def main():
# load results file and sort the hits by decreasing score # load results file and sort the hits by decreasing score
results = [] results = []
for result_filename in args[RESULT_FILE]: for result_filename in args[RESULT_FILE]:
if not os.path.isfile(result_filename):
continue
with open(result_filename,'r') as result_file: with open(result_filename,'r') as result_file:
for line in result_file: for line in result_file:
results.append( line.rstrip(' \n\r').split('\t') ) results.append( line.rstrip(' \n\r').split('\t') )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment