Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getProportionMito() is currently mouse-specific #271

Closed
jowkar opened this issue Oct 5, 2022 · 1 comment
Closed

getProportionMito() is currently mouse-specific #271

jowkar opened this issue Oct 5, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jowkar
Copy link

jowkar commented Oct 5, 2022

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)
}
@cgao90
Copy link
Collaborator

cgao90 commented Oct 14, 2022

Hi @jowkar,

This is a great suggestion! Really appreciate it. We will look into this and make a modification.

Best,

@cgao90 cgao90 added the enhancement New feature or request label Nov 3, 2022
@mvfki mvfki self-assigned this Nov 2, 2023
@mvfki mvfki mentioned this issue Nov 9, 2023
@mvfki mvfki closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants