Mercurial > repos > guerler > springsuite
annotate spring_map.py @ 37:0be0af9e695d draft
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
author | guerler |
---|---|
date | Wed, 25 Nov 2020 14:35:35 +0000 |
parents | |
children | 80a4b98121b6 |
rev | line source |
---|---|
37
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
1 #! /usr/bin/env python3 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
2 import argparse |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
3 import os |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
4 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
5 from spring_package.DBKit import createFile |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
6 from spring_package.Molecule import Molecule |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
7 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
8 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
9 def getId(line): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
10 line = line.strip() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
11 return line[:4].upper() + line[4:6] |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
12 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
13 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
14 def getPDB(line, args): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
15 pdb = line[:4].lower() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
16 pdbChain = line[5:6] |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
17 pdbFile = "%s/temp.pdb" % args.temp |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
18 pdbDatabaseId = "%s.pdb" % pdb |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
19 createFile(pdbDatabaseId, args.index, args.database, pdbFile) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
20 return pdbFile, pdbChain |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
21 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
22 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
23 def getSequences(fileName): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
24 sequences = dict() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
25 with open(fileName) as file: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
26 for line in file: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
27 if line.startswith(">"): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
28 name = getId(line.split()[0][1:]) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
29 nextLine = next(file) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
30 sequences[name] = nextLine |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
31 return sequences |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
32 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
33 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
34 def getHomologue(queryFile, queryResultFile, databaseFile): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
35 if not os.path.isfile(queryResultFile): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
36 os.system("psiblast -query %s -db %s -out %s" % (queryFile, |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
37 databaseFile, queryResultFile)) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
38 maxMatch = None |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
39 try: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
40 with open(queryResultFile) as file: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
41 for i in range(38): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
42 line = next(file) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
43 maxMatch = getId(line.split()[0]) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
44 except Exception: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
45 return None |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
46 return maxMatch |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
47 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
48 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
49 def main(args): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
50 logFile = open(args.log, "w") |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
51 temp = args.temp.rstrip("/") |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
52 templates = set() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
53 os.system("mkdir -p %s" % temp) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
54 templateSequenceFile = "%s/templates.fasta" % temp |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
55 if not os.path.isfile(templateSequenceFile): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
56 templateSequences = open(templateSequenceFile, "w") |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
57 with open(args.list) as file: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
58 for rawId in file: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
59 templateId = getId(rawId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
60 templates.add(templateId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
61 pdbFile, pdbChain = getPDB(templateId, args) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
62 try: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
63 templateMol = Molecule(pdbFile) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
64 templateSeq = templateMol.getSequence(pdbChain) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
65 templateSequences.write(">%s\n" % templateId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
66 templateSequences.write("%s\n" % templateSeq) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
67 except Exception: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
68 logFile.write("Warning: File not found [%s].\n" % pdbFile) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
69 templateSequences.close() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
70 os.system("makeblastdb -in %s -dbtype prot" % templateSequenceFile) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
71 else: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
72 logFile.write("Using existing sequences for templates [%s].\n" % templateSequenceFile) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
73 logFile.write("Found %s template entries from `%s`.\n" % (len(templates), args.list)) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
74 logFile.flush() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
75 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
76 crossReference = list() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
77 with open(args.cross) as file: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
78 for line in file: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
79 cols = line.split() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
80 if len(cols) != 2: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
81 raise Exception("Invalid line in crossreference [%s]." % line) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
82 crossReference.append(dict(core=cols[0], partner=cols[1])) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
83 logFile.write("Loaded crossreference with %d entries.\n" % len(crossReference)) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
84 logFile.flush() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
85 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
86 for refEntry in crossReference: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
87 coreId = refEntry["core"] |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
88 partnerId = refEntry["partner"] |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
89 partnerFile = "%s/%s.fasta" % (temp, partnerId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
90 partnerResultFile = "%s.result" % partnerFile |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
91 if partnerId in templates: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
92 refEntry["match"] = partnerId |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
93 logFile.write("Found partner in template list alignment [%s].\n" % partnerId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
94 else: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
95 logFile.write("Processing %s.\n" % partnerId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
96 if not os.path.isfile(partnerResultFile): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
97 pdbFile, pdbChain = getPDB(partnerId, args) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
98 partnerMol = Molecule(pdbFile) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
99 partnerSeq = partnerMol.getSequence(pdbChain) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
100 with open(partnerFile, "w") as partnerFasta: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
101 partnerFasta.write(">%s\n" % partnerId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
102 partnerFasta.write("%s" % partnerSeq) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
103 else: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
104 logFile.write("Using existing results. [%s].\n" % partnerId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
105 matchedId = getHomologue(partnerFile, partnerResultFile, |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
106 templateSequenceFile) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
107 if matchedId is None: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
108 logFile.write("Warning: Failed alignment [%s].\n" % partnerId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
109 else: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
110 logFile.write("Found matching entry %s.\n" % matchedId) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
111 refEntry["match"] = matchedId |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
112 logFile.flush() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
113 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
114 finalSet = set() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
115 for refEntry in crossReference: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
116 coreId = refEntry["core"] |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
117 partnerId = refEntry["partner"] |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
118 if "match" in refEntry: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
119 entry = "%s\t%s" % (coreId, refEntry["match"]) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
120 if entry not in finalSet: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
121 finalSet.add(entry) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
122 else: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
123 logFile.write("Warning: Skipping failed missing partner match [%s, %s].\n" % (coreId, partnerId)) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
124 logFile.write("Found %s cross reference entries.\n" % len(finalSet)) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
125 logFile.close() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
126 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
127 with open(args.output, 'w') as output_file: |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
128 for entry in sorted(finalSet): |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
129 output_file.write("%s\n" % entry) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
130 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
131 |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
132 if __name__ == "__main__": |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
133 parser = argparse.ArgumentParser(description='Maps binding partners to template library') |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
134 parser.add_argument('-l', '--list', help='List of template entries [PDB_CHAIN]', required=True) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
135 parser.add_argument('-i', '--index', help='PDB Database Index file (dbkit_index)', required=True) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
136 parser.add_argument('-d', '--database', help='PDB Database files (dbkit)', required=True) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
137 parser.add_argument('-c', '--cross', help='Cross reference (unmapped)', required=True) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
138 parser.add_argument('-o', '--output', help='Cross reference', required=True) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
139 parser.add_argument('-g', '--log', help='Log File', required=True) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
140 parser.add_argument('-t', '--temp', help='Temporary directory', required=True) |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
141 args = parser.parse_args() |
0be0af9e695d
"planemo upload commit c716195a2cc1ed30ff8c4936621091296a93b2fc"
guerler
parents:
diff
changeset
|
142 main(args) |