Closed rrydbirk closed 2 years ago
We need some plots to show mitochondrial fraction, both for plotUmap and some sort of bar plot or similar.
function(con, species="human") { if(species=="human") lapply(con$samples, function(d) Matrix::rowSums(d$counts[,grep("MT-", colnames(d$counts))]) / Matrix::rowSums(d$counts)) %>% Reduce(c, .) else if(species=="mouse") lapply(con$samples, function(d) Matrix::rowSums(d$counts[,grep("mt-", colnames(d$counts))]) / Matrix::rowSums(d$counts)) %>% Reduce(c, .) else stop("Species must either be 'human' or 'mouse'.") }
function(con, species="human") {
if(species=="human") lapply(con$samples, function(d) Matrix::rowSums(d$counts[,grep("MT-", colnames(d$counts))]) / Matrix::rowSums(d$counts)) %>% Reduce(c, .)
else if(species=="mouse") lapply(con$samples, function(d) Matrix::rowSums(d$counts[,grep("mt-", colnames(d$counts))]) / Matrix::rowSums(d$counts)) %>% Reduce(c, .)
else stop("Species must either be 'human' or 'mouse'.")
}
UMAP added in d1824da38ca5dacfee6ba296aac9e3edce4b843b Bar plot added in 41b5c4b944a1647c0fd63eb236b886ba7d75eb37
We need some plots to show mitochondrial fraction, both for plotUmap and some sort of bar plot or similar.
function(con, species="human") {
if(species=="human") lapply(con$samples, function(d) Matrix::rowSums(d$counts[,grep("MT-", colnames(d$counts))]) / Matrix::rowSums(d$counts)) %>% Reduce(c, .)
else if(species=="mouse") lapply(con$samples, function(d) Matrix::rowSums(d$counts[,grep("mt-", colnames(d$counts))]) / Matrix::rowSums(d$counts)) %>% Reduce(c, .)
else stop("Species must either be 'human' or 'mouse'.")
}