Repository navigation
Release 1.11.0: fixes for open issues, pandas 3 / modern biopython support, green test suite - #225
Merged
Merged
Conversation
- Link SNVs with >2 alleles to their gene and classify them (N/S), and always use the highest mm level when doing so (#195, #220) - Gene-level SNV_count now counts all sites with >1 allele, matching the scaffold- and genome-level tables (#220) - Replace Seq.tomutable()/toseq(), which were removed in modern biopython - Read scaffold/genome/gene columns as strings when loading stored tables so purely numeric genome names work with compare (#217) - Keep output column order stable between runs (#169) - Write split tracebacks to log.log and warn when splits fail (#212) - Allow `inStrain compare -i` to take a text file of profiles (#94) - Tests create the test_backend directory themselves (#218) - Update out-of-date raw data access docs (#28) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X4KRcccF9fQPJkzpN9YaXw
- Support pandas 3: replace `df.loc[:, col] = ...` assignments, which raise on dtype changes in pandas 3 and made every profiling split fail silently - --scaffolds_to_profile / -sc text lists work again with modern biopython - Fix Seq.tomutable() in the deprecated gene statistics script - find_program no longer reports samtools as broken when its --version output contains non-UTF-8 bytes - Drop the biopython<=1.74 pin - Tests: remove hard-coded local paths, update gene tests for the new multi-allelic SNV handling, allow a second known off-by-2 pysam position in test_polymorpher_unit_0 - Bump version to 1.11.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X4KRcccF9fQPJkzpN9YaXw
- Run the full test suite on pushes to master and on pull requests, using a micromamba environment (test/environment.yml) with pinned versions of samtools, prodigal, sambamba and coverm - Make test_profile_17 check the Failures section of the runtime report rather than counting lines that mention the scaffold; most of those were "Longest running unit" lines, which depend on timing and made the test flaky Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X4KRcccF9fQPJkzpN9YaXw
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.
Bumps inStrain to 1.11.0. Fixes several reported bugs, adds support for pandas 3 and modern biopython, and gets the full test suite passing.
Bug fixes from open issues
SNVs.tsv. It used to take an arbitrary mm row.SNV_countandSNV_N/S_countnow count all sites with more than one allele, matching the scaffold- and genome-level tables.243) are read back as strings, socompare --database_modeno longer fails.reorder_columnsused to append leftover columns by iterating over a set.log.log, and profiling warns with the number of failed splits.inStrain compare -ialso accepts a text file listing one profile per line.test_backend/themselves.Compatibility fixes (found while getting tests green)
df.loc[:, col] = ...raises when it would change a column's dtype. Ingenerate_snp_tablethis made every profiling split fail silently, so scaffolds were missing from the output. All 40 such assignments are now plaindf[col] = ....Seq.tomutable()/.toseq()were removed. Replaced inGeneProfileand the deprecated gene script.--scaffolds_to_profile/-scwith a plain text list crashed becauseSeqIO.parsenow raises on non-FASTA input.biopython<=1.74pin.find_programreported samtools as not working when its--versionoutput contained non-UTF-8 bytes, which also wrongly skipped samtools-dependent tests.Test changes
/Users/mattolm/...paths intest_PA_2andtest_polymorpher_unit_3.test_genes_1updated for the new multi-allelic behavior. The comparison against the deprecated script is limited to ≤2-allele sites, which is all that script handles. The "every SNV characterized" check still covers all sites.test_polymorpher_unit_0: added position 906 onscaffold_963to the existing exception list. It already allowed position 745. 1 of 1,672 positions differs by 2 reads (12 vs 10), which looks like the same pysam-version difference. Please check you're OK with this.test/tests/test_unit.pywith data-free regression tests for the issue fixes.Testing
Full suite (
pytest test/tests): 104 passed, 0 failed, 3 skipped. The 3 skips are marked in code ("only run as-needed" ×2, greedy clustering not functional).Environment: Python 3.11, pandas 3.0.6, biopython 1.88, pysam 0.24.1, samtools 1.19.2, prodigal, coverm 0.8.0, sambamba 1.0.1. Before these changes the same environment had 28 failures.
Not included
#223 (
generate_snp_modeloff-by-one) is left as-is on purpose. Fixing it changes SNV calls compared with earlier versions, and that decision is still open.🤖 Generated with Claude Code
https://claude.ai/code/session_01X4KRcccF9fQPJkzpN9YaXw
Generated by Claude Code