Error in measuring percentage of mit.genes
1
0
Entering edit mode
21 months ago
richie_lv • 0
JHY_pbmc[["percent.mt"]] <- PercentageFeatureSet(JHY_pbmc, 
                                                 features  = c("gene-nad5","gene-nad1",
                                                               "gene-nad2","gene-nad4",
                                                               "gene-nad7","gene-cox1",
                                                               "gene-cox2","gene-ccmFc2"), 
                                                assay = 'RNA')




Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'colSums': invalid character indexing
scRNA-seq bug seurat • 944 views
ADD COMMENT
1
Entering edit mode

What does the following return?

all(c("gene-nad5","gene-nad1", "gene-nad2","gene-nad4", "gene-nad7","gene-cox1", "gene-cox2","gene-ccmFc2") %in% rownames(JHY_pbmc))
ADD REPLY
1
Entering edit mode
19 months ago
Nima ▴ 10

I had the same error and following what jared.andrews07 suggested, I only passed present gene_ids as features and it worked fine. Here is how I did it:

data <- PercentageFeatureSet(data, features = mito_genes[mito_genes %in% rownames(data)], col.name = "percent_mito", assay = 'RNA')
ADD COMMENT

Login before adding your answer.

Traffic: 2182 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6