text: user8610: I am trying to follow a tutorial from Sanger institute (from May 2019) on analysis of single cell RNA Seq data. They use isSpike function to filter out ERCC (control) and MT (mitochondrial RNA) reads, but I am getting an error message that isSpike is a deprecated function. I am trying to use altExp instead as recommended by some people. I can't seem to figure this out. Can anyone provide some code to use instead of isSpike? I am new to bioinformatics. 
  I tried to swap out the isSpike function with the altExp function, but I am getting stuck on how to translate the grepl function.
  
  user5077: You are on the latest version of SingleCellExperiment most likely. You should not go back to using the old version. One thing is to check out the new tutorial. In any case, the purpose of altExp() is to provide another slot of ERCC reads and MT.. etc.
  So in your example (super not recommended to watch video btw) :
  molecules = read.delim("https://raw.githubusercontent.com/jdblischak/singleCellSeq/master/data/molecules.txt",stringsAsFactors=FALSE,row.names=1)
  
  annotation = read.delim("https://raw.githubusercontent.com/jdblischak/singleCellSeq/master/data/annotation.txt",stringsAsFactors=FALSE)
  
  We can pull out the spike in and mt genes:
  library(SingleCellExperiment)
  library(EnsDb.Hsapiens.v86)
  
  Spikein_names = grep("^ERCC-",rownames(molecules),value=TRUE)
  SpikeIn = molecules[Spikein_names,]
  
  g = genes(EnsDb.Hsapiens.v86)
  MTgene_names = g[seqnames(g)=="MT"]$gene_id
  MTgenes = molecules[rownames(molecules) %in% MTgene_names,]
  
  Have a vector of genes to keep:
  keep = setdiff(rownames(molecules),c(SpikeIn,MTgenes))
  
  Then make the single cell object:
  sce <- SingleCellExperiment(
  assays=list(counts=as.matrix(molecules[keep,])),colData=annotation)
  
  Use altExp to slot in the stuff:
  altExp(sce, "spike-in") <- SummarizedExperiment(SpikeIn)
  altExp(sce, "MTgenes") <- SummarizedExperiment(MTgenes)
  
  
  user8880: isSpike was provided by SingleCellExperiment. It is now deprecated. The notes in SingleCellExperiment indicate that one should use altExps
  I am struggling with a similar problem. Can't compile a package (powsimR) because a dependency uses isSpike (not used in the code directly), so I have to hunt down where it is used by one of a very long list of dependencies.
  
original_text: 8610: <p>I am trying to follow a tutorial from Sanger institute (from May 2019) on analysis of single cell RNA Seq data. They use isSpike function to filter out ERCC (control) and MT (mitochondrial RNA) reads, but I am getting an error message that isSpike is a deprecated function. I am trying to use altExp instead as recommended by some people. I can't seem to figure this out. Can anyone provide some code to use instead of isSpike? I am new to bioinformatics. </p>
  
  <p>I tried to swap out the isSpike function with the altExp function, but I am getting stuck on how to translate the grepl function.</p>
   5077: <p>You are on the latest version of SingleCellExperiment most likely. You should not go back to using the old version. One thing is to check out the <a href="https://bioconductor.org/packages/devel/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html" rel="nofollow noreferrer">new tutorial</a>. In any case, the purpose of altExp() is to provide another slot of ERCC reads and MT.. etc.</p>
  
  <p>So in your example (super not recommended to watch video btw) :</p>
  
  <pre><code>molecules = read.delim("https://raw.githubusercontent.com/jdblischak/singleCellSeq/master/data/molecules.txt",stringsAsFactors=FALSE,row.names=1)
  
  annotation = read.delim("https://raw.githubusercontent.com/jdblischak/singleCellSeq/master/data/annotation.txt",stringsAsFactors=FALSE)
  </code></pre>
  
  <p>We can pull out the spike in and mt genes:</p>
  
  <pre><code>library(SingleCellExperiment)
  library(EnsDb.Hsapiens.v86)
  
  Spikein_names = grep("^ERCC-",rownames(molecules),value=TRUE)
  SpikeIn = molecules[Spikein_names,]
  
  g = genes(EnsDb.Hsapiens.v86)
  MTgene_names = g[seqnames(g)=="MT"]$gene_id
  MTgenes = molecules[rownames(molecules) %in% MTgene_names,]
  </code></pre>
  
  <p>Have a vector of genes to keep:</p>
  
  <pre><code>keep = setdiff(rownames(molecules),c(SpikeIn,MTgenes))
  </code></pre>
  
  <p>Then make the single cell object:</p>
  
  <pre><code>sce &lt;- SingleCellExperiment(
  assays=list(counts=as.matrix(molecules[keep,])),colData=annotation)
  </code></pre>
  
  <p>Use altExp to slot in the stuff:</p>
  
  <pre><code>altExp(sce, "spike-in") &lt;- SummarizedExperiment(SpikeIn)
  altExp(sce, "MTgenes") &lt;- SummarizedExperiment(MTgenes)
  </code></pre>
   8880: <p><code>isSpike</code> was provided by <code>SingleCellExperiment</code>. It is now deprecated. The notes in <code>SingleCellExperiment</code> indicate that one should use <code>altExps</code></p>
  
  <p>I am struggling with a similar problem. Can't compile a package (<code>powsimR</code>) because a dependency uses <code>isSpike</code> (not used in the code directly), so I have to hunt down where it is used by one of a very long list of dependencies.</p>
  