This is a test version of Biostars. For the public version, visit https://www.biostars.org.
PSEUDOBULK HELP-DE Expression in scRNA-seq

I have been trying for days to get my pseudobulk code to work, this is the current code snippet:

#rna$SampleIDs<-rownames(rna@meta.data)

rna<-NormalizeData(rna)
rna<-FindVariableFeatures(rna)
rna<-ScaleData(rna)
rna<-RunPCA(rna)

##### Aggregate counts across the cells at the sample level.
cts<-AggregateExpression(rna, 
                         group.by = "cellClass", "SampleIDs",
                         assays='RNA',
                         slot="counts",
                         return.seurat=FALSE,
                         verbose=TRUE
)

Error is:
Warning: The following 1 features were not found in the RNA assay: SampleIDs
Warning: None of the features specified were found in the RNA assay.

I re-scaled and normalized everything thinking this would work, and the issue persists. Any pointers, please?
scrna-seq seurat

1 answer

You need to concatenate your group.by strings:

cts<-AggregateExpression(rna, 
                         group.by = c("cellClass", "SampleIDs"),
                         assays='RNA',
                         slot="counts",
                         return.seurat=FALSE,
                         verbose=TRUE

if the solution fixed your issue, please accept the answer and up-vote

Log in to answer this question.