* Align: add optional substitution matrix/aligner argument to format()
- Extended Alignment.format() to accept an optional argument:
* substitution matrix (e.g. from Bio.Align.substitution_matrices)
* PairwiseAligner object (uses its substitution matrix)
- Preserves compatibility with existing writer-specific arguments
(e.g. "vulgar" for exonerate, metadata for mauve).
- Internal logic now distinguishes between substitution matrices
(used in pretty-printing) and writer arguments (passed to
AlignmentWriter).
- All alignment format tests pass (58/58).
* Align: add substitution matrix argument to helper format functions
- Updated _format_pretty, _format_unicode, _format_generalized
to accept optional substitution matrix argument.
- Passed matrix from Alignment.format() into these helpers.
- Updated docstrings accordingly.
- All alignment format tests pass (58/58).
* Align.format: support substitution matrices in helper functions; add tests
- Updated helper functions in Align.format (generalized, pretty, html, etc.)
to correctly handle substitution_matrix arguments.
- Added new test file `Tests/test_format_matrix.py` to cover:
* identity matches (|), positive mismatches (:), negative mismatches (.),
and gaps (-) using substitution matrices.
* verified behavior with both NUC.4.4 and a custom BLASTN-like matrix.
- Confirmed tests pass with pytest.
Resolves#5043
* Add Rachel Stern to contributors list and NEWS (first contribution)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix style issues in test_format_matrix and Align -__init__
* Rename test_format_matrix.py to test_format_matrix_unittest.py for AppVeyor test discovery
* Move format matrix test to unittest style
* Refactor scoring argument handling in counts() and format()
- Renamed the optional argument in counts() from `argument` to `scoring` for
clarity and consistency.
- Updated format() to accept the `scoring` parameter via **kwargs instead of
a dedicated argument.
- Removed the explicit writer argument from format(), since it is no longer
needed with kwargs-based handling.
- Adjusted the docstring of format() accordingly to reflect the new usage.
* Update test_format_matrix_unittest.py:
- Use explicit assertEqual for pattern strings instead of only assertIn/NotIn, following reviewer feedback.
- Simplify alignment selection by indexing [0] instead of next(iter(...)).
* Remove _pattern_from_pretty, assert full alignment format instead
- Replaced usage of `_pattern_from_pretty` helper with direct comparison
of `aln.format("", scoring=M)` output in all relevant tests.
- This makes the tests simpler and closer to the actual API usage.
- Removed unused `_pattern_from_pretty` function.
* docs: document new `scoring` argument in Alignment.format tutorial
- Added explanation of the optional `scoring` argument to
`Alignment.format()` in Doc/Tutorial/chapter_align.rst.
- Included example using PairwiseAligner and a substitution matrix
(NUC.4.4) to illustrate how the pattern line reflects scores.
- Clarifies how symbols (|, :, ., -) correspond to matches,
positive/negative mismatches, and gaps.
* docs: add cont-doctest and update scoring example with '.' mismatch
* docs: fix scoring example with gap penalties to show ':' and '.' in doctest
* docs: add <BLANKLINE> to doctest output in scoring example
* doc: add 8 in the middle line of the format
* doc: Arranging the print format
* Rearrange the print format
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: mdehoon <mjldehoon@yahoo.com>
The PDF instructions need reviewing - I got stuck during
the Biopython 1.85 release but didn't have access to a
Linux machine with admin rights to try the approach
documented here.
* scaffold FOGSAA and add setter for PairwiseAligner.algorithm
* add first version of FOGSAA scoring
* add restrictions to algorithm setter and support matrix scoring in FOGSAA
* add test for running fogsaa with matrix scoring
* Remove algorithm setter in lieu of FOGSAA_Mode, scaffold PathGenerator for FOGSAA
* Add basic support for FOGSAA alignment
* Add FOGSAA alignment with matrix scoring
* Add more restrictions to FOGSAA parameters.
These restrictions come from the queue data structure used not from the
algorithm itself. Changing the priority queue implementation may ease
these restrictions at a possible loss to performance.
* Change FOGSAA priority queue implementation to a max heap
This allows for the queue sort doubles, which in turn removes the
requirement of integer scores in FOGSAA.
* Allocate memory once, fix affine gaps, remove threshold
* more fixes
* Add error checking, debugging code, and fix lower bounds
* add support for different affine gaps on edges
* remove debug printfs, warn on invalid parameters
* fix floating point comparison bugs
* only copy cells of optimal path in fogsaa align
* stop using different macros for fogsaa cell types
* fix fogsaa docstrings, iterator, and reset algorithm on set_mode
* mention fogsaa in Tutorial/chapter_pairwise.rst
* fix fogsaa documentation in Doc/Tutorial/chapter_pairwise.rst
* fix typo
New release blacken-docs v1.18.0 tries to parse this
markdown file, which had a lot of invalid pycon lines
(mostly missing ... on multi-line statements).
This also flagged some invalid indentation in the
rather long class examples, and some Python 2 style
print statements.
We should perhaps review and/or delete this file?
* Add support for reading PFM from Cys2His2 Zinc Finger Proteins PWM Predictor.
Add support for reading PFM from Cys2His2 Zinc Finger Proteins PWM Predictor
(http://zf.princeton.edu/logoMain.php).
* Capitilize motif subtypes for "pfm-four-columns" and "pfm-four-rows" correctly.
Capitilize motif subtypes for "pfm-four-columns" and "pfm-four-rows" correctly.
* Set empty motif name string when no motif name is found when reading PFM files in "pfm-four-columns" format.
Set empty motif name string when no motif name is found when
reading PFM files in "pfm-four-columns" format.
* Add reading PFM in "pfm-four-columns" and "pfm-four-rows" to motifs tutorial.
Add reading PFM in "pfm-four-columns" and "pfm-four-rows" to motifs tutorial.
Closes#4571, seems can't use |version| substitution
within an RST URL. Might be able to do these with RST
links instead now the Tutorial and API docs are all in
one combined Sphinx document.
Also replaced "built in" with "built-in".
Rather than dealing with ELLIPSIS settings and
6.003321... vs np.float64(6.0033218093539675)
explicitly print with set number of decimal places.
Addresses in part #4676
Avoid printing 1.0 vs np.float64(1.0) by comparing
to one, and use Python sum function over the numpy
method/function to avoid getting np.True_ over True.
Not ideal as this is slightly unnatural style, but
it makes the test work on numpy 1 or 2.
Addresses in part issue #4676
Reverted unwanted changes (mostly arrays in tests, but also
some whitespace in doctests).
Remaining changes are standardising spacing between module
docstring and imports, and lower-case \x<hex> in strings.