comparison TrustStoreGalaxyImport.py @ 23:cf4cf95e6678

blabla
author Catherine Wise <catherine.wise@csiro.au>
date Mon, 13 Jan 2014 09:21:20 +1100
parents 1179f6e90e78
children 7b1720b6acf2
comparison
equal deleted inserted replaced
22:1179f6e90e78 23:cf4cf95e6678
63 print "File is compressed (gzip) but not valid." 63 print "File is compressed (gzip) but not valid."
64 sys.exit(4) 64 sys.exit(4)
65 elif is_gzipped and is_valid: 65 elif is_gzipped and is_valid:
66 # We need to uncompress the temp_name file, but BAM files must remain compressed in the BGZF format 66 # We need to uncompress the temp_name file, but BAM files must remain compressed in the BGZF format
67 CHUNK_SIZE = 2**20 # 1Mb 67 CHUNK_SIZE = 2**20 # 1Mb
68 fd, uncompressed = tempfile.mkstemp(prefix='data_id_%s_upload_gunzip_' % dataset.dataset_id, dir=os.path.dirname(outputFile), text=False ) 68 fd, uncompressed = tempfile.mkstemp(prefix='data_id_upload_gunzip_', dir=os.path.dirname(outputFile), text=False )
69 gzipped_file = gzip.GzipFile(download, 'rb') 69 gzipped_file = gzip.GzipFile(download, 'rb')
70 while 1: 70 while 1:
71 try: 71 try:
72 chunk = gzipped_file.read(CHUNK_SIZE) 72 chunk = gzipped_file.read(CHUNK_SIZE)
73 except IOError: 73 except IOError: