amkozlov / raxml-ng

RAxML Next Generation: faster, easier-to-use and more flexible
GNU Affero General Public License v3.0
376 stars 62 forks source link

add flag to write out bootstrap msa from main run #125

Closed harmsm closed 2 years ago

harmsm commented 2 years ago

It would be extremely useful if raxml-ng could write out bootstrap multiple sequence alignments from tree building runs (e.g. --all). Although the --bsmsa mode allows a user to write out bootstrap alignments, doing subsequent tree building on these alignments loses the fast parallelization native to raxml-ng/libpll. I'd like to run --all and be able to get a stack of bootstrap trees and alignments I can then use for downstream analyses.

I implemented a new flag (--bs-write-msa) that causes raxml-ng to call the code block under control of Command::bsmsa, thus writing out the bootstrap replicate alignments after tree creation. The new flag sets a new write_bs_msa boolean I added to the main opts data structure. I added a doc string to the command line argument and an error check to make sure the flag is only invoked if bootstrap replicates are being generated.

Not sure if there I should merge into dev or master. (It looked like dev was stale). Let me know if I should change PR branches.

Thanks for great package and for considering PR.

harmsm commented 2 years ago

After initial PR I realized this requires one more tweak so raxml-ng only writes out the number of bootstrap alignments it used. If we set the maximum number of replicates to 1,000 but it converges after 250, the code now writes out 250 alignments, not 1,000.

amkozlov commented 2 years ago

Thanks Mike, I just merged it into master manually with minor changes!