featureMeanVar <- function(DT_featureLibrary){
## Melt input training data by sample runs
meltDT_featureLibrary <- meltDT(DT = DT_featureLibrary)
## Compute mean and variance for each barcode based on matrix
meltDT_featureLibrary[, value := as.numeric(value)]
meltDT_featureLibrary[, Mean := mean(value, na.rm=TRUE), by = c("Barcode", "matrix")]
meltDT_featureLibrary[, Variance := var(value), by = c("Barcode", "matrix")]
meltDT_featureLibrary <- meltDT_featureLibrary[!duplicated(meltDT_featureLibrary[,c("Barcode", "matrix")]),]
selectCol <- c("library.Q1", "library.Q3", "GeneralID", "Barcode", "Mean", "Variance")
meltDT_featureLibrary <- meltDT_featureLibrary[, selectCol, with=F]
setnames(meltDT_featureLibrary, "GeneralID", "GeneralID_MV")
return(meltDT_featureLibrary)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.