Created
November 9, 2012 22:34
-
-
Save AntonPetrov/4048758 to your computer and use it in GitHub Desktop.
A sample script for downloading RNA 3D Motif Atlas entries.
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
""" | |
A sample python script for downloading Motif Atlas entries from | |
the RNA 3D Motif Atlas (http://rna.bgsu.edu/rna3dhub/motifs). | |
Usage: | |
python motif_download.py | |
""" | |
import urllib2 | |
import json | |
url = 'http://rna.bgsu.edu/rna3dhub/motif/view/IL_85647.1/json' | |
json_data = urllib2.urlopen(url).read() | |
motif = json.loads(json_data) | |
print 'Motif id: %s' % motif['motif_id'] | |
print 'Common name: %s' % motif['common_name'] | |
print 'Annotation: %s' % motif['annotation'] | |
print 'Basepair signature: %s' % motif['bp_signature'] | |
print '%s instances' % motif['num_instances'] | |
print '%s nucleotides' % motif['num_nucleotides'] | |
for loop_id, nts in motif['alignment'].iteritems(): | |
print 'Loop id %s' % loop_id | |
print nts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment