Hello,
I am trying to use CIBERSORT to deconvolute the immune cells in pancreatic cancer after my treatments. I have 3 biological replicates of Control, Treatments A,B,C.
Using edgeR, I created the cpm matrix which is not log transformed. and converted it to the required format as follows:
# Load Packages ----
library(edgeR)
library(org.Mm.eg.db)
# Load the data ----
data<- read.csv("gene_count_matrix.csv", header = T, row.names = 1L) # n=55401
pheno<- read.csv("pheno_sheet.csv", header = T, row.names = 1L)
# Load the data into edgeR ----
dge<- DGEList(counts=data, group = pheno$Sample) # n=55401
# Filtering low count genes ----
keep<- filterByExpr(dge)
dge<- dge[keep,,keep.lib.sizes=FALSE] # n=21476
# Normalising the data ----
dge<- calcNormFactors(dge)
cpm<- cpm(dge, log=F) # n=21476
cpm<- data.frame(cpm)
cpm$ENTREZID<- mapIds(org.Mm.eg.db, keys = rownames(cpm), keytype = "ENSEMBL", column = "ENTREZID")
cpm<- cpm[!duplicated(cpm$ENTREZID),]
cpm$SYMBOL<- mapIds(org.Mm.eg.db, keys = rownames(cpm), keytype = "ENSEMBL", column = "SYMBOL")
cpm<- na.omit(cpm)
rownames(cpm) = cpm$SYMBOL
cpm<- subset(cpm, select = -c(ENTREZID, SYMBOL))
write.csv(cpm, "CPM_CIBERSORTX.csv")
I then converted it to a tab delimited file and uploaded it to CIBERSORTx.
Using the default LM22 matrix, I used the following job parameters:
Date: 2022-10-12 14:39:40
Job type: Impute Cell Fractions
Signature matrix file: LM22.update-gene-symbols.txt
Mixture file: CPM_CIBERSORTX.txt
Batch correction: enabled
Batch correction mode: B-mode
Disable quantile normalization: true
Run mode (relative or absolute): relative
Permutations: 100
And then this is the error I got:
Error: $ operator is invalid for atomic vectors
In addition: Warning message:
In mclapply(1:svn_itor, res, mc.cores = svn_itor) :
all scheduled cores encountered errors in user code
Execution halted
Does anyone know how to resolve this?
Thanks for your time.
Maybe try to convert the atomic vector to a data frame and print it already tab separated with:
Also make sure before running
CIBERSORT
that you have the gene symbols in the first column of your file.Hi, Thanks for your suggestion. Unfortunately, I got the same error when I did it with your suggestion.
Hmm.. could you show the content of the file?
This is the file. Of note, after saving it as a tsv file, I added "Gene" over rownames as per requirements of CIBERSORT
So the final File looked like this.
Hello. I faced the same problem but not able to resolve it. I don't have double quotation and no NA values and the dataset used is in the form of dataset not any other type. Would anyone could help me resolve this error? I can provide more info on that. Thanks.
For me, this error was produced when the difference between the number of samples (in the mixture file) to the number of cell types (in the signature matrix) was not large enough.