comparison ecitmatch.py @ 5:20a86bfb54eb 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:38:00 -0400
parents 22fed2340d2b
children 2d54a753d1f1
comparison
equal deleted inserted replaced
4:484b84b30c75 5:20a86bfb54eb
3 import eutils 3 import eutils
4 4
5 5
6 if __name__ == '__main__': 6 if __name__ == '__main__':
7 parser = argparse.ArgumentParser(description='ECitMatch', epilog='') 7 parser = argparse.ArgumentParser(description='ECitMatch', epilog='')
8 parser.add_argument('--file', help='Tabular file containing citations to search') 8 parser.add_argument('--file', type=argparse.FileType('r'), help='Tabular file containing citations to search')
9 9
10 parser.add_argument('--key', nargs='*', help='Citation Key') 10 parser.add_argument('--key', nargs='*', help='Citation Key')
11 parser.add_argument('--journal_title', nargs='*', help='Journal Title') 11 parser.add_argument('--journal_title', nargs='*', help='Journal Title')
12 parser.add_argument('--year', nargs='*', help='Year') 12 parser.add_argument('--year', nargs='*', help='Year')
13 parser.add_argument('--volume', nargs='*', help='Volume') 13 parser.add_argument('--volume', nargs='*', help='Volume')
33 'first_page': first_page, 33 'first_page': first_page,
34 'author_name': author_name, 34 'author_name': author_name,
35 }) 35 })
36 else: 36 else:
37 for line in args.file: 37 for line in args.file:
38 line = line.strip()
38 if not line.startswith('#'): 39 if not line.startswith('#'):
39 tmp = line.split('\t') 40 tmp = line.split('\t')
40 try: 41 try:
41 citations.append({ 42 citations.append({
42 'journal': tmp[0], 43 'journal': tmp[0],