singlecellworkflow
singlecellworkflow copied to clipboard
Issue running workflow file
Hi,
I tried to run the code in the workflow.Rmd file and I keep getting an issue when I get to the dimensionality reduction step, from the line fit <- cmdscale(d, eig = TRUE, k = 2)
:
Error in cmdscale(d, eig = TRUE, k = 2) : NA unauthorized in 'd'
This is due to W
being an empty DataFrame (747 rows and 0 columns). The error seems to come from the line W <- colData(se)[, grepl("^W", colnames(colData(se)))]
where there is no name with W
. Do you know how to fix this error ? Thanks in advance.
Best,
N. L.
Hi Nathalie,
Which versions of the different packages are you using? We have made quite a few changes to the zinbwave package since the release of the workflow, especially, we now use the singleCellExperiment class. It is possible that if you use a more recent version of zinbwave package compared to the version that is used in the workflow (0.99.6), it creates errors. We are working on an updated version of the bioconductor workflow, but in the meantime, it is important to use the versions of the packages that are used in the workflow, that is:
scone (1.1.2), zinbwave (0.99.6), clusterExperiment (1.3.2), Bioconductor (3.6).
Let me know if it does not solve the error.
Thanks, Fanny
Hi Fanny,
thanks for your quick reply. I am using the latest versions of scone (1.2.0), zinbwave (1.0.0), clusterExperiment (1.4.0) and Bioconductor (3.6). However I could not find the older versions you're suggesting, neither on GitHub (only versions 0.1. in drisso/archive-zinbwave), neither on Bioconductor packages repository (https://bioc.ism.ac.jp/packages/3.6/bioc/src/contrib/ and https://bioc.ism.ac.jp/packages/3.5/bioc/src/contrib/). Do you know where could I find those specific versions ? Or is there any Docker image available ?
Thanks,
Nathalie
Hi Nathalie,
From the error you get, my guess is that the issue is with zinbwave. Could you download and install the zinbwave package from archive-zinbwave. The version is 0.99.6.1 and it should work. Let me know if it does not.
Thanks!
Hi Fanny, In archive-zinbwave, I could only find version 0.1.4, 0.1.2, 0.1.1, 0.1.0 and 0.0.2. Is there another way of getting version 0.99.6.1 ?
Thanks a lot
If you clone the master branch of the repo in https://github.com/drisso/archive-zinbwave, you will get version 0.99.6.1. To do so, in your terminal, you can type:
git clone [email protected]:drisso/archive-zinbwave.git
R CMD build archive-zinbwave --no-build-vignettes
R CMD INSTALL
Now, if you type in R
packageVersion('zinbwave')
You will see that you have version 0.99.6.1 of zinbwave.
So now I tried with the packages : zinbwave 0.99.6.1 scone 1.1.3 (I could not find the 1.1.2 version) clusterExperiment 1.3.2 bioconductor 3.6
and I still get the same error at line fit <- cmdscale(d, eig = TRUE, k = 2)
returning Error in cmdscale(d, eig = TRUE, k = 2) : NA non autorisées dans 'd'
I haven't change anything to the worflow .Rmd file. Any more ideas of what might go wrong ?
Thanks !
Not sure. How many NA's do you have in d? Do you have NA's in W?
Here are some results that may help :
> grepl("^W", colnames(colData(se)))
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> W <- colData(se)[, grepl("^W", colnames(colData(se)))]
DataFrame with 747 rows and 0 columns
W <- as.matrix(W)
d <- dist(W)
length(d)
[1] 278631
sum(is.na(d))
[1] 278631
dim(W)
[1] 747 0
Can you show us the result of
colData(se)
It appears that none of your columns start with a W
. If you're using the latest version of zinbwave
that might be because they are actually stored in the reducedDims
slot.
So substituting
W <- colData(se)[, grepl("^W", colnames(colData(se)))]
with
W <- reducedDims(se)
should/could work.
Here are the results you asked for :
colData(se[, 1:2])
DataFrame with 2 rows and 19 columns
Experiment Batch publishedClusters NREADS NALIGNED RALIGN TOTAL_DUP PRIMER PCT_RIBOSOMAL_BASES
<factor> <factor> <numeric> <numeric> <numeric> <numeric> <numeric> <numeric> <numeric>
OEP01_N706_S501 K5ERRY_UI_96HPT Y01 1 3313260 3167600 95.6035 47.9943 0.0154566 2e-06
OEP01_N701_S501 K5ERRY_UI_96HPT Y01 1 2902430 2757790 95.0167 45.0150 0.0182066 0e+00
PCT_CODING_BASES PCT_UTR_BASES PCT_INTRONIC_BASES PCT_INTERGENIC_BASES PCT_MRNA_BASES MEDIAN_CV_COVERAGE
<numeric> <numeric> <numeric> <numeric> <numeric> <numeric>
OEP01_N706_S501 0.200130 0.230654 0.404205 0.165009 0.430784 0.843857
OEP01_N701_S501 0.182461 0.201810 0.465702 0.150027 0.384271 0.914370
MEDIAN_5PRIME_BIAS MEDIAN_3PRIME_BIAS CreER ERCC_reads
<numeric> <numeric> <numeric> <numeric>
OEP01_N706_S501 0.061028 0.521079 1 10516
OEP01_N701_S501 0.033350 0.373993 3022 9331
And this doesn't solve the problem :
> W <- reducedDims(se)
> W
List of length 1
names(1): zinbwave
Btw, I am using zinbwave 0.99.6.1.
Thanks again for the help
I am getting the same error. I'm not sure how to access the W matrix after running zinbwave, and I don't see a reducedDims column after using zinbwave. Any suggestions on how to resolve this? Thank you!
Sorry, there was a typo in my previous answer. The correct way of accessing W is
W <- reducedDim(se)
(note the absence of "s" in reducedDim). A safer way is
W <- reducedDim(se, "zinbwave")
which will work even if you have run multiple dimensionality methods on your data.
All of this works if you are using the zinbwave package version >0.99.6. If you are using version 0.99.6 or less, then
W <- colData(se)[, grepl("^W", colnames(colData(se)))]
should work.
Note that the current release version of zinbwave on Bioconductor is 1.0.0 and that is the recommended and supported version.
We are in the process of updating the workflow with the updated versions of the packages.