Mercurial > repos > gga > apollo_create_or_update
diff export.py @ 5:696a1962212e 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:59 -0400 |
parents | aee984715db1 |
children | d72192ec8e39 |
line wrap: on
line diff
--- a/export.py Mon Mar 12 06:32:08 2018 -0400 +++ b/export.py Fri Aug 31 09:33:59 2018 -0400 @@ -9,7 +9,7 @@ from Bio import SeqIO -from webapollo import CnOrGuess, GuessCn, WAAuth, WebApolloInstance +from webapollo import CnOrGuess, GuessCn, PermissionCheck, WAAuth, WebApolloInstance try: import StringIO as io @@ -71,15 +71,21 @@ parser.add_argument('--gff', type=argparse.FileType('w')) parser.add_argument('--fasta', type=argparse.FileType('w')) parser.add_argument('--json', type=argparse.FileType('w')) - + parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) org_cn_list, seqs = GuessCn(args, wa) + # User must have an apollo account, if not, create it + gx_user = wa.users.assertOrCreateUser(args.email) + org_data = [] for org_cn in org_cn_list: + # User must have read permission on organism + if not PermissionCheck(gx_user, org_cn, "READ"): + continue indiv_org_data = export(org_cn, seqs) org_data.append(indiv_org_data) args.json.write(json.dumps(org_data, indent=2))