From 861dc334cc004bdb47d1a689ea6c958a5b9f3a84 Mon Sep 17 00:00:00 2001 From: evanbiederstedt Date: Fri, 2 Aug 2019 01:53:10 -0400 Subject: [PATCH] use pandas from_dict() to avoid warnings --- neoantigen.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/neoantigen.py b/neoantigen.py index f751750..59d5fd4 100644 --- a/neoantigen.py +++ b/neoantigen.py @@ -10,6 +10,7 @@ import gzip import copy from joblib import Parallel, delayed +from collections import OrderedDict ##### # Neoantigen prediction pipeline. Four main steps: @@ -456,10 +457,11 @@ def main(): maf_output.append(mut.get_maf_row_to_print()) predictions_output.extend(mut.get_predictions_rows_to_print()) - maf_output_df = pd.DataFrame.from_items([(s.name, s) for s in maf_output]).T + + maf_output_df = pd.DataFrame.from_dict(OrderedDict([s.name, s] for s in maf_output).T maf_output_df.to_csv(sample_path_pfx + '.neoantigens.maf' , sep='\t', index=False) - predictions_output_df = pd.DataFrame.from_items([(s.name, s) for s in predictions_output]).T + predictions_output_df = pd.DataFrame.from_dict(OrderedDict([s.name, s] for s in predictions_output)).T predictions_output_df.to_csv(sample_path_pfx + '.all_neoantigen_predictions.txt', sep='\t', index=False) except Exception: