Skip to content

Commit

Permalink
Merge pull request #2 from AlphonsG/dev4
Browse files Browse the repository at this point in the history
Dev4
  • Loading branch information
AlphonsG authored Oct 16, 2023
2 parents b8c0039 + c0c11f3 commit 75cd33f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions bimana/live_cell_imaging/metrics_file_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ def create_dataframes(
f.seek(0)
df = pd.read_csv(f, names=range(num_cols), delimiter='\t',
header=None)
if df.iloc[1, 0] == 'Date Time':
placeholder = pd.DataFrame(np.random.rand(5, df.shape[1]))
df = pd.concat([placeholder, df]).reset_index(drop=True)

if df.loc[6, 0] is not np.nan:
df.loc[5.5] = [np.nan] * num_cols
Expand Down Expand Up @@ -283,7 +286,10 @@ def compute_fold_changes(
else:
ctrl_idx = 0

if np.inf in fld_chg_df.values:
print(f'{self.txt_file}: Fold change data frame has inf values.')
fld_chg_df.fillna(0, inplace=True)
fld_chg_df.replace(np.inf, 0, inplace=True)

return fld_chg_df

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies = [
"click-web",
"scipy",
"opencv-python",
"pandas",
"pandas<2.0.0",
"pyvips",
"matplotlib",
"kornia",
Expand Down

0 comments on commit 75cd33f

Please sign in to comment.