Check format of input data and sample annotation, create a SummarizedExperiment object
Arguments
- data
A data frame with rows as features (e.g., genes, proteins) and columns as samples. The first column should contain feature identifiers (e.g., gene symbols) and named as 'Feature'. The data should have been log transformed (and normalised if needed). Missing values are allowed in some of the downstream analyses.
- sample_ann
A data frame containing sample annotations with required columns: 'Sample', 'Group', and 'Time'. 'Replicate' and 'Batch' are optional columns and will be auto-generated if not provided. 'Time', 'Replicate' and 'Batch' should be numeric.
- subject_col
Optional: name of a column in
sample_annidentifying biological subjects measured repeatedly across time points (e.g.,"PatientID"). If provided, the column is renamed to 'Subject' and used for repeated-measures analyses downstream. If NULL (default), all samples are treated as independent, e.g. for cell culture experiments.- replicate_col
Optional: name of a column in
sample_annidentifying replicate IDs. If provided, the column is renamed to 'Replicate'. If NULL (default), the function looks for a column named 'Replicate'; if absent, replicate IDs are auto-generated within each Group and Time (and Subject, if provided).- batch_col
Optional: name of a column in
sample_annidentifying batch information. If provided, the column is renamed to 'Batch'. If NULL (default), the function looks for a column named 'Batch'; if absent, all samples are assigned to batch 1.
Examples
data <- data.frame(Feature = c("Gene1", "Gene2"),
Sample1 = c(1, 2), Sample2 = c(3, 4))
sample_ann <- data.frame(
Sample = c("Sample1", "Sample2"),
Group = c("A", "A"),
Time = c(0, 1),
Rep = c(1, 1),
BatchID = c(1, 1)
)
se_obj <- create_input(data, sample_ann,
replicate_col = "Rep", batch_col = "BatchID")
#> No Subject column specified. Samples treated as independent. For repeated-measures designs, set subject_col to the column identifying biological subjects.
#> Converting 'Group' column to factor. Default order is alphabetical.
#> Converting 'Replicate' column to factor. Default order is numerical.
#> Converting 'Batch' column to factor. Default order is numerical.
