Skip to contents

The cpam class stores data and analysis results for a time series omics experiment. This object is generated by the prepare_cpam function and contains all necessary data and parameters for downstream analysis.

Details

A cpam object is a list with the following components:

exp_design

A data frame containing the experimental design information, with columns for 'sample', 'time', and potentially other variables.

count_matrix_raw

The original count matrix before filtering.

count_matrix_filtered

The count matrix after filtering low-count genes/transcripts.

target_to_keep

A vector of transcript/gene IDs that passed the filtering criteria.

data_long

A long-format data frame containing all relevant information for each target and sample.

t2g

A transcript-to-gene mapping data frame if provided.

regularize

Logical; whether empirical Bayes regularization of dispersions was used.

overdispersion.prior

Median overdispersion.

model_type

String; the type of design used, either "case-only" or "case-control".

condition_var

String; the column name in exp_design for the condition variable (for case-control models).

case_value

The value of condition_var that indicates the "case" in case-control models.

bootstrap

Logical; whether bootstrap samples (inferential replicates) were used.

nboot

The number of bootstrap samples used, if applicable.

filter

A list containing the filtering function and its arguments used.

gene_level

Logical; whether the analysis was performed at the gene level.

aggregate_to_gene

Logical; whether p-values should be aggregated from transcript to gene level.

times

An ordered vector of unique time points in the experimental design.

num_cores

The number of cores used for parallel computation.

fixed_effects

The formula for fixed effects in the model.

intercept_cc

String; the intercept type for case-control models.

bss

A vector of basis function types used for modelling.

Methods

Objects of class cpam have print and summary methods available.

See also

prepare_cpam for creating a cpam object.

Examples


# load gene-only example data
load(system.file("extdata", "exp_design_example.rda", package = "cpam"))
load(system.file("extdata", "count_matrix_example.rda", package = "cpam"))

# Create a cpam object with the example data
cpo <- prepare_cpam(exp_design = exp_design_example,
                    count_matrix = count_matrix_example,
                    gene_level = TRUE)
#>  Processing count matrix
#>  Processing count matrix [28ms]
#> 
#>  Filtering low count genes
#>  Estimating dispersions using edgeR
#>  Estimating dispersions using edgeR [478ms]
#> 
#>  Filtering low count genes

#>  Filtering low count genes [653ms]
#> 

# Print the object structure
cpo
#> 
#> ── cpam object ─────────────────────────────────────────────────────────────────
#>case-only time series
#>30 samples
#>6 time points
#>Counts aggregated for gene-level inference

# Get a summary of the cpam object
summary(cpo)
#> 
#> ── cpam object ─────────────────────────────────────────────────────────────────
#>case-only time series
#>30 samples
#>6 time points
#>Counts aggregated for gene-level inference
#> 
#> → use `compute_p_values()()` to compute p-values
#> → use `estimate_changepoints()()` to estimate changepoints
#> → use `select_shape()()` to select among candidate shapes