Skip to content

Commit

Permalink
Avoiding taking log of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
rnowling committed Nov 7, 2021
1 parent ba6909a commit eba3ec4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/asaph_detect_and_localize
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ if __name__ == "__main__":
df = read_snp_table(args.pca_associations_tsv,
args.component,
args.chromosome)

# avoid domain errors from trying to take the log of 0
df["pvalue"] = np.maximum(df["pvalue"], np.power(10., -300.))

df = mark_significant_snps(df)

Expand Down

0 comments on commit eba3ec4

Please sign in to comment.