I'm trying to build a expression matrix to use as input in a different heatmap tool used on Seurat. For that, I want to take the 500 DEGs with lowest adjusted p-value.
here is what I tried:
DEGs <- all.markers %>% top_n(n = -500, wt = p_val_adj) DEGs.genes <- DEGs$gene DEGs.genes <- unique(DEGs.genes) integratedexpression <- as.matrix(GetAssayData(circBALF.pred.integrated.CD4, assay = "integrated")) integratedexpression.filtered <- integratedexpression[DEGs.genes, ] annotations <- circBALF.pred.integrated.CD4@meta.data annotations <- t(annotations)
the 5th line gives me the following error message:
Error in integratedexpression[DEGs.genes, ] : subscript out of bounds
this does not occur if I extract SCT expression values, it runs perfectly.
What should I do? The format of the matrix seems to be exactly the same. I searched the error and from what I understand the number of rows of the integrated matrix is smaller than 500, which is not the case.