Is it possible to create Seurat object with this data
1
0
Entering edit mode
22 months ago
crx6xw ▴ 10

Hi,

Please bear with me as I am a beginner with single cell RNAseq.

I am interested in downloading specific NSCLC patient samples with known KRAS mutations under GEO accession GSE136246. To my understanding, because I am only interested in specific patients from this study, the gene counts under the supplementary data wouldn't be of interest to me because they contain samples that I do not want.

I tried downloading the specific count files for each sample under each sample's supplementary file links, which are supplied as count.tsv files. My understanding is that as long as the count matrix contains the barcodes and cell names as columns and features/genes as rows. This is what the tsv file looks like possible barcodes? feature/genes? enter image description here

I also shared the file here: link to file

My question is that is this even the correct file I can use to create a Seurat object for this specific patient? And if so, is it in the right format? I just did:

TestSeurat = CreateSeuratObject(counts = "file")

My overall goal is to create individual Seurat objects and merge them together under specific conditions to visualize DE between groups.

scrnaseq R seurat • 5.8k views
ADD COMMENT
8
Entering edit mode
22 months ago

Seurat expects cell barcodes as columns, and features (genes) as rows. This means you need to transpose the data once you load it. It's also important to convert it to a sparse matrix.

library("data.table")
library("Matrix")
library("Seurat")

# Use data.table to load the count matrix as a data.frame.
mat <- fread("GSM4043245_NSC015.t1.counts.tsv")
setDF(mat)

# Set the barcodes as the row names.
rownames(mat) <- mat[[1]]
mat[[1]] <- NULL

# Transpose the data and convert to sparse matrix.
mat <- as(t(as.matrix(mat)), "sparseMatrix")

# Create the Seurat object.
seu <- CreateSeuratObject(counts=mat)

And the result.

> seu
An object of class Seurat 
41861 features across 2215 samples within 1 assay 
Active assay: RNA (41861 features, 0 variable features)
ADD COMMENT
0
Entering edit mode

Thank you so much!

ADD REPLY

Login before adding your answer.

Traffic: 1811 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