Hello everyone,
I have some TPM data for single cell RNA sequencing but I am unsure of how to manually log transform the count matrix in the SeuratObject created. So far, this is what I have:
df <- read.table(file="...",nrows=2000, sep = "\t", row.names=1, header=T)
proj <- CreateSeuratObject(counts = df, project = "proj", min.cells = 3, min.features = 200)
proj <- subset(proj, subset = nFeature_RNA > 200 & nFeature_RNA < 2500 )
GetAssayData(object = proj) = log(GetAssayData(object = proj)@x)
I am trying to log the tpm counts in the last step but I get an error so I am assuming that I am accessing the data incorrectly. Any help would be greatly appreciated!
Thank you for your reply, when I try this, I get this error:
I edited the answer to fix the error. I confirmed it is now working.
Thank you, that worked! Is there any resource that can better help me understand how to access the different components of the Seurat object?
When they updated from version 2 to 3, they created a cheat sheet that is a nice overview of how to access different parts of the data.
Yes, I was referring to this: https://satijalab.org/seurat/essential_commands.html from which I gathered that I could access the count data by using GetAssayData(object = object) but I was wondering how I could have derived at CreateAssayObject(counts = ...) or if there is some other documentation I might have missed.
If you type
help(package = Seurat)
and scroll down a bit, it lists each function in the package with a short description of it. You can then open up the help documentation for any of those functions for more information.Thank you, appreciate it!