wwood commited on
Commit
8bd5212
·
1 Parent(s): 092c39c

bugfix, output copy number to shap output csv.

Browse files
Files changed (1) hide show
  1. 17_apply_to_proteome.py +3 -0
17_apply_to_proteome.py CHANGED
@@ -289,6 +289,8 @@ if __name__ == '__main__':
289
  d6['accession'] = args.protein_fasta
290
  d6.to_csv(args.output_annotations, sep="\t", index=False)
291
  logging.info("Wrote annotation table to {}".format(args.output_annotations))
 
 
292
 
293
  if args.models is None:
294
  logging.info("Skipping model application, since no models were specified")
@@ -342,6 +344,7 @@ if __name__ == '__main__':
342
 
343
  pl.DataFrame({
344
  'rank': range(1, len(all_shaps) + 1),
 
345
  'shap_value': list(shap_values[:, all_shaps].mean(0)),
346
  'abs_shap_value': list(np.abs(shap_values[:, all_shaps]).mean(0)),
347
  'gene': list(all_shaps_names),
 
289
  d6['accession'] = args.protein_fasta
290
  d6.to_csv(args.output_annotations, sep="\t", index=False)
291
  logging.info("Wrote annotation table to {}".format(args.output_annotations))
292
+ # d6 is a shallow copy, so reset columns
293
+ d5 = d5[header]
294
 
295
  if args.models is None:
296
  logging.info("Skipping model application, since no models were specified")
 
344
 
345
  pl.DataFrame({
346
  'rank': range(1, len(all_shaps) + 1),
347
+ 'copy_number': list(d5.iloc[:, all_shaps].values[0]),
348
  'shap_value': list(shap_values[:, all_shaps].mean(0)),
349
  'abs_shap_value': list(np.abs(shap_values[:, all_shaps]).mean(0)),
350
  'gene': list(all_shaps_names),