This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Combine two SummarizedExperiments / SingleCellExperiments with partially overlapping | |
#' genes into one | |
#' | |
#' Note: This ignores all but the first assay | |
#' Can handle column sparse and standard matrices | |
cbind_se <- function(se1, se2, assay_fill = 0, colData_fill = NA, rowData_fill = NA, post_fix = c("_1", "_2")){ | |
stopifnot(length(post_fix) == 2) | |
# Merge assays based on rowNames | |
if( (is.null(rownames(se1)) || is.null(rownames(se2))) && nrow(se1) != nrow(se2)){ | |
stop("To cbind SummarizedExperiments either rownames are needed or the ", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df <- data.frame(Circulatory=c(32,26,19,16,14,13,11,11), | |
Mental=c(11,11,18,24,23,24,26,23), | |
Musculoskeletal=c(17,18,13,16,12,18,20,26), | |
Cancer=c(10,15,15,14,16,16,14,14)) | |
rownames(df) <- seq(1975,2010,by=5) | |
df | |
library(ggplot2) |