Hello Nick;
I love the idea of your program BioGeoBEARS and was able to run the Psychotria example script without any problems. When trying to use my own dataset, however, I did have some issues with two polytomous notes in my phylogeny; ape's multi2di function can only resolve polytomies to 0-length branches... If there's a better way to get trees with neither polytomies nor zero-length branches, I'm sure many people would benefit from your mentioning it somewhere (based on reading other users' issues). On your input check function/page (http://127.0.0.1:11003/library/BioGeoBEARS/html/check_BioGeoBEARS_run.html) you link to ape's multi2di function but by itself this function will not resolve the issue. My workaround was to manually edit the .newick tree file and change those two randomly resolved branches' lengths from 0 to 1.0e-16 (approximately twice as small as the smallest real branch in my tree).
Now the analysis will proceed to log quite a few generations, before coughing up a new error (one I can't find any information on):
> check_BioGeoBEARS_run(BioGeoBEARS_run_object)
Read 5 items
Read 570 items
[1] TRUE
>
> runslow = TRUE
> resfn = "Cyprinid_DEC_M0_unconstrained_v1.Rdata"
> if (runslow)
+ {
+ res = bears_optim_run(BioGeoBEARS_run_object)
+ res
+
+ save(res, file=resfn)
+ resDEC = res
+ } else {
+ # Loads to "res"
+ load(resfn)
+ resDEC = res
+ }
Read 5 items
Read 570 items
d e a b x u j ysv ys y s v mx01 mx01j mx01y mx01s mx01v mx01r mf dp fdp
1 0.01 0.01 0 1 0 0 0 3 2 1 1 1 0 0 0 0 0 0.5 0.1 1 0
LnL
1 -674.655
Maximizing -- use negfn and neggr
d e a b x u j ysv ys y s v mx01 mx01j mx01y mx01s mx01v mx01r mf dp fdp
1 0.01 0.01 0 1 0 0 0 3 2 1 1 1 0 0 0 0 0 0.5 0.1 1 0
LnL
....(many lines not copied here)...
d e a b x u j ysv ys y s v mx01 mx01j mx01y mx01s mx01v mx01r mf dp fdp
1 5 0 0 1 0 0 0 3 2 1 1 1 0 0 0 0 0 0.5 0.1 1 0
LnL
1 -438.927
Error in params_into_BioGeoBEARS_model_object(BioGeoBEARS_model_object, :
replacement has length zero
In addition: Warning messages:
1: In optimx.setup(par, fn, gr, hess, lower, upper, method, itnmax, :
optimx: No match to available methods
2: In optimx.setup(par, fn, gr, hess, lower, upper, method, itnmax, :
Default method when bounds specified is L-BFGS-B to match optim()
3: In optim(par = par, fn = ufn, gr = ugr, lower = lower, upper = upper, :
method L-BFGS-B uses 'factr' (and 'pgtol') instead of 'reltol' and 'abstol'
My tree contains 285 taxa, and there are only three possible ancestral areas. Please let me know if you need any other information, and thanks so much for your time!
Sam Martin
University of Tulsa
Nick;I've tried my analysis again using a different tree without any polytomous nodes (to avoid any error I might have introduced by editing the lengths of arbitrarily resolved branches) and am getting the same error (Error in params_into_BioGeoBEARS_model_object"...BioGeoBEARS_model_object,: replacement has length zero..."). You suggested that I should 'modify the "min" and "max" for the free parameters,' but I can't seem to find any reference to this in the manual, other than mentions of the number of parameters in other models (e.g. 2 in Lagrange). Could you elaborate on this a little bit?
I'm also a bit confused with the length of the script; if I change the references for my input tree and data file in the R script, and also put my files in the same working directory as the tutorial files, the R script still seems to be calling references to other Psychotria files for some reason. Are there other necessary files for a BioGeoBEARS analysis besides the tree and geographic data file?
I'd be happy to provide my input files if that would help diagnose my issue, but I'm having difficulty troubleshooting the tutorial due to its lengths and somewhat sparse explanations (I am quite the R novice). Sorry for the trouble and thanks so much for your time!Sam Martin
--Sam Martin
PhD. CandidateDepartment of Biological Sciences
The University of Tulsa
Office: Oliphant Hall 311 N
Nick;Which tree file was that from? I might've sent you the wrong one by mistake; those are my outgroups from the phylogenetic analysis which I trimmed in R before trying to run BioGeoBEARS. I did do a taxon check with my trees and didn't get any errors. This is the correct tree. Sorry about that!On Wed, Feb 19, 2014 at 4:13 PM, Nick Matzke <mat...@nimbios.org> wrote:
Hmm, I get this line of results in the script, did you get this?check_BioGeoBEARS_run(BioGeoBEARS_run_object)======================
check_BioGeoBEARS_run(BioGeoBEARS_run_object)Read 5 itemsRead 570 items
FATAL ERROR in inputs: 15 tree tips are not in the geographic ranges file. These are:Blicca_bjoerkna, Catostomus_commersonii, Danio_rerio, Hypentelium_nigricans, Myxocyprinus_asiaticus, Notemigonus_crysoleucas, Pelecus_cultratus, Phoxinus_phoxinus, Rutilus_rutilus, Squaliobarbus_curriculus, Tanakia_himantegus, Tanakia_lanceolata, Tanichthys_albonubes, Tinca_tinca, Tribolodon_hakonensis======================