Entering edit mode
14 months ago
dalibenam64
•
0
Hello
I really need help!! I don't speak English very well so sorry
I have RDS object, this file is processed, normalized (using sct transform approach) and clusters were identified (in other words it ready to use seurat object).
My question is how to determine the number of counts for each gene in lymphocyte B in both control and patients (I have 2 controls and 2 patients). The final result should be an object where genes are in row and all other information are in columns.
NB: Clusters are stored in meta.data@clusters
and patients/control are stored in meta.data@orig.ident
Thank you in advance
A quick way is
That should return a data.frame containing 2 columns and
n
rows as the genes in the dataset.thank you very much for your response I'm really grateful !!
but I'm still confused because for example for patients I have 2 replicates for each type of mutations , for example for the mutation COPA1 I have ( COPA1_1 and COPA1_2 and it's the same thing for COPA2) .
I want to genrate a table with 4 columns with averages of counts for each gene for one type of mutation (average count per gene for COPA1 mutations for both patients together, and the same for the 2 patients who have the COPA2 mutation and finally a column for average count of control.
If you want the average expression, you should look at
AverageExpression
from seurat which returns the average instead of the sum.AverageExpression(rds_obj, group.by = "orig.ident",...)
should do.