Entering edit mode
6 months 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"
Did you check where the
features.tsv.gz
file had Gene IDs or Ensembl IDs?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.
Yes,
CreateAssayObject
function is used for only expression matrix.