4ment / phylostan Goto Github PK
View Code? Open in Web Editor NEWPhylogenetic inference using Stan
License: GNU General Public License v3.0
Phylogenetic inference using Stan
License: GNU General Public License v3.0
I am using the following commands to generate the stan script, and run the stan script respectively:
phylostan build -s sample.stan -m JC69 -C 4 --estimate_rate --clock strict --coalescent constant
phylostan run -s sample.stan -m JC69 -C 4 --estimate_rate --clock strict --coalescent constant -i out.fasta -t sample_newick.newick -o sample -q meanfield
I would expect that there are branch lengths from the bottommost tree in sample.trees, as given below, but, there are none.
I've also tried looking in the file populated in the -o flag of the run command, labelled as VB samples below. I have fewer than 10 sequences, yet there are 10 nonzero branch lengths in the VB samples file, so I am not sure what to make of this. Is there another place that I can get inferred branch lengths? Or is there something I'm doing incorrectly?
Original data
VB samples
Script generated using build
Tree topology
sample.trees
According to the Stan documentation, defining a density using _log
(eg. real constant_coalescent_log(real[] heights, real popSize, int[,] map, real[] lowers){
) is deprecated. That definition should become
real constant_coalescent_lpdf(real[] heights | real popSize, int[,] map, real[] lowers){
instead.
To do topology comparisons, we want to extract ELBOs from stan runs.
In cmdstan these are saved to a 'diagnostic file' that can be specified on the command-line, but pystan & rstan do not provide an interface to specify this.
There are two possible paths -- either wrap cmdstan from the calling python script, or improve the pystan API so that the diagnostic file can be given.
The former appears complicated.
The latter also seemed initially complicated, but investigation into the pystan codebase highlights a path. In particular, code needs to be added to open the diagnostic file around this line:
https://github.com/stan-dev/pystan/blob/develop/pystan/stan_fit.hpp#L1030
and 'diagnostic_file' needs to be listed as a valid argument around this line:
https://github.com/stan-dev/pystan/blob/develop/pystan/model.py#L868
there may be a few other little edits required -- but looks pretty straightforward and possibly something that could be sent as a pull request to the standev guys.
Hello,
Congrats on the excellent work. More than issues, mine are questions on how to use the software:
Thanks a lot!
Lorenzo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.