-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
veg_distance not available? #272
Comments
It looks like being an issue in the package where you have function There is currently a similar issue in StackOverflow, and a common denominator is phyloseq package. Perhaps that is where you get the error? If so, please contact phyloseq developers and ask them to upgrade their package. We tested vegan against dependent packages, and CRAN ran similar tests before accepting vegan, but this problem did not appear there. We would have communicated with that other package had we seen this problem before, but we did not catch this in our tests. |
Please note that if |
@joey711 : is this an issue with phyloseq (we now use |
Thank you Jari, you are correct and I believe it must be a phyloseq issue since it has not been updated through CRAN. I saw the StackOverflow issue and the solution of reloading the vegan package did not resolve the issue. I will try your suggestion of vegdist() to circumvent my issue. |
This is also reported as an issue in phyloseq as joey711/phyloseq#918 |
Actually, @jarioksa , phyloseq is just wrapping Did something change with |
Now it looks like this is a mismatch between vegan R code and its compiled libraries: for some reason (and I don't know which) you seem to use |
@joey711 all three current reports have the same feature: they upgraded to vegan_2.5-1 and after that phyloseq commands fail. In two cases they seem to be The
Here the There are similar copies of vegan function in https://github.com/joey711/phyloseq/blob/master/R/distance-methods.R#L110 If this is the case, probably the easiest way of refreshing phyloseq is a fresh start: close R, start a new session and go. Would this work @fjlicht @okayama1 ? |
Thanks a lot for looking into this issue.
I have tried that and it doesn't work for me :-(
…On Wed, Apr 18, 2018 at 3:38 PM, Jari Oksanen ***@***.***> wrote:
@joey711 <https://github.com/joey711> all three current reports have the
same feature: they upgraded to *vegan*_2.5-1 and after that *phyloseq*
commands fail. In two cases they seem to be distance methods, and in one
case make_network. What is common here is that compiled library was
upgraded to *vegan* 2.5-1, but *R* code was not upgraded, but 2.4-x code
was still used.
The make_network() case looks simpler to debug: it has this definition:
R/network-methods.R:89:#' ii <- make_network(enterotype, max.dist=0.3, distance=function(x){vegan::vegdist(x, "jaccard")})
Here the distance is defined as a call to vegan::vegdist(), but this call
goes to pre-upgrade *vegan*.
There are similar copies of *vegan* function in
https://github.com/joey711/phyloseq/blob/master/R/distance-methods.R#L110
After this a local copy (dfun) of vegdist() is used instead of updated
vegdist(). This copy is made when loading *phyloseq*, and will not change
when *vegan* changes. There are also two setMethod("vegdist",...) calls
in extend_vegan.R, and I have no idea what is the version of vegdist they
are used if *vegan* is upgraded during a session.
If this is the case, probably the easiest way of refreshing *phyloseq* is
a fresh start: close *R*, start a new session and go. Would this work
@fjlicht <https://github.com/fjlicht> @okayama1
<https://github.com/okayama1> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#272 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGbowQxZu1BCA7eyRzlBY-5M8hxO8OiOks5tptFbgaJpZM4TY5eG>
.
|
@okayama1 Just to confirm; close all R sessions, including those in RStudio or other IDEs you are using. Start a clean session; update/reinstall vegan and phyloseq; load the packages and try to run the code causing the problem. Be sure to start clean R sessions — ideally invoke R with |
I have now tried to do the same from the console using R --vanilla and it
is not working not sure why ...
…On Wed., 18 Apr. 2018, 4:17 pm Gavin Simpson, ***@***.***> wrote:
@okayama1 <https://github.com/okayama1> Just to confirm; close all R
sessions, including those in RStudio or other IDEs you are using. Start a
clean session; update/reinstall *vegan* and *phyloseq*; load the packages
and try to run the code causing the problem. Be sure to start clean R
sessions — ideally invoke R with --vanilla.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#272 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGbowXXpbFGh1MIpIreKIhrUpizMujwGks5tptpugaJpZM4TY5eG>
.
|
I tried this at work where I have phyloseq installed on my desktop. Funnily, there all @okayama1 examples worked with vegan 2.5-1 (and newer). However, when I installed vegan 2.4-6, the very same examples failed wit message > bray_dist <- phyloseq::distance(gp, "bray")
Error in vegdist(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 27, 100, 130, 1, :
object 'do_vegdist' not found Looking at the path to this error we see: > traceback()
... [whole lotta rubbish] ...
6: do.call(dfun, fun.args)
5: do.call(dfun, fun.args)
4: distance(otu_table(physeq), method, type, ...)
3: distance(otu_table(physeq), method, type, ...)
2: phyloseq::distance(gp, "bray")
1: phyloseq::distance(gp, "bray") So it is the Conclusion: re-install phyloseq after updating vegan to 2.5-1. This will work if you install phyloseq from the source. I have no idea what happens in Windows or macOS if you install phyloseq from binary package. It is possible that they may have the version of |
The phyloseq package must be used with the same version of vegan that was used when phyloseq was build and installed. If vegan is version 2.5-x and phyloseq was built for older version 2.4-x, you get an error message
If vegan is version 2.4-x and phyloseq was built for newer version 2.5-x, you get an error message
You must take care that phyloseq and vegan versions are consistent. You can either try with re-installing phyloseq or installing a suitable vegan version (which means either upgrading to 2.5-x or downgrading to 2.4-6 depending on your phyloseq). The vegan version used by phyloseq is fixed when a binary version of phyloseq was built. If you are installing phyloseq from source files, re-installing phyloseq will always use the installed version of vegan. If you installing phyloseq from binary packages (typically in Windows and macOS), you are stuck with the vegan version that was built in phyloseq. Please note that the problems occur only when you use phyloseq commands -- vegan commands will work normally. This is a transitional problem which will appear when only one of phyloseq or vegan is updated, and will disappear with time when both of these packages are updated. |
See also joey711/phyloseq#918 and joey711/phyloseq#921 for this issue. |
Recently updated R and now am unable to run previous code. Not sure if it is a vegan issue or an R issue?
The text was updated successfully, but these errors were encountered: