changeset 2:837fafa672d2 draft

common uncompressed files are now gzipped upons transfer to the ftp directory to save space.
author geert-vandeweyer
date Tue, 07 May 2013 09:02:02 -0400
parents 47070a3859df
children fe42761670f1
files DownloadFiles.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/DownloadFiles.py	Thu Jan 10 04:09:38 2013 -0500
+++ b/DownloadFiles.py	Tue May 07 09:02:02 2013 -0400
@@ -29,7 +29,7 @@
     fout.write("<p><ol> ")
     now = datetime.datetime.now()
     date=str(now)[:10]
-    fout.write("<li>%s</li>" %(len(sys.argv)))
+    #fout.write("<li>%s</li>" %(len(sys.argv)))
     # compose ftp storage location
     ftpdir="%s/%s/" %(ftpdirconfig,useremail)
     if len(folder) == 0:
@@ -46,9 +46,15 @@
     while filecounter < len(sys.argv):
 	inp = sys.argv[filecounter]
 	name = sys.argv[(filecounter+1)]
+	name = name.replace(':','_')
+	name = name.replace(' ','_')
+	name = name.replace('@','_AT_')
 	ext = sys.argv[(filecounter+2)]
 	# copy files to tmp dir & filenames
 	os.system("cp '%s' '%s/%s.%s'" %(inp, storedir,name,ext))
+	## gzip if fastq/fastqsanger/vcf
+	if ( ext == "fastq" or ext == "fastqsanger" or ext == "vcf" or ext == "sam" or ext == "txt"): 
+		os.system("gzip -9 '%s/%s.%s'" %(storedir,name,ext))
 	fout.write("<li>%s.%s</li>" %(name,ext))
 	filecounter +=3