@@ -44,7 +44,7 @@ def combine_gcts(path_dict, verbose=True):
44
44
def write_gct (df , gct_file , float_format = '%.6g' , compresslevel = 6 ):
45
45
"""Write pd.DataFrame to GCT format"""
46
46
47
- assert df .index .name == 'Name' and df .columns [0 ]== 'Description'
47
+ assert df .index .name == 'Name' and df .columns [0 ] == 'Description'
48
48
49
49
if gct_file .endswith ('.gct.gz' ):
50
50
opener = gzip .open (gct_file , 'wt' , compresslevel = compresslevel )
@@ -60,7 +60,7 @@ def combine_metrics(path_dict):
60
60
"""Aggregate single-sample metrics files."""
61
61
metrics_df = []
62
62
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 ))
64
64
metrics_df = pd .concat (metrics_df , axis = 1 ).T
65
65
metrics_df .index .name = 'sample_id'
66
66
return metrics_df
@@ -100,7 +100,7 @@ def combine_distributions(path_dict):
100
100
if len (metrics_files ) > 0 :
101
101
print ('Aggregating metrics' )
102
102
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 ' )
104
104
105
105
if len (insertsize_files ) > 0 :
106
106
print ('Aggregating insert size distributions' )
0 commit comments