Reassortment inference#3
Open
RicardoRH96 wants to merge 8 commits into
Open
Conversation
Enhanced compatibility with taxon names by preserving underscores in ARGBuilder, supporting both original and underscore-to-space lookups in Reconciler, and improving quote handling and robust taxon name replacement in PlotTanglegrams. Updated .gitignore to exclude TestFiles and .pyc files.
Replaces deprecated pandas DataFrame.append() calls with pd.concat() throughout Dendro2TSConverter.py for compatibility with recent pandas versions. Adds a new script, scripts/run_arg_analysis.py, which demonstrates the full Espalier pipeline for ARG reconstruction and recombination rate estimation. Also adds a tree file sanitizer to RAxML.py to handle negative branch lengths, fixes a minor typo in SCARLikelihood.py, and updates .gitignore for new output files.
Enhanced ARGBuilder and Dendro2TSConverter to better handle time constraint violations and TreeSequence conversion failures. Added logic to save trees with recombination nodes even if TreeSequence creation fails, implemented robust time constraint fixing, and improved logging for debugging. Updated run_arg_analysis.py to save intermediate results and handle failures gracefully.
Introduces a new A/B testing framework under scripts/ab_testing/ for comparing original and modernized Dendro2TSConverter implementations. Modern converter uses tskit 0.6.0+ features, vectorized time constraint fixing, and edge compression. Updates Dendro2TSConverter.py for pandas 2.0 compatibility and performance improvements. Adds CHANGELOG.md documenting all major changes, and updates .gitignore to exclude test outputs and TreeSequence files. Minor improvements to run_arg_analysis.py directory setup.
Added scripts/subsample_by_date.py to subsample sequences by week and prune trees accordingly. Enhanced scripts/run_arg_analysis.py with flexible argument parsing, improved tree/sequence file matching, support for .aln files, and optional use of a modern TreeSequence converter. Updated .gitignore for new test directories and fixed author attribution in modern_converter.py. Improved robustness and error handling in MAF.py for edge cases in the MAF algorithm.
Introduce ARGNodeTypes for msprime/tskit compatibility and recombination summarization; add EmpiricalReassortmentSim to generate realistic reassortment datasets and sequence alignments. Modernize conversion pipeline: Dendro2TSConverter now uses centralized node flags, optional deep post/pre-order checks, and safer reindexing; ARGBuilder gains converter selection (legacy/modern/custom), richer diagnostics, improved recombination placement, and handling for different rate units. Add tests, scripts, and changelog/.gitignore updates to support benchmarking and new workflows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi David, this latest version should be up to date to the changes I had locally. I implemented the latest tskit versions and avoided deprecated dependencies. The tsconverter is improved and is much faster than before. I fixed some issues with calculating the reassortment rate and the SCAR likelihood, these were caused by boundary overlapping and zero probabilities that drove the likelihood to Inf and inflated the rates. The inferences now are realistic and I tested it on a H1N1 pdm2009 dataset (2009-2022), detecting 7 reassortment events or roughly 1.85 reassortment events per year, which is in line with the literature.
Hopefully, we'll do a more detailed test for reassortment mode in the near future.