Comments (4)
I'm not sure what would be causing this. In order to help you solve this, I do need a reproducible example. At the moment, I do not know any of the following information: branch lengths, data type (genind/genlight), genetic distance used, tree algorithm used, version of ape, version of R. Without this information, the best I can do is guess.
There were only two releases after 2.8.6: a minor release that corrected documentation for CRAN and then https://github.com/grunwaldlab/poppr/releases/tag/v.2.9.0, which did not touch any of the code involved in the bootstrapping.
I know you've tried rolling back versions of poppr, ape, ade4, and adegenet, but have you tried using the {checkpoint} package to roll back ALL your packages to the last date you did the analysis? https://cran.r-project.org/web/packages/checkpoint/vignettes/checkpoint.html If you upgraded R, have you tried using an older version of R (notably, R 3.6 fixed a bug that biased the core randomization routines, which changed a lot of results)? I've found https://rstudio.cloud particularly helpful in those situations.
I will also note: I will probably be slow to reply (as you've probably noticed); I voluntarily manage poppr in my free time that is not otherwise dedicated to my own mental wellbeing.
from poppr.
Thanks for following up on this issue.
Here is the code we used.
library(poppr)
library(ape)
library(adegenet)
library(ggtree)
library(ggplot2)
library(gridExtra)
library(grid)
mydatSNP= read.table("./25_KASP_SNP.txt", header = TRUE, stringsAsFactors = FALSE)
marker_namesSNP <- colnames(mydatSNP)
marker_namesSNP<- marker_namesSNP[4:length(marker_namesSNP)]
accession_namesSNP <- mydatSNP[,1]
ploidySNP <- as.vector(mydatSNP$Ploidy)
allele_datSNP <- mydatSNP[,4:ncol(mydatSNP)]
mydat_genindSNP = df2genind(allele_datSNP, sep = ":", ind.names = accession_namesSNP, ploidy = ploidySNP, NA.char = "NA")
mytreeSNP = aboot(mydat_genindSNP, tree = "njs", sample = 200, cutoff = 75, distance = provesti.dist, quiet = FALSE, showtree = FALSE, missing = "ignore")
denSNP<-ggtree(mytreeSNP, size=.05)+ geom_tiplab(size=.5)+ ggplot2::xlim(NA,1)
I was not able to recover the original tree created by the "aboot" function, but I was able to recover the tree object before and after the updates.
The tree objects are able to be plotted with {treeio}.
tree<-treeio::read.jtree(file ="path/tree_obejct")
ggtree(tree, size=.05)+ geom_tiplab(size=.5)+ ggplot2::xlim(NA,1)
From the before and after tree objects, we can see the two trees are virtually the same except for the wild North American clade (top clade), which is the clade that is rooting abnormally. If you need the raw data, please let us know and we can send it to you. Thank you for all your help!
from poppr.
Summary
Looking at the code, I suspect that the change may have originated in the {ape} package. The layout of the tree represents that of the distance derived from the initial data and the distance function was last updated in 2015, which means that the culprit may be the ape::njs()
function.
Please try one of the solutions in #239 (comment) and raise an issue in https://github.com/emmanuelparadis/ape with information of the versions between the old tree and the new tree.
Again, the difficulty here is that there are so many unknowns about what your R environment looked like when you got the first result. You've been able to give me the version of {poppr} you were using, but the versions of {ape}, {adegenet}, and R are all important here. Even knowing the date that you last ran the analysis before you updated would help so that versions could be inferred. In the future, it's good practice to use version control and save the output of sessionInfo()
to give you a snapshot of what your R environment looked like.
Why it's not poppr
There are two poppr functions you use, neither of which have been updated recently.
aboot()
, which has not changed in the last three yearsprovesti.dist()
, which was last modified in 2015, for the 2.0.0 release
In the process of creating a bootstrapped tree, there are two components necessary:
- A distance function (you used
provesti.dist()
) - A tree function that uses the matrix output by the distance function to create the base tree (you used
ape::njs()
)
The aboot()
function is a wrapper around the process of creating a bootstrapped tree. It merely orchestrates the coordination between the distance function, the tree function, and ape::boot.phylo()
. There is one function that manipulates the original tree, and that is fix_negative_branch()
, which, again was last updated in 2015
from poppr.
I am closing this issue for now as it has been nearly 3 months since the last activity and there is insufficient evidence that points to a specific issue with poppr per se.
If you have more details that could help show where this discrepancy occurred, feel free to reopen this issue with that information.
from poppr.
Related Issues (20)
- Fix inefficient implementation of boot.bruvo HOT 3
- Interpretation of negative values in AMOVA HOT 3
- Error with reverse dependency checks for phangorn HOT 12
- genind2genalex() produces all zero genotypes with some SNP data. HOT 1
- bitwise.ia() degraded performance on windows HOT 1
- Error in bruvo.boot HOT 4
- CRAN test failure in R-devel on Debian
- Cannot re-level strata of a snpclone object HOT 1
- DUE 2021-09-21: Packages including omp.h after Rincludes.h
- Feature request: separation/removal of sf package requirement HOT 5
- Optional disabling of statistics in poppr table HOT 6
- threads not being respected and defaulting to 1 HOT 1
- PAIRWISE FST Calculation HOT 1
- Find All Duplicate MLGs HOT 4
- [read.genalex()]: Detect semicolon-separated files and throw error with correct command
- IS there a way to make a table indicated the multilocus genotypes for each isolate? where is that info stored? HOT 1
- Error Message from R using read.genalex HOT 1
- CRAN Errors to fix by 2023-03-22 HOT 2
- Preserve state of random number generator in .onAttach() HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poppr.