Skip to content

Commit

Permalink
Saving NaN (or user-specified value) to parsed dataset file for non-e…
Browse files Browse the repository at this point in the history
…xistent values
  • Loading branch information
samgelman committed Jan 24, 2025
1 parent ac67aa8 commit f0df7d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/parse_raw_dms_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import utils


def sort_and_save_to_csv(df, out_fn, precision=7, sort_muts=True, sort_variants=True):
def sort_and_save_to_csv(df, out_fn, precision=7, sort_muts=True, sort_variants=True, na_rep=""):
# make sure variants have their list of mutations in sorted order
if sort_muts:
df["variant"] = utils.sort_variant_mutations(df["variant"])
Expand All @@ -24,7 +24,7 @@ def sort_and_save_to_csv(df, out_fn, precision=7, sort_muts=True, sort_variants=
if not isdir(dirname(out_fn)):
os.makedirs(dirname(out_fn))

df.to_csv(out_fn, sep="\t", float_format=float_format.format, index=False)
df.to_csv(out_fn, sep="\t", float_format=float_format.format, index=False, na_rep=na_rep)


def parse_avgfp(score_precision=7):
Expand Down

0 comments on commit f0df7d1

Please sign in to comment.