how to to add patient information to seurate metadata.
1
0
Entering edit mode
2.2 years ago
DRGio • 0

I am analyzing some single-cell data and I have the output of the GSE131907 (normalized log2TPM_matrix). I am trying to retrieve the samples ID stored in the .csv file and I want to add them to the Seurat object to be able to use group.by parameter downstream but I keep having problems with that.

GSE131907.genes<- readRDS("Raw/GSE131907_Lung_Cancer_normalized_log2TPM_matrix.rds/GSE131907_Lung_Cancer_normalized_log2TPM_matrix.rds")

dim(GSE131907.genes)
head(GSE131907.genes)
head(x = rownames(x = GSE131907.genes))
head(x = colnames(x = GSE131907.genes))

GSE131907.seurat <- Seurat::CreateSeuratObject(counts = GSE131907.genes, min.cells = 10, min.features = 200)

   # add metadata
sample_metadata <- read.csv(file = "cellinfor.csv")
rownames(sample_metadata) <- sample_metadata$UniqueCell_ID
cell_metadata <- sample_metadata[GSE131907.seurat $orig.ident,]
for(meta in names(cell_metadata)){
  cur_seurat[[meta]] <- cell_metadata[[meta]]

However, if I try to use the table(GSE131907.seurat@meta.data$patientid) doesn't seem to be added to the metadata. I would appreciate any suggestion! Thanks!

metadata cellID • 1.8k views
ADD COMMENT
0
Entering edit mode

basically, I would like to add columname such as (Patient id,Samples, Tissue origins, Histology, Smoking, Pathology, EGFR, Stages) from the cell info file to match the cellID) Manually adding so hassle

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode
2.2 years ago
Malcolm.Cook ★ 1.5k

let's start by fixing the typo: rownames(cellinfro)<- should read rownames(cellinfo)<-

ADD COMMENT
0
Entering edit mode

this is not the main problem. Anway Thanks

ADD REPLY

Login before adding your answer.

Traffic: 1492 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6