Skip to content

Instantly share code, notes, and snippets.

@AntonPetrov
Created November 9, 2012 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AntonPetrov/4048758 to your computer and use it in GitHub Desktop.
Save AntonPetrov/4048758 to your computer and use it in GitHub Desktop.
A sample script for downloading RNA 3D Motif Atlas entries.
"""
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