Skip to content

Commit

Permalink
Update metrics processing
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphonsG committed Oct 16, 2023
1 parent b8c0039 commit 5cb25b6
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 5cb25b6

Please sign in to comment.