| Title: | Chemo-Genomic Screening Data Preprocessor and Visualizer |
|---|---|
| Description: | An R package providing S4 data structures, analysis methods, and a Shiny application for preprocessing, quality control, and chemo-genomic interaction scoring of 384-well plate screening datasets generated by Tecan plate readers. Plate data is managed via a persistent local registry (PlateRegistry S4 object) that accumulates across sessions and survives package upgrades. |
| Authors: | Qingzhou Zhang [aut, cre] |
| Maintainer: | Qingzhou Zhang <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.2 |
| Built: | 2026-10-09 17:27:15 UTC |
| Source: | https://github.com/zqzneptune/CGExplorer |
Add batch to registry
add_batch(registry, batch, ...) ## S4 method for signature 'PlateRegistry' add_batch(registry, batch, ...)add_batch(registry, batch, ...) ## S4 method for signature 'PlateRegistry' add_batch(registry, batch, ...)
registry |
PlateRegistry object |
batch |
Batch object |
... |
additional arguments |
add_batch(PlateRegistry): Add Batch object to PlateRegistry
Add layout to registry
add_layout(registry, layout_name, layout_data, ...) ## S4 method for signature 'PlateRegistry' add_layout(registry, layout_name, layout_data, ...)add_layout(registry, layout_name, layout_data, ...) ## S4 method for signature 'PlateRegistry' add_layout(registry, layout_name, layout_data, ...)
registry |
PlateRegistry object |
layout_name |
character name of layout |
layout_data |
data.frame of layout |
... |
additional arguments |
add_layout(PlateRegistry): Add layout to PlateRegistry
Add plate to registry
add_plate(registry, plate, ...) ## S4 method for signature 'PlateRegistry' add_plate(registry, plate, ...)add_plate(registry, plate, ...) ## S4 method for signature 'PlateRegistry' add_plate(registry, plate, ...)
registry |
PlateRegistry object |
plate |
Plate object |
... |
additional arguments |
add_plate(PlateRegistry): Add Plate object to PlateRegistry
S4 Class representing a Scoring Batch
uuidcharacter.
namecharacter. User-assigned name.
plate_uuidscharacter. Ordered Plate UUIDs included in this batch.
scoreslist. Scoring results per strategy/metric.
scoring_paramslist. Params used in last score_batch().
created_atPOSIXct.
Compute relative biofilm
compute_relative_biofilm(growth_m, biofilm_m)compute_relative_biofilm(growth_m, biofilm_m)
growth_m |
data.frame growth metrics |
biofilm_m |
data.frame biofilm metrics |
data.frame joined and scored
Computes per-well OD delta between consecutive cycles. If the median plate-wide delta exceeds the threshold, flags that cycle as the start of the staining assay.
detect_staining_jump(df, threshold = 0.3)detect_staining_jump(df, threshold = 0.3)
df |
data.frame with Plate, Row, Column, DateTime, Time_Hours, OD_Raw |
threshold |
numeric, OD jump threshold (default 0.3) |
A list with 'has_staining', 'jump_cycle', 'jump_time', 'staining_hr'
Writes one page per strain (WT/control strains first, then mutants alphabetically). Each page has one facet per plate in the batch and one line per well, coloured by well ID.
export_batch_growth_curves_pdf( registry, batch_name, file, mode = c("raw", "corrected"), strains = NULL, progress = NULL )export_batch_growth_curves_pdf( registry, batch_name, file, mode = c("raw", "corrected"), strains = NULL, progress = NULL )
registry |
PlateRegistry |
batch_name |
character. Name of a batch in |
file |
character. Output PDF path. |
mode |
"raw" (raw OD values from the growth assay, as read) or "corrected" (OD_Raw minus the plate blank median at each timepoint, with no floor or clipping). Values are never normalized or rescaled; all wells, including blanks, are plotted in both modes. Staining reads are excluded. |
strains |
optional character vector restricting which strains are drawn. |
progress |
optional function(i, n, strain) called after each page. |
Invisibly, the number of pages written.
Extract biofilm metrics
extract_biofilm_metrics(df)extract_biofilm_metrics(df)
df |
data.frame corrected |
data.frame of biofilm metrics
Extract growth metrics
extract_growth_metrics(df, growth_threshold = 0.02)extract_growth_metrics(df, growth_threshold = 0.02)
df |
data.frame corrected |
growth_threshold |
numeric, threshold for valid growth |
data.frame of metrics
Get layout from registry
get_layout(registry, layout_name, ...) ## S4 method for signature 'PlateRegistry' get_layout(registry, layout_name, ...)get_layout(registry, layout_name, ...) ## S4 method for signature 'PlateRegistry' get_layout(registry, layout_name, ...)
registry |
PlateRegistry object |
layout_name |
character name of layout |
... |
additional arguments |
get_layout(PlateRegistry): Get layout from PlateRegistry
Load a PlateRegistry from RDS
load_registry(path)load_registry(path)
path |
character. Path to the RDS file or directory containing cgexplorer_registry.rds. |
A PlateRegistry-class object loaded from disk.
Merge plates in registry
merge_plates(registry, uuids, ...) ## S4 method for signature 'PlateRegistry' merge_plates(registry, uuids, ...)merge_plates(registry, uuids, ...) ## S4 method for signature 'PlateRegistry' merge_plates(registry, uuids, ...)
registry |
PlateRegistry object |
uuids |
character vector of plate UUIDs |
... |
additional arguments |
merge_plates(PlateRegistry): Merge multiple plates in PlateRegistry
Constructor for Batch
new_batch(name, plate_uuids)new_batch(name, plate_uuids)
name |
character. Name of the batch. |
plate_uuids |
character vector. UUIDs of plates included in this batch. |
A Batch-class object.
Constructor for Plate
new_plate(slot_id, growth_data, layout, timezone = "America/Halifax")new_plate(slot_id, growth_data, layout, timezone = "America/Halifax")
slot_id |
character. Unique identifier for the plate slot (e.g. "S1L1"). |
growth_data |
data.frame. Raw growth assay readings. |
layout |
data.frame. Well layout definition. |
timezone |
character. Timezone string, defaults to "America/Halifax". |
A Plate-class object.
Constructor for PlateRegistry
new_registry(project_name = "Untitled Project", project_dir = getwd())new_registry(project_name = "Untitled Project", project_dir = getwd())
project_name |
character. Project display name. |
project_dir |
character. Path to project directory storing registry. |
A PlateRegistry-class object.
Parse 96 or 384 well Plate Layout
parse_plate_layout(filepath)parse_plate_layout(filepath)
filepath |
character. |
A list containing format info and the parsed data.frame.
Parse Tecan Plate Reader output (.txt)
parse_tecan_txt(filepath)parse_tecan_txt(filepath)
filepath |
character. |
A data.frame with Plate, DateTime, Row, Column, OD
S4 Class representing a Chemo-Genomic Plate
uuidcharacter. Internal UUID.
slot_idcharacter. E.g. "S1L1".
labelcharacter. User-facing name.
treatmentcharacter. E.g. "NoDrug", "Drug1".
replicateinteger. Biological replicate number.
mediacharacter. Growth media label.
layoutdata.frame. Well map.
assayslist. Named list of assay data.frames (growth, final, staining).
staining_hrnumeric. Hours post t0 when staining was performed (NA if unknown).
staining_confirmedlogical. TRUE after user confirms staining detection.
t0POSIXct. Earliest DateTime in assays$growth.
t_endPOSIXct. Latest DateTime across all non-NULL assays.
timezonecharacter. Timezone, fixed to "America/Halifax".
metricslist. Populated by compute_metrics().
qc_flagslist. QC results.
provenancelist. Audit trail records.
is_mergedlogical. TRUE if created from merge_plates().
S4 Class representing the Project Plate Registry
plateslist. Named list: UUID -> Plate S4 object.
batcheslist. Named list: batch_name -> Batch S4 object.
layoutslist. Named layout registry.
project_namecharacter. User-assigned project name.
project_dircharacter. Absolute path to directory holding registry.rds.
schema_versioncharacter. Package version at save time.
created_atPOSIXct.
modified_atPOSIXct.
Plot Multi-Strain Growth Curves
plot_multi_strain_growth_curves( df, selected_genes = NULL, use_raw_od = FALSE, color_by = "strain" )plot_multi_strain_growth_curves( df, selected_genes = NULL, use_raw_od = FALSE, color_by = "strain" )
df |
data.frame containing Time_Hours, OD_Corrected, OD_Raw, Gene, Type, Rep_Suffix, Row, Column |
selected_genes |
character vector of selected genes/strains |
use_raw_od |
logical. TRUE for OD_Raw, FALSE for OD_Corrected |
color_by |
character. "strain", "replicate", or "type" |
plotly object
Plot Plate QC Layout
plot_plate_qc_layout( plate, metric = "Growth_Endpoint_OD", colorscale = "plasma", cmin = NULL, cmax = NULL )plot_plate_qc_layout( plate, metric = "Growth_Endpoint_OD", colorscale = "plasma", cmin = NULL, cmax = NULL )
plate |
Plate object |
metric |
character. Column name in metrics to plot. |
colorscale |
character. Color scheme key. |
cmin |
numeric. Minimum value for color scale. |
cmax |
numeric. Maximum value for color scale. |
plotly object
Plot Replicate Growth Curves
plot_replicate_growth_curves(replicate_data, stain_hr = 26)plot_replicate_growth_curves(replicate_data, stain_hr = 26)
replicate_data |
data.frame containing Time_Hours, OD_Raw or OD_Corrected, Row, Column, Gene, Rep_Suffix |
stain_hr |
numeric staining hour threshold |
plotly object
Remove batch from registry
remove_batch(registry, batch_name, ...) ## S4 method for signature 'PlateRegistry' remove_batch(registry, batch_name, ...)remove_batch(registry, batch_name, ...) ## S4 method for signature 'PlateRegistry' remove_batch(registry, batch_name, ...)
registry |
PlateRegistry object |
batch_name |
character batch name |
... |
additional arguments |
remove_batch(PlateRegistry): Remove Batch object from PlateRegistry
Remove layout from registry
remove_layout(registry, layout_name, ...) ## S4 method for signature 'PlateRegistry' remove_layout(registry, layout_name, ...)remove_layout(registry, layout_name, ...) ## S4 method for signature 'PlateRegistry' remove_layout(registry, layout_name, ...)
registry |
PlateRegistry object |
layout_name |
character name of layout |
... |
additional arguments |
remove_layout(PlateRegistry): Remove layout from PlateRegistry
Remove plate from registry
remove_plate(registry, uuid, ...) ## S4 method for signature 'PlateRegistry' remove_plate(registry, uuid, ...)remove_plate(registry, uuid, ...) ## S4 method for signature 'PlateRegistry' remove_plate(registry, uuid, ...)
registry |
PlateRegistry object |
uuid |
character plate UUID |
... |
additional arguments |
remove_plate(PlateRegistry): Remove Plate object from PlateRegistry
Run the Shiny Application
run_cgexplorer_app(...)run_cgexplorer_app(...)
... |
arguments to pass to golem_opts. |
Save registry to disk
save_registry(registry, ...) ## S4 method for signature 'PlateRegistry' save_registry(registry, ...)save_registry(registry, ...) ## S4 method for signature 'PlateRegistry' save_registry(registry, ...)
registry |
PlateRegistry object |
... |
additional arguments |
save_registry(PlateRegistry): Save PlateRegistry to RDS file
Standardized Scoring Engine
score_batch_dataset( pheno_df, strategy_type = c("NoDrug_Plates", "NoDrug_Wells"), metrics, control_drug = "NoDrug" )score_batch_dataset( pheno_df, strategy_type = c("NoDrug_Plates", "NoDrug_Wells"), metrics, control_drug = "NoDrug" )
pheno_df |
data.frame containing aggregated phenotypic metrics across a batch |
strategy_type |
character, either "NoDrug_Plates" or "NoDrug_Wells" |
metrics |
character vector of target metrics |
control_drug |
character, name of control treatment |
data.frame of scores
Subtract blanks at the plate level
subtract_plate_blanks(df, blank_threshold = 0.05)subtract_plate_blanks(df, blank_threshold = 0.05)
df |
data.frame with Row, Column, Time_Hours, OD_Raw, Type, Is_Stained |
blank_threshold |
numeric, threshold for bad blanks |
list with corrected 'data' and 'removed_blanks'
Update plate in registry
update_plate(registry, plate, ...) ## S4 method for signature 'PlateRegistry' update_plate(registry, plate, ...)update_plate(registry, plate, ...) ## S4 method for signature 'PlateRegistry' update_plate(registry, plate, ...)
registry |
PlateRegistry object |
plate |
Plate object |
... |
additional arguments |
update_plate(PlateRegistry): Update Plate object in PlateRegistry
Validate plate eligibility and layout uniformity for a batch
validate_batch_plates(registry, uuids)validate_batch_plates(registry, uuids)
registry |
PlateRegistry |
uuids |
character vector of plate UUIDs |
TRUE if valid, otherwise throws an error