Skip to content

Reassortment inference#3

Open
RicardoRH96 wants to merge 8 commits into
davidrasm:masterfrom
RicardoRH96:Dev-Ricardo
Open

Reassortment inference#3
RicardoRH96 wants to merge 8 commits into
davidrasm:masterfrom
RicardoRH96:Dev-Ricardo

Conversation

@RicardoRH96

Copy link
Copy Markdown
Contributor

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant