View source: R/control_metrics.R
control_metrics | R Documentation |
mostly lifted from Sean Maden's recountmethylation supplement https://github.com/metamaden/recountmethylationManuscriptSupplement modified slightly to take advantage of rgSet annotations and to Go Big, i.e. this works reasonably well on fairly large rgSets (like all of GEO)
control_metrics(rgSet, dft = NULL, baseline = 3000, biotin.baseline = 1)
rgSet |
an rgSet with control probe intensities and annotation |
dft |
optional single-row data.frame of thresholds (default) |
baseline |
offset for Extension green based background (3000) |
biotin.baseline |
baseline offset for biotin staining probes (1) |
a matrix (cols = metrics, rows = samples)
flag_control_failures
if (exists("MPAL_rgSet")) {
# TARGET MPAL data, from Alexander et al, Nature 2018
cm <- control_metrics(MPAL_rgSet)
library(ComplexHeatmap)
Heatmap(t(cm), name="metric", column_names_side="top",
column_names_gp=gpar(fontsize=6), row_names_side="left")
library(circlize)
flagcols <- colorRamp2(c(0, 1), c("white", "darkred"))
flagged <- flag_control_failures(cm, platform="epic")
all_samples_passed <- ifelse(colSums(flagged) == 0, 1, 0)
all_probes_passed <- ifelse(rowSums(flagged) == 0, 1, 0)
Heatmap(t(flagged), name="failed", col=flagcols, column_names_side="top",
column_split=all_probes_passed, column_names_gp=gpar(fontsize=6),
row_split=all_samples_passed, row_names_side="left")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.