# HG changeset patch # User matt-shirley # Date 1352863933 18000 # Node ID aa7ab53c53bfeb9239c8964546165654f3d805fa # Parent abdb4762ebcb65ce11f4bff58daba8891948d285 Started working on the python FTP script. diff -r abdb4762ebcb -r aa7ab53c53bf sra_fetch.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sra_fetch.py Tue Nov 13 22:32:13 2012 -0500 @@ -0,0 +1,16 @@ +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/