Problem with Seurat package in PercentageFeatureSet function
0
0
Entering edit mode
13 days ago
Yoosef ▴ 60

Hello I encountered a problem when calculating the mitochondrial genome in my samples. This is my code

count <- Read10X("GSM4909254/") #give the name of the folder contains the mentioned files
srobj <- CreateAssayObject(counts = count, project = "GSM4909254", 
                           min.cells = 3, min.features = 200)   #filter the data
head(srobj)


srobj[["MTpercent"]] <- PercentageFeatureSet( srobj, pattern = "^MT-")
srobj$MTpercent

png(filename = "srobj.png", width = 1900,height = 1500,res = 200)
VlnPlot(object = srobj,features = c("nFeature_RNA", "nCount_RNA","MTpercent"),
        ncol = 3,cols = 3,pt.size = 1)
dev. Off()

This is the error I get :

srobj[["MTpercent"]] <- PercentageFeatureSet( srobj, pattern = "^MT-")
Warning: The following arguments are not used: assay
Error in `[.data.frame`(slot(object = x, name = "meta.features"), , i,  : 
  undefined columns selected

and When I try to create a VlnPlot, I only get a white picture and the following warning:

Error in UseMethod(generic = "FetchData", object = object) : 
  no applicable method for 'FetchData' applied to an object of class "Assay"
cell single • 342 views
ADD COMMENT
1
Entering edit mode

Did you check where the features.tsv.gz file had Gene IDs or Ensembl IDs?

ADD REPLY
0
Entering edit mode

Thanks a lot for your response. Today, I finally understood what my problem was. I have used CreateAssayObject function, while I should have used CreateSeuratObject. This completely solved my problem.

ADD REPLY
1
Entering edit mode

Yes, CreateAssayObject function is used for only expression matrix.

ADD REPLY

Login before adding your answer.

Traffic: 1407 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