Skip to content

Commit

Permalink
use pandas from_dict() to avoid warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
evanbiederstedt committed Aug 2, 2019
1 parent b4b8b93 commit 861dc33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions neoantigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import gzip
import copy
from joblib import Parallel, delayed
from collections import OrderedDict

#####
# Neoantigen prediction pipeline. Four main steps:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 861dc33

Please sign in to comment.