Closed msmcfarlin closed 2 years ago
Hi @msmcfarlin,
Thanks for letting us know about this. Are you able to put together a minimal reproducible example you can share?
Thanks!
Best, David
Hi @ailurophilia,
Yes, here is a reproducible sample. Let me know if you have any issues with it!
#divnet phyloseq data
py <- B2_phyloseq
#Tax glom to phylum for time and update sample names to S1, S2...
py.phy <- py %>% tax_glom(taxrank="phylum")
sample_names(py.phy) <- paste("S",c(1:31),sep = "")
#Set diagonal design matrix for beta analysis
X <- diag(nrow(sample_data(py.phy)))
colnames(X) <- rownames(X) <- as.character(1:ncol(X))
#Run divnet with diagonal
divnet_phylum <- divnet(W = py.phy,
X = X,
variance = "none")
#Change metadata variable V1 to character
py.phy@sam_data$V1 <- as.character(py.phy@sam_data$V1)
#Pull estimates
estimates <- simplifyBeta(divnet_phylum,
py.phy,
"euclidean", "V1") %>% pull(beta_est)
Hi @msmcfarlin,
Sorry for the delay getting back to you. It looks like the issue was a result of simplifyBeta
expecting non-NULL variance estimates in the DivNet object passed to it. I've patched simplifyBeta
so it no longer requires this, so your code should work now with the latest version of DivNet.
Best, David
Hi @ailurophilia,
Thank you for the update!
I updated DivNet and simplifyBeta
is working when "euclidean" or "bray-curtis" are the measurements that are specified. Though I run into the same issue when "aitchison" is used.
Hi @ailurophilia,
Just to check, you said the issue was...
a result of
simplifyBeta
expecting non-NULL variance estimates in the DivNet object passed to it.
I had a NULL variance estimate because I was following the recommendation of the beta diversity vignette. Is it still recommended to set variance equal to "none" in the divnet
function then bootstrapping in a subsequent step for beta diversity analysis?
Thank you for the assistance!
Yes – this is still recommended. The behavior of simplifyBeta here was a bug.
David
Hello,
I am trying to use
simplifyBeta()
and running into the error...Error: Can't subset columns that don't exist. x Columns 'A017', 'A032', 'A034', 'A038', 'A045', etc. don't exist.
This error doesn't seem to be related to the sample names like in issue #73 as my sample names do not have any special characters. The error seems to be related to
vctrs::stop_subscript()
. Do yo you have any thoughts of what the issue is and how to fix this?Here are the outputs from
rlang::last_error()
andrlang::last_trace()
in case they are helpful. Let me know if any other information would be helpful!Thank you!
rlang::last_error()
rlang::last_trace()