<p>I run plotPCA for single cell RNA-seq data, while I get error message (I use R 4.0). I attached the code and error message here. Did anyone know the reason and how to deal with it. Thanks!</p>

<pre><code>library(pcaMethods)
library(SC3)
library(scater)
library(SingleCellExperiment)
library(pheatmap)
library(mclust)
set.seed(1234567)
deng &lt;- readRDS("deng-reads.rds")
plotPCA(deng, colour_by = "cell_type2")
</code></pre>

<pre><code>Error in value[[3L]](cond) : invalid subscript 'type' in 'reducedDimNames(&lt;SingleCellExperiment&gt;)'
'PCA' not in 'reducedDimNames(&lt;SingleCellExperiment&gt;)'
</code></pre>

<p>I also get error message when I run the code as below: </p>

<pre><code>colData(deng)$tSNE_kmeans &lt;- as.character(kmeans(deng@reducedDims$TSNE, centers = 8)$clust)
</code></pre>

<pre><code># Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), : 'data' must be of a vector type, was 'NULL'
</code></pre>

CC BY-SA 4.0
2020-05-25T09:22:31.547Z
I solve the first error for PCA, while have no idea about the second one. Does anyone have any suggestion?
Yach
<r><scrnaseq><bioconductor>
PCA plot did not work in single cell RNA-seq
# PCA plot did not work in single cell RNA-seq

(Asked by: username_0 on 2020-05-25)

I run plotPCA for single cell RNA-seq data, while I get error message (I use R 4.0). I attached the code and error message here. Did anyone know the reason and how to deal with it. Thanks!
library(pcaMethods)
library(SC3)
library(scater)
library(SingleCellExperiment)
library(pheatmap)
library(mclust)
set.seed(1234567)
deng <- readRDS("deng-reads.rds")
plotPCA(deng, colour_by = "cell_type2")

Error in value[[3L]](cond) : invalid subscript 'type' in 'reducedDimNames()'
'PCA' not in 'reducedDimNames()'

I also get error message when I run the code as below: 
colData(deng)$tSNE_kmeans <- as.character(kmeans(deng@reducedDims$TSNE, centers = 8)$clust)

# Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), : 'data' must be of a vector type, was 'NULL'

**Tags:** r, scrnaseq, bioconductor
> **Comments:**
> **username_0**: I solve the first error for PCA, while have no idea about the second one. Does anyone have any suggestion?  

---

## 0 answers

