Skip to content

Instantly share code, notes, and snippets.

@sumonst21
Forked from AntonPetrov/download_nrlist.py
Created October 22, 2019 16:46
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 sumonst21/ca293c52da8769142b456b5c30968fca to your computer and use it in GitHub Desktop.
Save sumonst21/ca293c52da8769142b456b5c30968fca 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