text: user4892: I have a Seurat object existing of an aggregate of two samples namely; RD1 and RD2. I am trying to make a subset of each sample. But it's not really working. I manage to make a subset of the cells but I don't manage to make a subset of the whole object. Isn't there a way to do this, based on the subset from cell names a subset to make from the whole object. 
  seuratObj$orignal_1 <- seuratObj@meta.data$orig.ident
  seuratObj$orignal_2 <- seuratObj@meta.data$orig.ident
  seuratObj$orignal_1 <- gsub("RD1", "TRUE",seuratObj$orignal_1 )
  seuratObj$orignal_1  <- gsub("RD2", "False",seuratObj$orignal_1  )
  seuratObj$orignal_2  <- gsub("RD1k", "TRUE",seuratObj$orignal_2  )
  seuratObj$orignal_2  <- gsub("RD2", "False",seuratObj$orignal_2  )
  
  subset_DR1 <- data.frame(orignal_1 = seuratObj$orignal_1)
  subset_DR1 <- subset(subset_DR1, orignal_1 == TRUE,select = c("orignal_1"))
  
  subset_DR2 <- data.frame(orignal_2 = seuratObj$orignal_2)
  subset_DR2 <- subset(subset_DR2 , orignal_2 == TRUE,select = c("orignal_2"))
  
  SubsetData(seuratObj, cells = rownames(subset_DR1), subset.name = seuratObj$orignal_1)
  
  I just started to work with seurat packages. I think I am missing something. 
  
  user181: I think your issue is simply not assigning the newly-subset object in to a new object.
  Assuming rownames(subset_DR1) is indeed a list of cell names
  seuratObj_subset_dr1 <- SubsetData(seuratObj, cells=rownames(subset_DR1))
  
  will work.
  
original_text: 4892: <p>I have a Seurat object existing of an aggregate of two samples namely; RD1 and RD2. I am trying to make a subset of each sample. But it's not really working. I manage to make a subset of the cells but I don't manage to make a subset of the whole object. Isn't there a way to do this, based on the subset from cell names a subset to make from the whole object. </p>
  
  <pre><code>seuratObj<span class="math-container">$orignal_1 &lt;- seuratObj@meta.data$</span>orig.ident
  seuratObj<span class="math-container">$orignal_2 &lt;- seuratObj@meta.data$</span>orig.ident
  seuratObj<span class="math-container">$orignal_1 &lt;- gsub("RD1", "TRUE",seuratObj$</span>orignal_1 )
  seuratObj<span class="math-container">$orignal_1  &lt;- gsub("RD2", "False",seuratObj$</span>orignal_1  )
  seuratObj<span class="math-container">$orignal_2  &lt;- gsub("RD1k", "TRUE",seuratObj$</span>orignal_2  )
  seuratObj<span class="math-container">$orignal_2  &lt;- gsub("RD2", "False",seuratObj$</span>orignal_2  )
  
  subset_DR1 &lt;- data.frame(orignal_1 = seuratObj$orignal_1)
  subset_DR1 &lt;- subset(subset_DR1, orignal_1 == TRUE,select = c("orignal_1"))
  
  subset_DR2 &lt;- data.frame(orignal_2 = seuratObj$orignal_2)
  subset_DR2 &lt;- subset(subset_DR2 , orignal_2 == TRUE,select = c("orignal_2"))
  
  SubsetData(seuratObj, cells = rownames(subset_DR1), subset.name = seuratObj$orignal_1)
  </code></pre>
  
  <p>I just started to work with seurat packages. I think I am missing something. </p>
   181: <p>I think your issue is simply not assigning the newly-subset object in to a new object.</p>
  
  <p>Assuming <code>rownames(subset_DR1)</code> is indeed a list of cell names</p>
  
  <pre><code>seuratObj_subset_dr1 &lt;- SubsetData(seuratObj, cells=rownames(subset_DR1))
  </code></pre>
  
  <p>will work.</p>
  