Skip to content

Commit

Permalink
Hotfix for when no daughter frames exist
Browse files Browse the repository at this point in the history
  • Loading branch information
wflynny committed Jun 26, 2020
1 parent 0925bc2 commit f5e45be
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions post_processing/hcs_data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ def parse_args() -> argparse.Namespace:
dest="output_file",
type=Path,
required=True,
help="Path to Spectra Max export file",
help="Path to save output dataframe",
)
add_arg(
"-p",
dest="plot_pdf_file",
type=Path,
default=None,
help="Path to Spectra Max export file",
help="Path to save plots [None = default]",
)

return parser.parse_args()
Expand Down Expand Up @@ -280,12 +280,15 @@ def construct_dataframe(dilution, randomization_file, spectramax_file):


def construct_daughter_dataframe(final, daughter_info):
n_plates = daughter_info.shape[1]
expanded = pd.concat([final] * n_plates, axis=0)
repeat = lambda x: np.repeat(x, final.shape[0])
expanded["plate"] = repeat(np.arange(n_plates, dtype=int) + 1)
for key, row in daughter_info.iterrows():
expanded[key] = repeat(row.values)
if daughter_info is not None:
n_plates = daughter_info.shape[1]
expanded = pd.concat([final] * n_plates, axis=0)
repeat = lambda x: np.repeat(x, final.shape[0])
expanded["plate"] = repeat(np.arange(n_plates, dtype=int) + 1)
for key, row in daughter_info.iterrows():
expanded[key] = repeat(row.values)
else:
expanded = final.copy()
return expanded


Expand Down

0 comments on commit f5e45be

Please sign in to comment.