Created
March 3, 2016 13:13
-
-
Save GenDataPro/7b522ef8b0a5f505586e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, sys | |
import json | |
gene_id = "NCOR2" | |
response = requests.get("http://rest.ensembl.org/lookup/symbol/homo_sapiens/{}?content-type=application/json;expand=1".format(gene_id)) | |
json_data = response.content.decode("utf-8") | |
data = json.loads(json_data) | |
i = 0 | |
numbers = [] | |
while i < len(data.get('Transcript',[])): | |
print data['Transcript'][i]['Translation']['id'] | |
numbers.append(i) | |
i = i + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment