|
|
|
@ -12,7 +12,7 @@ def select_hdr_data(
@@ -12,7 +12,7 @@ def select_hdr_data(
|
|
|
|
|
time_column: str, |
|
|
|
|
overflow_column: str, |
|
|
|
|
) -> pandas.DataFrame: |
|
|
|
|
"""selects the data for increased dynamic measurement range |
|
|
|
|
"""Selects the data for increased dynamic measurement range |
|
|
|
|
|
|
|
|
|
To increase the dynamic range of a measurement, multiple exposures of one |
|
|
|
|
microarray might be taken. |
|
|
|
@ -35,10 +35,17 @@ def select_hdr_data(
@@ -35,10 +35,17 @@ def select_hdr_data(
|
|
|
|
|
The function will raise a KeyError if any of the provided column names |
|
|
|
|
is not present in the data frame |
|
|
|
|
|
|
|
|
|
spot_id_columns: column names identifying a spot |
|
|
|
|
time_column: column name for the (nominal) exposure time |
|
|
|
|
overflow_column: column name holding a overflow test result |
|
|
|
|
returns: data frame with selected hdr data per spot |
|
|
|
|
Args: |
|
|
|
|
data: data with multiple exposure times |
|
|
|
|
spot_id_columns: column names identifying a spot |
|
|
|
|
time_column: column name for the (nominal) exposure time |
|
|
|
|
overflow_column: column name holding a overflow test result |
|
|
|
|
|
|
|
|
|
Returns: |
|
|
|
|
a data frame with selected hdr data per spot |
|
|
|
|
|
|
|
|
|
Raises: |
|
|
|
|
KeyError: if any column does not exist in the data fram |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
check_columns_exist(data, spot_id_columns, time_column, overflow_column) |
|
|
|
@ -68,20 +75,27 @@ def normalize(
@@ -68,20 +75,27 @@ def normalize(
|
|
|
|
|
value_columns: Union[list[str], str], |
|
|
|
|
template: str = "Normalized.{}", |
|
|
|
|
) -> pandas.DataFrame: |
|
|
|
|
"""normalizes values to a normalized exposure time |
|
|
|
|
"""Normalizes values to a normalized exposure time. |
|
|
|
|
|
|
|
|
|
Will raise a KeyError, if any column is not in the data frame; |
|
|
|
|
raises ValueError if no template string was provided. |
|
|
|
|
|
|
|
|
|
data: data frame to normalize |
|
|
|
|
normalized_time: exposure time to normalize to |
|
|
|
|
time_column: column name of the (nominal) exposure time |
|
|
|
|
value_columns: which columns to normalize |
|
|
|
|
template: a Python template string for the normalized column names |
|
|
|
|
returns: copy of the data with additional normalized values |
|
|
|
|
Args: |
|
|
|
|
data: data frame to normalize |
|
|
|
|
normalized_time: exposure time to normalize to |
|
|
|
|
time_column: column name of the (nominal) exposure time |
|
|
|
|
value_columns: which columns to normalize |
|
|
|
|
template: a template string for the normalized column names |
|
|
|
|
|
|
|
|
|
Returns: |
|
|
|
|
copy of the data with additional normalized values |
|
|
|
|
|
|
|
|
|
Raises: |
|
|
|
|
KeyError: if any column is not in the data frame |
|
|
|
|
ValueError: if the value for `template` is not a template string |
|
|
|
|
""" |
|
|
|
|
check_columns_exist(data, time_column, value_columns) |
|
|
|
|
if "{}" not in template: |
|
|
|
|
if template == template.format("a"): |
|
|
|
|
raise ValueError(f"Not a template string: '{template}'") |
|
|
|
|
|
|
|
|
|
data = data.copy() |
|
|
|
|