Mercurial > repos > gga > apollo_delete_features
comparison list_organisms.py @ 5:f7e9c792047b draft
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/apollo commit 85194fa009ead2c34720faab61a4143fc29d17c2
author | gga |
---|---|
date | Fri, 31 Aug 2018 09:34:42 -0400 |
parents | 4dd45d2fd904 |
children | df0e4eb2dfa5 |
comparison
equal
deleted
inserted
replaced
4:40b26f8269a3 | 5:f7e9c792047b |
---|---|
2 from __future__ import print_function | 2 from __future__ import print_function |
3 | 3 |
4 import argparse | 4 import argparse |
5 import json | 5 import json |
6 | 6 |
7 from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms | 7 from webapollo import WAAuth, WebApolloInstance, accessible_organisms |
8 | 8 |
9 if __name__ == '__main__': | 9 if __name__ == '__main__': |
10 parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') | 10 parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') |
11 WAAuth(parser) | 11 WAAuth(parser) |
12 parser.add_argument('email', help='User Email') | 12 parser.add_argument('email', help='User Email') |
13 args = parser.parse_args() | 13 args = parser.parse_args() |
14 | 14 |
15 wa = WebApolloInstance(args.apollo, args.username, args.password) | 15 wa = WebApolloInstance(args.apollo, args.username, args.password) |
16 | 16 |
17 gx_user = AssertUser(wa.users.loadUsers(email=args.email)) | 17 gx_user = wa.users.assertOrCreateUser(args.email) |
18 | |
18 all_orgs = wa.organisms.findAllOrganisms() | 19 all_orgs = wa.organisms.findAllOrganisms() |
19 | 20 |
20 orgs = accessible_organisms(gx_user, all_orgs) | 21 orgs = accessible_organisms(gx_user, all_orgs) |
21 | 22 |
22 print(json.dumps(orgs, indent=2)) | 23 print(json.dumps(orgs, indent=2)) |