Mercurial > repos > matt-shirley > sra_fetch
view sra_fetch.py @ 1:aa7ab53c53bf draft
Started working on the python FTP script.
author | matt-shirley |
---|---|
date | Tue, 13 Nov 2012 22:32:13 -0500 |
parents | |
children | be22544bfafa |
line wrap: on
line source
from ftplib import FTP import os, sys, os.path # Get accession number from argument accession = sys.argv[1] prefix = accession[0:2].uppercase() middle = accession[3:5] suffix = accession[6:8] ftp = FTP('ftp.ncbi.nlm.nih.gov') def handleDownload(block): file.write(block) ftp.login() ftp.cwd('/sra/sra-instant/reads/BySample/sra/