comparison get_feature_info.py @ 2:950d9d11b6fb draft

planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/Ensembl-REST commit 099d38157cec200f0a343579ca9babcd8acb266f
author earlhaminst
date Wed, 21 Dec 2016 15:16:35 -0500
parents 98aba0efe77a
children 0602dcf02768
comparison
equal deleted inserted replaced
1:98aba0efe77a 2:950d9d11b6fb
1 # A simple tool to connect to the Ensembl server and retrieve feature 1 # A simple tool to connect to the Ensembl server and retrieve feature
2 # information using the Ensembl REST API. 2 # information using the Ensembl REST API.
3 from __future__ import print_function
4
3 import json 5 import json
4 import optparse 6 import optparse
5 from urlparse import urljoin
6 7
7 import requests 8 import requests
9 from six.moves.urllib.parse import urljoin
8 10
9 parser = optparse.OptionParser() 11 parser = optparse.OptionParser()
10 parser.add_option('-i', '--input', help='List of Ensembl IDs') 12 parser.add_option('-i', '--input', help='List of Ensembl IDs')
11 parser.add_option('-e', '--expand', type='choice', choices=['0', '1'], 13 parser.add_option('-e', '--expand', type='choice', choices=['0', '1'],
12 default='0', 14 default='0',
36 data=json.dumps(data)) 38 data=json.dumps(data))
37 39
38 if not r.ok: 40 if not r.ok:
39 r.raise_for_status() 41 r.raise_for_status()
40 42
41 print r.text 43 print(r.text)