Closed ch8316f5eyu closed 2 years ago
Hi @ch8316f5eyu,
Thank you for your interest in our package. Based on your code, I am wondering what is the zwy_matrix() here? Could you please check if the Gene_set matrix is in the correct format matched with the annotation matrix in the tutorial.
Here is an example on how to create a gene set matrix based on my previous answer to other users https://github.com/xzhoulab/iDEA/issues/16:
#### load the library
library(qusage)
#### read in the gmt for mated gene list, e.g., c2.cp.v7.4.symbols.gmt
exampleSet = read.gmt("./c2.cp.v7.4.symbols.gmt")
#### All genes you want to analyzed, here I use all genes that exist in the c2 pathway as an example. I recommend you to use the union of the genes in your summary statistics and the gene sets you want to analyzed.
AllGenes = unique(unlist(exampleSet))
print(length(AllGenes))
## 13351
#### make the annotation
Annotation = sapply(1:length(exampleSet),function(iSet){
##### if the gene is included in the ith set
as.numeric(AllGenes %in% exampleSet[[iSet]])})
#### give the column names and row names of the annotation
rownames(Annotation) = AllGenes
colnames(Annotation) = names(exampleSet)
print(Annotation[1:5,1:5])
BIOCARTA_GRANULOCYTES_PATHWAY BIOCARTA_LYM_PATHWAY BIOCARTA_BLYMPHOCYTE_PATHWAY BIOCARTA_CARM_ER_PATHWAY BIOCARTA_LAIR_PATHWAY
CXCL8 1 1 0 0 1
IFNG 1 0 0 0 0
IL1A 1 1 0 0 1
CSF3 1 0 0 0 0
SELP 1 0 0 0 1
Hope this is helpful! Let me know if you have further questions!
HI, I encountered an error when performing iDEA.fit. There is my code:
And the error is:
Thanks!