Mercurial > repos > guerler > springsuite
comparison spring_minz.py @ 11:21a7dd67b483 draft
"planemo upload commit f208fb81425711754738fc8e612ee2d5cc26377f"
author | guerler |
---|---|
date | Fri, 25 Sep 2020 19:07:14 +0000 |
parents | 4ac5d5a9b21c |
children | 4a4888bf0338 |
comparison
equal
deleted
inserted
replaced
10:860bd6f8f480 | 11:21a7dd67b483 |
---|---|
39 minz = score | 39 minz = score |
40 if minz > args.minscore: | 40 if minz > args.minscore: |
41 interactions.append((name, minz)) | 41 interactions.append((name, minz)) |
42 print("Predicting: %s, min-Z: %s" % (name, minz)) | 42 print("Predicting: %s, min-Z: %s" % (name, minz)) |
43 interactions.sort(key=lambda tup: tup[1], reverse=True) | 43 interactions.sort(key=lambda tup: tup[1], reverse=True) |
44 with open(args.output, 'w') as output_file: | 44 with open(args.output, 'a+') as output_file: |
45 for i in interactions: | 45 for i in interactions: |
46 output_file.write("%s %s\n" % (i[0], i[1])) | 46 output_file.write("%s %s %s\n" % (args.name, i[0], i[1])) |
47 | 47 |
48 def get_template_scores(hhr_file, min_score, identifier_length): | 48 def get_template_scores(hhr_file, min_score, identifier_length): |
49 result = {} | 49 result = {} |
50 identifier_length = identifier_length + 4 | 50 identifier_length = identifier_length + 4 |
51 if os.path.isfile(hhr_file): | 51 if os.path.isfile(hhr_file): |
61 return result | 61 return result |
62 | 62 |
63 if __name__ == "__main__": | 63 if __name__ == "__main__": |
64 parser = argparse.ArgumentParser(description='This script identifies interactions by detecting matching HH-search results.') | 64 parser = argparse.ArgumentParser(description='This script identifies interactions by detecting matching HH-search results.') |
65 parser.add_argument('-t', '--target', help='HHR target file result', required=True) | 65 parser.add_argument('-t', '--target', help='HHR target file result', required=True) |
66 parser.add_argument('-n', '--name', help='HHR target name', required=True) | |
66 parser.add_argument('-c', '--crossreference', help='Cross Reference index file', required=True) | 67 parser.add_argument('-c', '--crossreference', help='Cross Reference index file', required=True) |
67 parser.add_argument('-x', '--idx', help='Length of identifier', type=int, default=6) | 68 parser.add_argument('-x', '--idx', help='Length of identifier', type=int, default=6) |
68 parser.add_argument('-l', '--list', help='Text file containing identifiers.', required=True) | 69 parser.add_argument('-l', '--list', help='Text file containing identifiers.', required=True) |
69 parser.add_argument('-i', '--inputs', help='Directory containing `hhr` files', required=True) | 70 parser.add_argument('-i', '--inputs', help='Directory containing `hhr` files', required=True) |
70 parser.add_argument('-o', '--output', help='Output file containing minZ-scores`', required=True) | 71 parser.add_argument('-o', '--output', help='Output file containing minZ-scores`', required=True) |