comparison list_organisms.py @ 5:1a2976c6b161 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:33:16 -0400
parents c6d7f19953a6
children dca2fb399ee6
comparison
equal deleted inserted replaced
4:9968eec7430e 5:1a2976c6b161
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))