comparison esummary.py @ 0:92bd8a680b9d draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 15bcc5104c577b4b9c761f2854fc686c07ffa9db
author iuc
date Thu, 07 Jul 2016 02:41:02 -0400
parents
children c8d4ea6376a7
comparison
equal deleted inserted replaced
-1:000000000000 0:92bd8a680b9d
1 #!/usr/bin/env python
2 import argparse
3 import eutils
4
5
6 if __name__ == '__main__':
7 parser = argparse.ArgumentParser(description='ESummary', epilog='')
8 parser.add_argument('db', help='Database to use')
9 parser.add_argument('--id_list', help='list of ids')
10 parser.add_argument('--id', help='Comma separated individual IDs')
11 parser.add_argument('--history_file', help='Filter existing history')
12 parser.add_argument('--user_email', help="User email")
13 parser.add_argument('--admin_email', help="Admin email")
14 args = parser.parse_args()
15
16 c = eutils.Client(history_file=args.history_file, user_email=args.user_email, admin_email=args.admin_email)
17
18 merged_ids = c.parse_ids(args.id_list, args.id, args.history_file)
19
20 payload = {
21 'db': args.db,
22 }
23
24 if args.history_file is not None:
25 payload.update(c.get_history())
26 else:
27 payload['id'] = ','.join(merged_ids)
28
29 print c.summary(**payload)