liger
liger copied to clipboard
getProportionMito() is currently mouse-specific
The function getProportionMito() is currently written such that it expects mouse gene symbols (i.e., lower case). See the second line in the body of the function code below. Could be fixed by making the grep pattern a parameter perhaps, with either "^mt-" or "^MT-" as default.
function (object, use.norm = FALSE)
{
all.genes <- Reduce(union, lapply([email protected], rownames))
mito.genes <- grep(pattern = "^mt-", x = all.genes, value = TRUE)
data.use <- [email protected]
if (use.norm) {
data.use <- [email protected]
}
percent_mito <- unlist(lapply(unname(data.use), function(x) {
colSums(x[mito.genes, ])/colSums(x)
}), use.names = TRUE)
return(percent_mito)
}
Suggestion:
function (object, use.norm = FALSE, mito_pattern = "^mt-")
{
all.genes <- Reduce(union, lapply([email protected], rownames))
mito.genes <- grep(pattern = mito_pattern, x = all.genes, value = TRUE)
data.use <- [email protected]
if (use.norm) {
data.use <- [email protected]
}
percent_mito <- unlist(lapply(unname(data.use), function(x) {
colSums(x[mito.genes, ])/colSums(x)
}), use.names = TRUE)
return(percent_mito)
}
Hi @jowkar,
This is a great suggestion! Really appreciate it. We will look into this and make a modification.
Best,