joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
584 stars 187 forks source link

Prepare for ape update #829

Closed joey711 closed 7 years ago

joey711 commented 7 years ago

The testing development version of ape can be obtained with the following.

download.packages("ape", ".", repos = "http://ape-package.ird.fr/")

Some specific changes have been flagged by the ape developers.

Known failures

The update causes a known break to phyloseq via the following internal function.

phyloseq:::ape_node_depth_edge_length
function (Ntip, Nnode, edge, Nedge, edge.length)
{
    .C(ape:::node_depth_edgelength, PACKAGE = "ape", as.integer(Ntip),
        as.integer(Nnode), as.integer(edge[, 1]), as.integer(edge[,
            2]), as.integer(Nedge), as.double(edge.length), double(Ntip +
            Nnode))[[7]]
}
<environment: namespace:phyloseq>

This was an internal C-encoded function in ape "borrowed" by phyloseq in order to speed up some tree-specific algorithms.

From the ape author:

The C code has been changed (and other functions too). My recommendation is to use the corresponding R functions:

node.depth.edgelength()
node.depth()
node.height()

(check the options of the last two). This would be easier for you and should be as efficient as the current solution.

Since phyloseq is on BioConductor, this is not a problem for me. However, the package HTSSIP (on CRAN) fails its check apparently because of this problem.

Please update me as necessary: since the next release of ape will break your package on CRAN, I have to inform them of a possible fix from you.

Additional details

Ape update details: https://www.mail-archive.com/r-sig-phylo@r-project.org/msg05046.html

Ape versions: http://ape-package.ird.fr/ape_installation.html#versions

joey711 commented 7 years ago

Note that installing ape from source on mac requires the lgfortran library installed:

http://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks-lgfortran-and-lquadmath-error/

joey711 commented 7 years ago

binaries available here: http://gcc.gnu.org/wiki/GFortranBinaries#MacOS

linneakh commented 7 years ago

I am running into an issue with using phyloseq after I updated ape. I am newbie to R, so am not sure what to do. This is an example of the code I'm trying to run:

my.ord <- ordinate( physeq = BV.101.113.L.ra, method = "PCoA", distance = "wunifrac" )

ord.plot <- (plot_ordination( physeq = BV.101.113.L.ra, ordination = my.ord, color = "Protection2",

shape = "Experiment",

title = "PCoA of lung microbial communities from experiments 101 and 113 (unweighted unifrac)" ) + geom_point(aes(color = Protection2), size = 4) + geom_point(colour = "grey90", size = 1))

