@@ -44,7 +44,7 @@ def combine_gcts(path_dict, verbose=True):
4444def write_gct (df , gct_file , float_format = '%.6g' , compresslevel = 6 ):
4545 """Write pd.DataFrame to GCT format"""
4646
47- assert df .index .name == 'Name' and df .columns [0 ]== 'Description'
47+ assert df .index .name == 'Name' and df .columns [0 ] == 'Description'
4848
4949 if gct_file .endswith ('.gct.gz' ):
5050 opener = gzip .open (gct_file , 'wt' , compresslevel = compresslevel )
@@ -60,7 +60,7 @@ def combine_metrics(path_dict):
6060 """Aggregate single-sample metrics files."""
6161 metrics_df = []
6262 for k ,sample_id in enumerate (sorted (path_dict ), 1 ):
63- metrics_df .append (pd .read_csv (path_dict [sample_id ], sep = '\t ' , index_col = 0 ). astype ( np . float32 ))
63+ metrics_df .append (pd .read_csv (path_dict [sample_id ], sep = '\t ' , index_col = 0 , dtype = str ))
6464 metrics_df = pd .concat (metrics_df , axis = 1 ).T
6565 metrics_df .index .name = 'sample_id'
6666 return metrics_df
@@ -100,7 +100,7 @@ def combine_distributions(path_dict):
100100 if len (metrics_files ) > 0 :
101101 print ('Aggregating metrics' )
102102 metrics_df = combine_metrics (metrics_files )
103- metrics_df .to_csv (os .path .join (args .output_dir , f'{ args .prefix } .metrics.txt.gz' ), sep = '\t ' , float_format = '%.6g' )
103+ metrics_df .to_csv (os .path .join (args .output_dir , f'{ args .prefix } .metrics.txt.gz' ), sep = '\t ' )
104104
105105 if len (insertsize_files ) > 0 :
106106 print ('Aggregating insert size distributions' )
0 commit comments