Add midparent expression to SummarizedExperiment
object
Source: R/01_data_processing.R
add_midparent_expression.Rd
Add midparent expression to SummarizedExperiment
object
Usage
add_midparent_expression(
se,
coldata_column = "Generation",
parent1 = "P1",
parent2 = "P2",
method = "mean",
weights = c(1, 1)
)
Arguments
- se
A
SummarizedExperiment
object with a count matrix and sample metadata.- coldata_column
Character indicating the name of column in
colData(se)
where information on the generation are stored. Default: "Generation".- parent1
Character indicating which level of the variable coldata_column represents parent 1. Default: "P1".
- parent2
Character indicating which level of the variable coldata_column represents parent 2. Default: "P2".
- method
Character indicating the method to use to create midparent values. One of 'mean' (default), 'sum', or 'weightedmean'.
- weights
Numeric vector of length 2 indicating the weights to give to parents 1 and 2 (respectively) if
method == "weightedmean"
. Settingmethod == "weightedmean"
is used sometimes when parents have different ploidy levels. In such cases, the ploidy levels of parents 1 and 2 can be passed in a vector. Default:c(1, 2)
.
Examples
data(se_chlamy)
new_se <- add_midparent_expression(se_chlamy)