Skip to content

Instantly share code, notes, and snippets.

@AntonPetrov
Created September 21, 2012 14:48
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save AntonPetrov/3761913 to your computer and use it in GitHub Desktop.
A sample python script for downloading the current non-redundant lists from the RNA 3D Hub
"""
A sample python script for downloading the current non-redundant lists from
the RNA 3D Hub (http://rna.bgsu.edu/rna3dhub).
Usage:
python download_nrlist.py
"""
import urllib2
# nrlist are provided at 8 resolution cutoffs
resolutions = ['1.5A', '2.0A', '2.5A', '3.0A', '3.5A', '4.0A', '20.0A', 'all']
base_url = 'http://rna.bgsu.edu/rna3dhub/nrlist/download'
for resolution in resolutions:
release = 'current' # can be replaced with a specific release id, e.g. 0.70
url = '/'.join([base_url, release, resolution])
try:
nrdata = urllib2.urlopen( url ).read()
# nrdata now contains the string with data in csv format
print "Release %s, resolution %s: download complete" % \
(release, resolution)
except:
print "Release %s, resolution %s: download failed" % \
(release, resolution)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment