khodosevichlab / CRMetrics

Summarization of CellRanger count metrics.
5 stars 0 forks source link

Functionality for plotting mitochondrial fraction #24

Closed rrydbirk closed 2 years ago

rrydbirk commented 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'.") }

rrydbirk commented 2 years ago

UMAP added in d1824da38ca5dacfee6ba296aac9e3edce4b843b Bar plot added in 41b5c4b944a1647c0fd63eb236b886ba7d75eb37