Skip to content

Instantly share code, notes, and snippets.

@kzfm
Created February 25, 2016 05:55
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 kzfm/f0fa3ec38c3f82ff2021 to your computer and use it in GitHub Desktop.
Save kzfm/f0fa3ec38c3f82ff2021 to your computer and use it in GitHub Desktop.
draget ver0.0
#/bin/env python
import requests
import sys
from pyquery import PyQuery as pq
def get_result(acc):
r = requests.get("http://trace.ddbj.nig.ac.jp/DRASearch/run?acc={}".format(acc))
d =pq(r.content)
d = d("#detail_header")
d = d(".header_link:first")
return d("a").attr("href")
if __name__ == '__main__':
ACC = sys.argv[1]
URL = get_result(ACC)
print "{}/{}.fastq.bz2".format(URL, ACC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment