<p>You simply need to transform your data.frame into a matrix. Just use these  two lines: </p>

<pre><code>library(SingleCellExperiment)
sce &lt;- SingleCellExperiment(assays = list(counts = as.matrix(all.counts)))
</code></pre>

CC BY-SA 4.0
2019-03-04T16:33:02.677Z
2019-03-04T16:33:02.677Z
M. Aburidi
<p>I think you might want to use <a href="https://www.bioconductor.org/help/workflows/simpleSingleCell/" rel="nofollow noreferrer">the most recent workflow</a>, which should be for the latest version on Bioconductor.</p>

CC BY-SA 3.0
2017-12-12T11:21:52.930Z
2017-12-12T12:53:10.413Z
2017-12-12T12:53:10.413Z
Nils
<p>I am trying to go through the following <a href="https://f1000research.com/articles/5-2122/v2" rel="nofollow noreferrer">scRNA-seq tutorial</a>.</p>

<p>But the line <code>sce &lt;- newSCESet(countData=all.counts)</code> is not working anymore with the most up-to-date version of <code>scater</code>. Now we should use <code>SingleCellExperiment</code> function instead, so when trying to do the following:</p>

<pre><code>sce &lt;- SingleCellExperiment(assays = list(counts = all.counts))
</code></pre>

<p>I am getting the error: </p>

<pre><code>Error in seq_len(ncol(assay)) : 
  argument must be coercible to non-negative integer
In addition: Warning message:
In seq_len(ncol(assay)) : first element used of 'length.out' argument
</code></pre>

<p>Any help would be greatly appreciated.</p>

CC BY-SA 3.0
2017-12-11T08:41:16.030Z
You can better ask questions about bioconductor packages on [https://support.bioconductor.org/](https://support.bioconductor.org/), you'll probably get an answer from Aaron Lun himself within a day.
benn
CC BY-SA 3.0
2017-12-11T09:05:01.960Z
Which version of R and of the packages are you using? That workflow is for version 3.4 of Bioconductor, and the current  version is 3.6
llrs
<r><rna-seq>
scater: SingleCellExperiment, Error in seq_len(ncol(assay))
# scater: SingleCellExperiment, Error in seq_len(ncol(assay))

(Asked by: username_0 on 2017-12-10)

I am trying to go through the following scRNA-seq tutorial.
But the line sce <- newSCESet(countData=all.counts) is not working anymore with the most up-to-date version of scater. Now we should use SingleCellExperiment function instead, so when trying to do the following:
sce <- SingleCellExperiment(assays = list(counts = all.counts))

I am getting the error: 
Error in seq_len(ncol(assay)) : 
  argument must be coercible to non-negative integer
In addition: Warning message:
In seq_len(ncol(assay)) : first element used of 'length.out' argument

Any help would be greatly appreciated.

**Tags:** r, rna-seq
> **Comments:**
> **username_1**: You can better ask questions about bioconductor packages on [https://support.bioconductor.org/](https://support.bioconductor.org/), you'll probably get an answer from Aaron Lun himself within a day.  
> **username_2**: Which version of R and of the packages are you using? That workflow is for version 3.4 of Bioconductor, and the current  version is 3.6  

---

## 2 answers

### Answer by username_4 on 2017-12-12. Score: 5 | Accepted answer

I think you might want to use [the most recent workflow](https://www.bioconductor.org/help/workflows/simpleSingleCell/), which should be for the latest version on Bioconductor.


---

### Answer by username_3 on 2019-03-04. Score: 1

You simply need to transform your data.frame into a matrix. Just use these  two lines: 
library(SingleCellExperiment)
sce <- SingleCellExperiment(assays = list(counts = as.matrix(all.counts)))


---

