I am analyzing a scRNAseq data and having error messages like this.
Error in intI(i, n = x@Dim[1], dn[[1]], give.dn = FALSE) :
invalid character indexing
In addition: Warning message:
Deprecated, use tibble::rownames_to_column() instead.
May I have some advice to handle this error?
Thank you so much!!
#### codes :
## X is a count data (gene by cell)
> X <- X[rowSums(X > 0) >= 2, , drop = FALSE]
> pX <- X
> colpX <- colnames(pX)
>
> library(DESeq2) # normalize cells using
> sf <- estimateSizeFactorsForMatrix(pX)
> npX <- t(t(pX) / sf ) ## normalization using size factor.
> lnpX <- log(npX+1, 10)
>
> colpXc <- colnames(pX)
> library(monocle)
> pD <- data.frame(cellname = colpX, time= timelab)
> rownames(pD) <- paste("C", 1:ncol(pX), sep = "")
>
> fD <- data.frame(genename = rownames(pX), num_cells_expressed = rowSums(pX !=0) )
> rownames(fD) <-rownames(pX)
> colnames(pX) <- rownames(pD)
>
> pd <- new("AnnotatedDataFrame", data = pD)
> fd <- new("AnnotatedDataFrame", data = fD)
> pXX <- newCellDataSet(pX, phenoData = pd, featureData = fd)
## Here I used Census on normalized read count. Would it be the reason for this error?
> rpc_matrix <- relative2abs(pXX)
>
> pXX <- newCellDataSet(as(as.matrix(rpc_matrix), "sparseMatrix"),
+ phenoData = pd,
+ featureData = fd,
+ lowerDetectionLimit=1,
+ expressionFamily=negbinomial.size())
>
> pXX <- estimateSizeFactors(pXX)
> pXX <- estimateDispersions(pXX)
Error in intI(i, n = x@Dim[1], dn[[1]], give.dn = FALSE) :
invalid character indexing
In addition: Warning message:
Deprecated, use tibble::rownames_to_column() instead.
>