And I keep getting the following error: Error in .C(ape:::node_depth_edgelength, PACKAGE = "ape", as.integer(Ntip), : Incorrect number of arguments (7), expecting 5 for 'node_depth_edgelength'

Can you help me?

naupaka commented 7 years ago

I'm just a user, so @joey711 can correct me if there is a preferred alternative solution, but for the moment I have been able to work around this error by using the in-development ape-update branch of phyloseq. It may or may not work in your particular case, but is perhaps worth a try.

# run these at the R console
install.packages("devtools")
devtools::install_github("joey711/phyloseq", ref = "ape-update")
library("phyloseq")

# then try re-running your code...
joey711 commented 7 years ago

@naupaka that was the right solution while that branch was still in development. I've finished testing/fixing it, and it is now merged into master, so the normal github install command should now work while I work to get this implemented into the Bioconductor branches.

devtools::install_github("joey711/phyloseq")

I'll close this issue once they are pushed into BioC so that the typical release installation provide a working version of phyloseq.

naupaka commented 7 years ago

@joey711 Much appreciated. Over the last couple of days I've been trying to figure out how to install from the update branch during a Travis CI build but now that the fixes are on master it's much easier. Thanks again!

joey711 commented 7 years ago

@spholmes fyi

spholmes commented 7 years ago

Great news, I'll retest... for the book.

On Sat, Nov 4, 2017 at 3:13 PM, Paul J. McMurdie notifications@github.com wrote:

@spholmes https://github.com/spholmes fyi

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/joey711/phyloseq/issues/829#issuecomment-341933537, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJcvTy-IV1-4vPJ3G9inULRfocm2de_ks5szOGFgaJpZM4PuQ47 .

-- Susan Holmes John Henry Samter Fellow in Undergraduate Education Professor, Statistics 2017-2018 CASBS Fellow, Sequoia Hall, 390 Serra Mall Stanford, CA 94305 http://www-stat.stanford.edu/~susan/

joey711 commented 7 years ago

This is included in master. I also merged with official bioconductor devel and release branches and pushed upward, so as far as I know, these fixes should appear soon in both. I'll close for now, and re-open or post a new ticket if a problem arises. Should appear within one more day or so.

joey711 commented 7 years ago

update: the release branch is showing the version update with an all-OS-pass result, including binaries.

http://bioconductor.org/checkResults/release/bioc-LATEST/phyloseq/malbec1-buildsrc.html

this issue definitely closed. any related issues with ape/trees should be posted as a new ticket.

spholmes commented 7 years ago

Thanks Joey : a relief that BioC allowed the real update to the release, this is essential... have a good day.

On Mon, Nov 6, 2017 at 1:14 PM, Paul J. McMurdie notifications@github.com wrote:

update: the release branch is showing the version update with an all-OS-pass result, including binaries.

http://bioconductor.org/checkResults/release/bioc-LATEST/phyloseq/malbec1- buildsrc.html

this issue definitely closed. any related issues with ape/trees should be posted as a new ticket.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/joey711/phyloseq/issues/829#issuecomment-342288977, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJcvYweVnrk3fvlv3FnPzh4fwmgAJr2ks5sz3bLgaJpZM4PuQ47 .

-- Susan Holmes John Henry Samter Fellow in Undergraduate Education Professor, Statistics 2017-2018 CASBS Fellow, Sequoia Hall, 390 Serra Mall Stanford, CA 94305 http://www-stat.stanford.edu/~susan/

ahschik commented 7 years ago

@linneakh did your issue get resolved? also encountering the same issue

Error in .C(ape:::node_depth_edgelength, PACKAGE = "ape", as.integer(Ntip), : Incorrect number of arguments (7), expecting 5 for 'node_depth_edgelength'

in a similar application  

Thanks!

joey711 commented 7 years ago

that error means you have not updated to the latest version of phyloseq. Please update.

ahschik commented 7 years ago

Thanks @joey711, that did the trick!

linneakh commented 6 years ago

Thank you @joey711! This issue is all cleared up for me now.

fauzinisha commented 6 years ago

Hi,

I tried updating phyloseq as well and it says all packages are up to date, but I am still receiving the same error as mentioned above

Error in .C(ape:::node_depth_edgelength, PACKAGE = "ape", as.integer(Ntip), : Incorrect number of arguments (7), expecting 5 for 'node_depth_edgelength'

Help Please

ahschik commented 6 years ago

@fauzinisha what's your version of phyloseq?

packageVersion('phyloseq')

I think the latest version is 1.22.3. I thought I was running the latest version but I wasn't before I updated!

fauzinisha commented 6 years ago

1.19.1 :( but I ran update packages for ape and phyloseq and it gives me the same ol' "all packages are up to date" My life is a lie. :(

GeoMicroSoares commented 6 years ago

This update seems to have removed ape::pcoa "Y" argument, which took metadata in. I think this may be why vegan::scores doesn't work with phyloseq::ordinate PCoA outputs anymore. Reproducible example below:

data("GlobalPatterns")
GlobalPatterns.r = transform_sample_counts(GlobalPatterns, function(x) x/sum(x))
GlobalPatterns.r.pcoa <- ordinate(
  physeq = GlobalPatterns.r,
  method = "PCoA",
  distance = "jsd",
  k=3, trymax=1e3, weighted=TRUE,
  formula = ~ Primer + Final_Barcode + SampleType
)
>vegan::scores(GlobalPatterns.r.pcoa, display = "bp")
Error in match.arg(display) : 'arg' should be one of “sites”, “species”
>vegan::scores(GlobalPatterns.r.pcoa, display = "sites")
Error in scores.default(GlobalPatterns.r.pcoa, display = "sites") : 
  Can't find scores

Could this be it? Is there an alternative to now check the contribution of each metadata variable towards changes in community composition?

This may not be the place for this discussion, so I've also posted the issue here.

Thanks in advance!

daralyia commented 6 years ago

Hi! I'm trying to update phyloseq using R version 3.4.4 and it doesn't work (it's not available). I've seen no problems in other computers with R version 3.4.3.

Could anyone help me with this?