Mercurial > repos > bgruening > augustus_training
annotate extract_features.py @ 6:533b140a196a draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit e0d4688a59e6eeba33adcfe803ac43d0bc2863e7"
author | iuc |
---|---|
date | Mon, 30 Aug 2021 21:43:32 +0000 |
parents | da01a05d91c5 |
children |
rev | line source |
---|---|
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
1 #!/usr/bin/env python |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
2 |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
3 import argparse |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
4 import sys |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
5 import textwrap |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
6 |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
7 |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
8 def main(args): |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
9 """ |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
10 Extract the protein and coding section from an augustus gff, gtf file |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
11 Example file: |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
12 HS04636 AUGUSTUS stop_codon 6901 6903 . + 0 Parent=g1.t1 |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
13 HS04636 AUGUSTUS transcription_end_site 8857 8857 . + . Parent=g1.t1 |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
14 # protein sequence = [MLARALLLCAVLALSHTANPCCSHPCQNRGVCMSVGFDQYKCDCTRTGFYGENCSTPEFLTRIKLFLKPTPNTVHYIL |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
15 # THFKGFWNVVNNIPFLRNAIMSYVLTSRSHLIDSPPTYNADYGYKSWEAFSNLSYYTRALPPVPDDCPTPLGVKGKKQLPDSNEIVEKLLLRRKFIPD |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
16 # PQGSNMMFAFFAQHFTHQFFKTDHKRGPAFTNGLGHGVDLNHIYGETLARQRKLRLFKDGKMKYQIIDGEMYPPTVKDTQAEMIYPPQVPEHLRFAVG |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
17 # QEVFGLVPGLMMYATIWLREHNRVCDVLKQEHPEWGDEQLFQTSRLILIGETIKIVIEDYVQHLSGYHFKLKFDPELLFNKQFQYQNRIAAEFNTLYH |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
18 # WHPLLPDTFQIHDQKYNYQQFIYNNSILLEHGITQFVESFTRQIAGRVAGGRNVPPAVQKVSQASIDQSRQMKYQSFNEYRKRFMLKPYESFEELTGE |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
19 # KEMSAELEALYGDIDAVELYPALLVEKPRPDAIFGETMVEVGAPFSLKGLMGNVICSPAYWKPSTFGGEVGFQIINTASIQSLICNNVKGCPFTSFSV |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
20 # PDPELIKTVTINASSSRSGLDDINPTVLLKERSTEL] |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
21 # end gene g1 |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
22 ### |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
23 # |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
24 # ----- prediction on sequence number 2 (length = 2344, name = HS08198) ----- |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
25 # |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
26 # Predicted genes for sequence number 2 on both strands |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
27 # start gene g2 |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
28 HS08198 AUGUSTUS gene 86 2344 1 + . ID=g2 |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
29 HS08198 AUGUSTUS transcript 86 2344 . + . ID=g2.t1;Parent=g2 |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
30 HS08198 AUGUSTUS transcription_start_site 86 86 . + . Parent=g2.t1 |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
31 HS08198 AUGUSTUS exon 86 582 . + . Parent=g2.t1 |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
32 HS08198 AUGUSTUS start_codon 445 447 . + 0 Parent=g2.t1 |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
33 """ |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
34 protein_seq = "" |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
35 coding_seq = "" |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
36 if args.protein: |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
37 po = open(args.protein, "w+") |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
38 if args.codingseq: |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
39 co = open(args.codingseq, "w+") |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
40 |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
41 for line in sys.stdin: |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
42 # protein- and coding-sequence are stored as comments |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
43 if line.startswith("#"): |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
44 line = line[2:].strip() |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
45 if line.startswith("start gene"): |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
46 gene_name = line[11:].strip() |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
47 |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
48 if protein_seq: |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
49 if line.endswith("]"): |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
50 protein_seq += line[:-1] |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
51 po.write( |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
52 ">%s\n%s\n" |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
53 % (gene_name, "\n".join(textwrap.wrap(protein_seq, 80))) |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
54 ) |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
55 protein_seq = "" |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
56 else: |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
57 protein_seq += line |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
58 |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
59 if coding_seq: |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
60 if line.endswith("]"): |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
61 coding_seq += line[:-1] |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
62 co.write( |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
63 ">%s\n%s\n" |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
64 % (gene_name, "\n".join(textwrap.wrap(coding_seq, 80))) |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
65 ) |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
66 coding_seq = "" |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
67 else: |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
68 coding_seq += line |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
69 |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
70 if args.protein and line.startswith("protein sequence = ["): |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
71 if line.endswith("]"): |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
72 protein_seq = line[20:-1] |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
73 po.write( |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
74 ">%s\n%s\n" |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
75 % (gene_name, "\n".join(textwrap.wrap(protein_seq, 80))) |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
76 ) |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
77 protein_seq = "" |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
78 else: |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
79 line = line[20:] |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
80 protein_seq = line |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
81 |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
82 if args.codingseq and line.startswith("coding sequence = ["): |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
83 if line.endswith("]"): |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
84 coding_seq = line[19:-1] |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
85 co.write( |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
86 ">%s\n%s\n" |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
87 % (gene_name, "\n".join(textwrap.wrap(coding_seq, 80))) |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
88 ) |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
89 coding_seq = "" |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
90 else: |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
91 line = line[19:] |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
92 coding_seq = line |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
93 |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
94 if args.codingseq: |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
95 co.close() |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
96 if args.protein: |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
97 po.close() |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
98 |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
99 |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
100 if __name__ == "__main__": |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
101 parser = argparse.ArgumentParser() |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
102 parser.add_argument("-p", "--protein", help="Path to the protein file.") |
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
103 parser.add_argument("-c", "--codingseq", help="Path to the coding file.") |
0
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
104 |
101933e63fa8
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit 4a8f640dec78899be470ddd1c436fc0d158c80f3
bgruening
parents:
diff
changeset
|
105 args = parser.parse_args() |
4
da01a05d91c5
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/augustus commit bba7f5df059fcbeb06e89cf689e9a04d4f22cb76"
iuc
parents:
0
diff
changeset
|
106 main(args) |