Browse Source

reworked column names and constants

xmlparsing
Holger Frey 4 years ago
parent
commit
66faf1eeab
  1. 151
      sensospot_data/columns.py

151
sensospot_data/columns.py

@ -1,88 +1,97 @@
""" Column name definitions """ """ Column name definitions """
# original, unmodified column names # original, unmodified column names
COL_NAME_POS_X = "Pos.X" RAW_DATA_POS_X = "Pos.X"
COL_NAME_POS_Y = "Pos.Y" RAW_DATA_POS_Y = "Pos.Y"
COL_NAME_BKG_MEAN = "Bkg.Mean" RAW_DATA_BKG_MEAN = "Bkg.Mean"
COL_NAME_SPOT_MEAN = "Spot.Mean" RAW_DATA_SPOT_MEAN = "Spot.Mean"
COL_NAME_BKG_MEDIAN = "Bkg.Median" RAW_DATA_BKG_MEDIAN = "Bkg.Median"
COL_NAME_SPOT_MEDIAN = "Spot.Median" RAW_DATA_SPOT_MEDIAN = "Spot.Median"
COL_NAME_BKG_STDDEV = "Bkg.StdDev" RAW_DATA_BKG_STDDEV = "Bkg.StdDev"
COL_NAME_SPOT_STDDEV = "Spot.StdDev" RAW_DATA_SPOT_STDDEV = "Spot.StdDev"
COL_NAME_BKG_SUM = "Bkg.Sum" RAW_DATA_BKG_SUM = "Bkg.Sum"
COL_NAME_SPOT_SUM = "Spot.Sum" RAW_DATA_SPOT_SUM = "Spot.Sum"
COL_NAME_BKG_AREA = "Bkg.Area" RAW_DATA_BKG_AREA = "Bkg.Area"
COL_NAME_SPOT_AREA = "Spot.Area" RAW_DATA_SPOT_AREA = "Spot.Area"
COL_NAME_SPOT_SAT = "Spot.Sat. (%)" RAW_DATA_POS_NOM_X = "Pos.Nom.X"
COL_NAME_POS_NOM_X = "Pos.Nom.X" RAW_DATA_POS_NOM_Y = "Pos.Nom.Y"
COL_NAME_POS_NOM_Y = "Pos.Nom.Y"
# replacement column names # replacement column names
COL_NAME_POS_ID = "Pos.Id" RAW_DATA_POS_ID = "Pos.Id"
COL_NAME_SPOT_FOUND = "Spot.Found" RAW_DATA_SPOT_FOUND = "Spot.Found"
COL_NAME_SPOT_DIAMETER = "Spot.Diameter" RAW_DATA_SPOT_DIAMETER = "Spot.Diameter"
RAW_DATA_SPOT_SAT = "Spot.Sat[%]"
# additional column
COL_NAME_SPOT_OVERFLOW = "Spot.Overflow"
# well information RAW_DATA_COLUMNS_RENAME_MAP = {
COL_NAME_WELL_ROW = "Well.Row" " ID ": RAW_DATA_POS_ID,
COL_NAME_WELL_COLUMN = "Well.Column" "Found": RAW_DATA_SPOT_FOUND,
"Dia.": RAW_DATA_SPOT_DIAMETER,
"Spot.Sat. (%)": RAW_DATA_SPOT_SAT,
}
# parsed measurement parameter information # meta data extracted from filename
COL_NAME_PARAMETERS_CHANNEL = "Parameters.Channel" META_DATA_WELL_ROW = "Well.Row"
COL_NAME_PARAMETERS_TIME = "Parameters.Time" META_DATA_WELL_COLUMN = "Well.Column"
META_DATA_EXPOSURE_ID = "Exposure.Id"
# applied exposure info # parsed measurement parameter information (optional, from parameters folder)
COL_NAME_EXPOSURE_ID = "Exposure.Id" META_DATA_PARAMETERS_CHANNEL = "Parameters.Channel"
COL_NAME_EXPOSURE_CHANNEL = "Exposure.Channel" META_DATA_PARAMETERS_TIME = "Parameters.Time"
COL_NAME_EXPOSURE_TIME = "Exposure.Time"
RAW_DATA_COLUMN_SET = { RAW_DATA_COLUMN_SET = {
COL_NAME_POS_X, RAW_DATA_POS_X,
COL_NAME_POS_Y, RAW_DATA_POS_Y,
COL_NAME_BKG_MEAN, RAW_DATA_BKG_MEAN,
COL_NAME_SPOT_MEAN, RAW_DATA_SPOT_MEAN,
COL_NAME_BKG_MEDIAN, RAW_DATA_BKG_MEDIAN,
COL_NAME_SPOT_MEDIAN, RAW_DATA_SPOT_MEDIAN,
COL_NAME_BKG_STDDEV, RAW_DATA_BKG_STDDEV,
COL_NAME_SPOT_STDDEV, RAW_DATA_SPOT_STDDEV,
COL_NAME_BKG_SUM, RAW_DATA_BKG_SUM,
COL_NAME_SPOT_SUM, RAW_DATA_SPOT_SUM,
COL_NAME_BKG_AREA, RAW_DATA_BKG_AREA,
COL_NAME_SPOT_AREA, RAW_DATA_SPOT_AREA,
COL_NAME_SPOT_SAT, RAW_DATA_SPOT_SAT,
COL_NAME_POS_NOM_X, RAW_DATA_POS_NOM_X,
COL_NAME_POS_NOM_Y, RAW_DATA_POS_NOM_Y,
COL_NAME_POS_ID, RAW_DATA_POS_ID,
COL_NAME_SPOT_FOUND, RAW_DATA_SPOT_FOUND,
COL_NAME_SPOT_DIAMETER, RAW_DATA_SPOT_DIAMETER,
COL_NAME_WELL_ROW, META_DATA_WELL_ROW,
COL_NAME_WELL_COLUMN, META_DATA_WELL_COLUMN,
COL_NAME_PARAMETERS_CHANNEL, META_DATA_EXPOSURE_ID,
COL_NAME_PARAMETERS_TIME, META_DATA_PARAMETERS_CHANNEL,
COL_NAME_EXPOSURE_ID, META_DATA_PARAMETERS_TIME,
} }
# settings for nominal exposure info
SETTINGS_EXPOSURE_CHANNEL = "Exposure.Channel"
SETTINGS_EXPOSURE_TIME = "Exposure.Time"
# calculated value for dynamic range normalization
CALC_SPOT_OVERFLOW = "Calc.Spot.Overflow"
# normalized columns # normalized columns
COL_NAME_NORMALIZED_EXPOSURE_TIME = f"Normalized.{COL_NAME_EXPOSURE_TIME}" n_prefix = "Calc.Normalized."
COL_NAME_NORMALIZED_BKG_MEAN = f"Normalized.{COL_NAME_BKG_MEAN}" CALC_NORMALIZED_EXPOSURE_TIME = f"{n_prefix}{SETTINGS_EXPOSURE_TIME}"
COL_NAME_NORMALIZED_SPOT_MEAN = f"Normalized.{COL_NAME_SPOT_MEAN}" CALC_NORMALIZED_BKG_MEAN = f"{n_prefix}{RAW_DATA_BKG_MEAN}"
COL_NAME_NORMALIZED_BKG_MEDIAN = f"Normalized.{COL_NAME_BKG_MEDIAN}" CALC_NORMALIZED_SPOT_MEAN = f"{n_prefix}{RAW_DATA_SPOT_MEAN}"
COL_NAME_NORMALIZED_SPOT_MEDIAN = f"Normalized.{COL_NAME_SPOT_MEDIAN}" CALC_NORMALIZED_BKG_MEDIAN = f"{n_prefix}{RAW_DATA_BKG_MEDIAN}"
COL_NAME_NORMALIZED_BKG_STDDEV = f"Normalized.{COL_NAME_BKG_STDDEV}" CALC_NORMALIZED_SPOT_MEDIAN = f"{n_prefix}{RAW_DATA_SPOT_MEDIAN}"
COL_NAME_NORMALIZED_SPOT_STDDEV = f"Normalized.{COL_NAME_SPOT_STDDEV}" CALC_NORMALIZED_BKG_STDDEV = f"{n_prefix}{RAW_DATA_BKG_STDDEV}"
COL_NAME_NORMALIZED_BKG_SUM = f"Normalized.{COL_NAME_BKG_SUM}" CALC_NORMALIZED_SPOT_STDDEV = f"{n_prefix}{RAW_DATA_SPOT_STDDEV}"
COL_NAME_NORMALIZED_SPOT_SUM = f"Normalized.{COL_NAME_SPOT_SUM}" CALC_NORMALIZED_BKG_SUM = f"{n_prefix}{RAW_DATA_BKG_SUM}"
CALC_NORMALIZED_SPOT_SUM = f"{n_prefix}{RAW_DATA_SPOT_SUM}"
COLUMN_NORMALIZATION = { # what columns to convert for normalization
COL_NAME_BKG_MEAN: COL_NAME_NORMALIZED_BKG_MEAN, COLUMN_NORMALIZATION_MAP = {
COL_NAME_SPOT_MEAN: COL_NAME_NORMALIZED_SPOT_MEAN, RAW_DATA_BKG_MEAN: CALC_NORMALIZED_BKG_MEAN,
COL_NAME_BKG_MEDIAN: COL_NAME_NORMALIZED_BKG_MEDIAN, RAW_DATA_SPOT_MEAN: CALC_NORMALIZED_SPOT_MEAN,
COL_NAME_SPOT_MEDIAN: COL_NAME_NORMALIZED_SPOT_MEDIAN, RAW_DATA_BKG_MEDIAN: CALC_NORMALIZED_BKG_MEDIAN,
COL_NAME_BKG_STDDEV: COL_NAME_NORMALIZED_BKG_STDDEV, RAW_DATA_SPOT_MEDIAN: CALC_NORMALIZED_SPOT_MEDIAN,
COL_NAME_SPOT_STDDEV: COL_NAME_NORMALIZED_SPOT_STDDEV, RAW_DATA_BKG_STDDEV: CALC_NORMALIZED_BKG_STDDEV,
COL_NAME_BKG_SUM: COL_NAME_NORMALIZED_BKG_SUM, RAW_DATA_SPOT_STDDEV: CALC_NORMALIZED_SPOT_STDDEV,
COL_NAME_SPOT_SUM: COL_NAME_NORMALIZED_SPOT_SUM, RAW_DATA_BKG_SUM: CALC_NORMALIZED_BKG_SUM,
RAW_DATA_SPOT_SUM: CALC_NORMALIZED_SPOT_SUM,
} }

Loading…
Cancel
Save