Mercurial > repos > earlhaminst > ensembl_get_sequences
comparison get_sequences.py @ 2:4b7261f484bb 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:49 -0500 |
parents | e5dd4bd78bbc |
children | 0fa1d1cc417d |
comparison
equal
deleted
inserted
replaced
1:e5dd4bd78bbc | 2:4b7261f484bb |
---|---|
1 # A simple tool to connect to the Ensembl server and retrieve sequences using | 1 # A simple tool to connect to the Ensembl server and retrieve sequences using |
2 # the Ensembl REST API. | 2 # 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 itertools import islice | 7 from itertools import islice |
6 from urlparse import urljoin | |
7 | 8 |
8 import requests | 9 import requests |
10 from six.moves.urllib.parse import urljoin | |
9 | 11 |
10 parser = optparse.OptionParser() | 12 parser = optparse.OptionParser() |
11 parser.add_option('-i', '--input', help='List of Ensembl IDs') | 13 parser.add_option('-i', '--input', help='List of Ensembl IDs') |
12 | 14 |
13 parser.add_option('-s', '--species', type='choice', | 15 parser.add_option('-s', '--species', type='choice', |
41 data=json.dumps(data)) | 43 data=json.dumps(data)) |
42 | 44 |
43 if not r.ok: | 45 if not r.ok: |
44 r.raise_for_status() | 46 r.raise_for_status() |
45 | 47 |
46 print r.text | 48 print(r.text) |