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

Providing a vector for the mitoID argument in runCellQC causes an error. #715

Open
fitz-meyer opened this issue Sep 12, 2023 · 2 comments
Open

Comments

@fitz-meyer
Copy link

fitz-meyer commented Sep 12, 2023

I am trying to provide custom mitochondrial geneIDs for QCMetrics in runCellQC like so:

library(singleCellTK)
library(tidyverse)

sce <- importCellRanger(sampleDirs = "Desktop/scRNAseq/cellranger_outs/mg1_c/",
                         dataType = c("filtered"),
                         matrixFileNames = "matrix.mtx.gz",
                         featuresFileNames = "features.tsv.gz",
                         barcodesFileNames = "barcodes.tsv.gz",
                         gzipped = TRUE)

mito_genes <- c("nbis-gene-5", "nbisL1-trna-20", "nbisL1-trna-6", 
                "nbisL1-trna-3", "nbisL1-trna-7", "nbisL1-trna-9", 
                "nbis-gene-2", "nbis-gene-3", "nbisL1-trna-10", 
                "nbisL1-trna-16", "nbisL1-trna-17", "nbis-gene-4", 
                "nbisL1-trna-19")

sce <- runCellQC(sce, sample = NULL, algorithms = "QCMetrics",
                 geneSetListLocation = "rownames",
                 mitoID = mito_genes,
                 mitoIDType = "symbol")

But it produces this error:

Error in (function (inSCE, useAssay = "counts", collectionName = NULL,  : 
  unused arguments (mitoID1 = "nbis-gene-5", mitoID2 = "nbisL1-trna-20", mitoID3 = "nbisL1-trna-6", mitoID4 = "nbisL1-trna-3", mitoID5 = "nbisL1-trna-7", mitoID6 = "nbisL1-trna-9", mitoID7 = "nbis-gene-2", mitoID8 = "nbis-gene-3", mitoID9 = "nbisL1-trna-10", mitoID10 = "nbisL1-trna-16", mitoID11 = "nbisL1-trna-17", mitoID12 = "nbis-gene-4", mitoID13 = "nbisL1-trna-19")

The documentation for mitoID states that it can accept a character vector of mito genes to be quantified. I have also tried reading the geneIDs in from a .txt file but this didn't change anything. Running mitoID = "nbis-gene-5" works as expected, but I need a way to identify all of those geneIDs as mitochondrial genes. I would prefer not to edit the .gtf file at this stage.

I am running SCTK version 2.8.0 on R version 4.3.1.

Cheers,
Fitz

@joshua-d-campbell
Copy link
Collaborator

Hi @fitz-meyer, thanks for pointing this out. I was able to reproduce the error. We will work on fixing this in the next release. In the meantime, I believe you can run the following code to use your genes as a custom gene set:

sce <- runCellQC(sce, algorithms = "QCMetrics", mitoGeneLocation = NULL, mitoPrefix="$$", geneSetList = list(mito = mito_genes), geneSetListLocation = "rownames")

Note that by default it will still try to match with genes that start with "MT-". That is why I set mitoPrefix to something random like "$$" so it won't match anything.

Just let us know if you run into other issues.

@fitz-meyer
Copy link
Author

Hi @joshua-d-campbell, Thanks for the reply, the suggested work around did the trick!
Cheers,
Fitz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants