macroevolution / bamm

A program for multimodel inference on speciation and trait evolution
GNU General Public License v2.0
33 stars 10 forks source link

sampling fractions #54

Closed ptitle closed 10 years ago

ptitle commented 10 years ago

There is currently no documentation for the formatting of a species-specific sampling fractions file. Also, bamm error handling for incorrectly formatted sampling files could be better (Carlos, I'm sending you an example file).

redcurry commented 10 years ago

Could you test whether the error reporting is better now? Please let me know if you find and problems.

ptitle commented 10 years ago

Now I get errors while compiling bamm:

~/bamm $ make mkdir -p build && cd build && cmake ../ && make -j8 -- The CXX compiler identification is Clang 5.0.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /Users/pascaltitle/bamm/build Scanning dependencies of target bamm [ 11%] [ 17%] [ 17%] [ 29%] [ 29%] [ 35%] [ 41%] [ 47%] Building CXX object CMakeFiles/bamm.dir/src/BranchEvent.cpp.o Building CXX object CMakeFiles/bamm.dir/src/BranchHistory.cpp.o Building CXX object CMakeFiles/bamm.dir/src/Autotune.cpp.o Building CXX object CMakeFiles/bamm.dir/src/Log.cpp.o Building CXX object CMakeFiles/bamm.dir/src/FastSimulatePrior.cpp.o Building CXX object CMakeFiles/bamm.dir/src/MCMC.cpp.o Building CXX object CMakeFiles/bamm.dir/src/MbRandom.cpp.o Building CXX object CMakeFiles/bamm.dir/src/Model.cpp.o [ 52%] Building CXX object CMakeFiles/bamm.dir/src/Node.cpp.o [ 58%] Building CXX object CMakeFiles/bamm.dir/src/Settings.cpp.o [ 64%] Building CXX object CMakeFiles/bamm.dir/src/SettingsParameter.cpp.o [ 70%] Building CXX object CMakeFiles/bamm.dir/src/TraitBranchEvent.cpp.o [ 76%] Building CXX object CMakeFiles/bamm.dir/src/TraitBranchHistory.cpp.o [ 82%] Building CXX object CMakeFiles/bamm.dir/src/TraitMCMC.cpp.o [ 88%] Building CXX object CMakeFiles/bamm.dir/src/TraitModel.cpp.o [ 94%] Building CXX object CMakeFiles/bamm.dir/src/Tree.cpp.o [100%] Building CXX object CMakeFiles/bamm.dir/src/main.cpp.o /Users/pascaltitle/bamm/src/Tree.cpp:1334:18: error: no member named 'close' in 'std::1::basic_istringstream<char, std::__1::char_traits, std::1::allocator >' inStream.close();


1 error generated.
make[3]: **\* [CMakeFiles/bamm.dir/src/Tree.cpp.o] Error 1
make[3]: **\* Waiting for unfinished jobs....
make[2]: **\* [CMakeFiles/bamm.dir/all] Error 2
make[1]: **\* [all] Error 2
make: **\* [bamm] Error 2
redcurry commented 10 years ago

Oops, please try it again.

On Mon, Jan 20, 2014 at 5:39 PM, ptitle notifications@github.com wrote:

Now I get errors while compiling bamm:

~/bamm $ make mkdir -p build && cd build && cmake ../ && make -j8 -- The CXX compiler identification is Clang 5.0.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /Users/pascaltitle/bamm/build Scanning dependencies of target bamm [ 11%] [ 17%] [ 17%] [ 29%] [ 29%] [ 35%] [ 41%] [ 47%] Building CXX object CMakeFiles/bamm.dir/src/BranchEvent.cpp.o Building CXX object CMakeFiles/bamm.dir/src/BranchHistory.cpp.o Building CXX object CMakeFiles/bamm.dir/src/Autotune.cpp.o Building CXX object CMakeFiles/bamm.dir/src/Log.cpp.o Building CXX object CMakeFiles/bamm.dir/src/FastSimulatePrior.cpp.o Building CXX object CMakeFiles/bamm.dir/src/MCMC.cpp.o Building CXX object CMakeFiles/bamm.dir/src/MbRandom.cpp.o Building CXX object CMakeFiles/bamm.dir/src/Model.cpp.o [ 52%] Building CXX object CMakeFiles/bamm.dir/src/Node.cpp.o [ 58%] Building CXX object CMakeFiles/bamm.dir/src/Settings.cpp.o [ 64%] Building CXX object CMakeFiles/bamm.dir/src/SettingsParameter.cpp.o [ 70%] Building CXX object CMakeFiles/bamm.dir/src/TraitBranchEvent.cpp.o [ 76%] Building CXX object CMakeFiles/bamm.dir/src/TraitBranchHistory.cpp.o [ 82%] Building CXX object CMakeFiles/bamm.dir/src/TraitMCMC.cpp.o [ 88%] Building CXX object CMakeFiles/bamm.dir/src/TraitModel.cpp.o [ 94%] Building CXX object CMakeFiles/bamm.dir/src/Tree.cpp.o [100%] Building CXX object CMakeFiles/bamm.dir/src/main.cpp.o /Users/pascaltitle/bamm/src/Tree.cpp:1334:18: error: no member named 'close' in 'std::_1::basic_istringstream<char, std::_1::char_traits, std::__1::allocator >' inStream.close();

1 error generated.
make[3]: *** [CMakeFiles/bamm.dir/src/Tree.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/bamm.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [bamm] Error 2

—
Reply to this email directly or view it on GitHub<https://github.com/macroevolution/bamm/issues/54#issuecomment-32804135>
.
ptitle commented 10 years ago

Works great now!

ptitle commented 10 years ago

When using a properly formatted sampling probability file, I get the following output before bamm starts running MCMC. In other words, BAMM seems to be working, but there is this output:

Reading tree from file < squamSuperTree.tre >. Tree contains 4217 taxa. Reading sampling fractions from file << samplingFractions.txt >> Read a total of 4217 initial vals Set a total of < 4217 > tips nodes for Ei & Di Failed to set < 0 > internal node eTip values

What do these last two lines mean? Is this a problem?

redcurry commented 10 years ago

From looking at the code, it seems that this is normal behavior. The "Set a total of ..." line reports the number of tip nodes whose Ei and Di values were updated. Ei and Di deal with the extinction and diversification probabilities during the likelihood calculation. The "Failed to set ..." line reports the number of times the "eTip" value on each tip was < 0.0. I'm not sure what this means, but hopefully Dan will help us understand.

On Mon, Jan 20, 2014 at 6:00 PM, ptitle notifications@github.com wrote:

When using a properly formatted sampling probability file, I get the following output before bamm starts running MCMC. In other words, BAMM seems to be working, but there is this output:

Reading tree from file . Tree contains 4217 taxa. Reading sampling fractions from file <> Read a total of 4217 initial vals Set a total of < 4217 > tips nodes for Ei & Di Failed to set < 0 > internal node eTip values

What do these last two lines mean? Is this a problem?

— Reply to this email directly or view it on GitHubhttps://github.com/macroevolution/bamm/issues/54#issuecomment-32805574 .

drabosky commented 10 years ago

Carlos is correct about Di and Ei.

Last line means literally what it says: if it fails to initialize the sampling fraction for an internal node, there's a problem. It checks to see if all are set, and if so, there are 0 fails. If it encounters a node that isn't set correctly, it will tell you. So it is fine in this case.

On Jan 20, 2014, at 6:42 PM, Carlos Anderson wrote:

From looking at the code, it seems that this is normal behavior. The "Set a total of ..." line reports the number of tip nodes whose Ei and Di values were updated. Ei and Di deal with the extinction and diversification probabilities during the likelihood calculation. The "Failed to set ..." line reports the number of times the "eTip" value on each tip was < 0.0. I'm not sure what this means, but hopefully Dan will help us understand.

On Mon, Jan 20, 2014 at 6:00 PM, ptitle notifications@github.com wrote:

When using a properly formatted sampling probability file, I get the following output before bamm starts running MCMC. In other words, BAMM seems to be working, but there is this output:

Reading tree from file . Tree contains 4217 taxa. Reading sampling fractions from file <> Read a total of 4217 initial vals Set a total of < 4217 > tips nodes for Ei & Di Failed to set < 0 > internal node eTip values

What do these last two lines mean? Is this a problem?

— Reply to this email directly or view it on GitHubhttps://github.com/macroevolution/bamm/issues/54#issuecomment-32805574 .

— Reply to this email directly or view it on GitHub.

ptitle commented 10 years ago

Ok, that makes sense. Thanks!

ptitle commented 10 years ago

still issues with this: an undocumented error when species names are misspecified in the sampling file. I'm reopening this.

drabosky commented 10 years ago

hi pascal- what do you mean by misspecified? ~D

On Feb 2, 2014, at 10:24 AM, ptitle wrote:

still issues with this: an undocumented error when species names are misspecified in the sampling file. I'm reopening this.

— Reply to this email directly or view it on GitHub.

ptitle commented 10 years ago

If a species is left out of the sampling fractions file, or if a species is misspelled, an error is returned but bamm also crashes. I've sent an example file to Carlos.

drabosky commented 10 years ago

OK. The ideal way to handle this would be if BAMM gives an error message and prints out the problematic species.

On Feb 2, 2014, at 1:20 PM, ptitle wrote:

If a species is left out of the sampling fractions file, or if a species is misspelled, an error is returned but bamm also crashes. I've sent an example file to Carlos.

— Reply to this email directly or view it on GitHub.

redcurry commented 10 years ago

I did the best I could to provide meaningful error messages, but I don't know enough about how the sampling fractions work to cover all possible errors. It seems like an E_init value of -1 is problematic, so I provide a warning message when this happens. Later on, when a node doesn't have a clade name, an error is printed out and the programs is stopped.

On Sun, Feb 2, 2014 at 1:24 PM, Dan Rabosky notifications@github.comwrote:

OK. The ideal way to handle this would be if BAMM gives an error message and prints out the problematic species.

On Feb 2, 2014, at 1:20 PM, ptitle wrote:

If a species is left out of the sampling fractions file, or if a species is misspelled, an error is returned but bamm also crashes. I've sent an example file to Carlos.

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHubhttps://github.com/macroevolution/bamm/issues/54#issuecomment-33907673 .

drabosky commented 10 years ago

YEah, I don't think this needs to be exhaustive. The only 2 scenarios I was thinking should be checked are:

1) species in tree but not in sampling file (either missing or mispelled) or 2) species in sampling file but not in tree( missing or misspelled)

On Feb 2, 2014, at 2:36 PM, Carlos Anderson wrote:

I did the best I could to provide meaningful error messages, but I don't know enough about how the sampling fractions work to cover all possible errors. It seems like an E_init value of -1 is problematic, so I provide a warning message when this happens. Later on, when a node doesn't have a clade name, an error is printed out and the programs is stopped.

On Sun, Feb 2, 2014 at 1:24 PM, Dan Rabosky notifications@github.comwrote:

OK. The ideal way to handle this would be if BAMM gives an error message and prints out the problematic species.

On Feb 2, 2014, at 1:20 PM, ptitle wrote:

If a species is left out of the sampling fractions file, or if a species is misspelled, an error is returned but bamm also crashes. I've sent an example file to Carlos.

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHubhttps://github.com/macroevolution/bamm/issues/54#issuecomment-33907673 .

— Reply to this email directly or view it on GitHub.

redcurry commented 10 years ago

Done in commit 394e59aa741b8863b14efdbce30f8c11f994d3cf.