Mercurial > repos > gga > apollo_feat_from_gff3
comparison create_features_from_gff3.py @ 13:bb562d95b6cd draft
"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/apollo commit 7bf18c69becc57152efdadedf7ebd0bcfa382a15"
author | gga |
---|---|
date | Mon, 29 Jun 2020 09:17:58 -0400 |
parents | 5d1cf95ade8a |
children |
comparison
equal
deleted
inserted
replaced
12:d022c003c7a3 | 13:bb562d95b6cd |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 import argparse | 2 import argparse |
3 import json | |
3 import logging | 4 import logging |
4 | 5 |
5 from apollo import accessible_organisms | 6 from apollo import accessible_organisms |
6 from apollo.util import GuessOrg, OrgOrGuess | 7 from apollo.util import GuessOrg, OrgOrGuess |
7 | 8 |
14 | 15 |
15 if __name__ == '__main__': | 16 if __name__ == '__main__': |
16 parser = argparse.ArgumentParser(description='Sample script to add an attribute to a feature via web services') | 17 parser = argparse.ArgumentParser(description='Sample script to add an attribute to a feature via web services') |
17 parser.add_argument('email', help='User Email') | 18 parser.add_argument('email', help='User Email') |
18 parser.add_argument('--source', help='URL where the input dataset can be found.') | 19 parser.add_argument('--source', help='URL where the input dataset can be found.') |
20 parser.add_argument('--use_name', action='store_true', help='Use the given name instead of generating one.') | |
21 parser.add_argument('--disable_cds_recalculation', action='store_true', help='Disable CDS recalculation and instead use the one provided.') | |
19 OrgOrGuess(parser) | 22 OrgOrGuess(parser) |
20 | 23 |
21 parser.add_argument('gff3', type=argparse.FileType('r'), help='GFF3 file') | 24 parser.add_argument('gff3', type=argparse.FileType('r'), help='GFF3 file') |
22 args = parser.parse_args() | 25 args = parser.parse_args() |
23 | 26 |
40 | 43 |
41 orgs = accessible_organisms(gx_user, [org_cn], 'WRITE') | 44 orgs = accessible_organisms(gx_user, [org_cn], 'WRITE') |
42 if not orgs: | 45 if not orgs: |
43 raise Exception("You do not have write permission on this organism") | 46 raise Exception("You do not have write permission on this organism") |
44 | 47 |
45 wa.annotations.load_gff3(org_cn, args.gff3, args.source) | 48 load_result = wa.annotations.load_gff3(org_cn, args.gff3, args.source, use_name=args.use_name, disable_cds_recalculation=args.disable_cds_recalculation) |
49 print(json.dumps(load_result, indent=2)) |