This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Subsetting dataset to create 2 seurat objects

I'm aligning two groups (old vs young) using this tutorial

The tutorial has the two groups in separate files (control & stim):

ctrl.data <- read.table(file = "../data/immune_control_expression_matrix.txt.gz", sep = "\t")
stim.data <- read.table(file = "../data/immune_stimulated_expression_matrix.txt.gz", sep = "\t")

then set up control object

ctrl <- CreateSeuratObject(counts = ctrl.data, project = "IMMUNE_CTRL", min.cells = 5)
stim <- CreateSeuratObject(counts = stim.data, project = "IMMUNE_STIM", min.cells = 5)

I have a matrix of gene counts (rows) and 3 cell types (columns) gathered from young and old mice.

How can I separate my dataset to create separate Seurat objects for young and old? An example column name is young_MPP_179.

Thanks!

r seurat rna-seq

Use the meta.data parameter of CreateSeuratObject() to supply a data.frame with the corresponding information: each row in that data.frame should correspond to a cell name (= colname) of the matrices you read in; you can then use the columns to specify which cell belongs to either OLD or YOUNG.

You will then be able to use the SubsetData() function.

You must have the GEM well barcode id and associated cell origin to create such subsets. The barcodes are present in orig.ident column.

0 answers

No answers yet.

Log in to answer this question.