5075 Commits

Author SHA1 Message Date
4c8696aa82 Remove unused or read only globals (flake8 F824) 2025-10-15 14:49:15 +01:00
24b9dba21a B017 - avoid blind exception 2025-10-07 10:02:50 +01:00
f2004e04da added test and docstring for #5053 2025-10-01 19:19:11 +01:00
e85f1958ee Make PDB.Chain.__getitem__ more lenient for indexing with int-like values (#5018)
Includes residue indexing test case for `np.int64` condition
2025-09-29 09:50:29 +01:00
5a31c3ef74 removing tests for removed modules 2025-09-21 10:07:53 +01:00
593114d868 deprecating the SummaryInfo class in Bio.Align.AlignInfo (#5069) 2025-09-21 10:06:00 +01:00
ac0216ab12 Delete Tests/BWA/ test data.
This directory stored data files for the test_BWA_tool.py.  The latter
test was removed following Bio.Application removal in issue #4906.  No
other files in the source tree look to be referring to these data,
therefore it should be safe to remove the whole set.

Closes: #5064
Signed-Off-By: Étienne Mollier <emollier@debian.org>
2025-09-20 07:42:10 +01:00
be97b2d4e7 Aligner default arguments (#5029)
* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* doctests_fixed

* update

* update

* documentation

* add warning

* add a note to the DEPRECATED file

* adding a NEWS entry

* remove stray comments

---------

Co-authored-by: Michiel de Hoon <mdehoon@lacg01.local>
Co-authored-by: Michiel de Hoon <mdehoon@tkx380.genome.gsc.riken.jp>
Co-authored-by: Michiel Jan Laurens de Hoon <mdehoon@Michiels-MacBook-Air.local>
Co-authored-by: Michiel de Hoon <mdehoon@tkx288.genome.gsc.riken.jp>
2025-09-16 22:46:35 +09:00
6e43775844 documentation tweaks (#5055)
* documentation tweaks

* update

---------

Co-authored-by: Michiel de Hoon <mdehoon@tkx288.genome.gsc.riken.jp>
2025-09-04 16:23:53 +09:00
ad9456f3bb Align: add substitution matrix support to Alignment.format() (#5049)
* 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>
2025-09-04 14:14:55 +09:00
d3de878863 Fixes formatting for extremely high B-factor values in PDB files (#5047) 2025-09-03 07:05:07 -07:00
d1c4b3d0e2 pairwisealigner pickle fix (#5041)
* pairwisealigner pickling fix

* pr feedback updates

* pr updates - use almost equal on epsilon
2025-08-19 09:18:30 +09:00
6851cd8d03 Drop comment 2025-07-24 18:13:30 +01:00
b027825127 Prevent side-effect in SeqRecord._per_letter_annotations
Fixes #5015
2025-07-24 18:13:30 +01:00
66ad0a062e Extend the .counts method of an Alignment (#5011)
* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* updat

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* halfway finished

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* pdate

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* replace precompiler #defines by inline functions

* update

* update

* add tests

* update

* update

* update

* update

* update

* update

* update

* update

* documentation

* update

* avoid stpcpy

* pointer printing

* compiler warning

* testing without codonalign

* testing without codonalign and pairwisealigner

* compiler warning

* adding codonalign and pairwisealigner back in

* remove inline from check_indices

* add inline to check_indices

* update

* add test line 12287 test_pairwise_aligner.py

* update

* update

* update

* update

* change dtype from int32 to "i"

* all done

* testing

* testing

* testing

* testing

* done

* done

* fix how pointers are printed on Windows

* update

* update

* update

* update

* fix id printing on pypy

* style change only

* Use Py_uintptr_t instead of uintptr_t

* fix memory leak

* remove double semicolon

* check if GitHub actions are now pickup up Python version 3.13.5 without hardcoding it

---------

Co-authored-by: Michiel Jan Laurens de Hoon <mdehoon@Michiels-MacBook-Air.local>
Co-authored-by: Michiel de Hoon <mdehoon@tkx288.genome.gsc.riken.jp>
Co-authored-by: Michiel de Hoon <michiel.dehoon@riken.jp>
2025-07-11 14:40:07 +09:00
116d92b0fe Drop trailing whitespace in some docstrings
Used black 25.1.0 which does this in docstrings too which is bad.
2025-07-11 10:26:05 +09:00
ed51b11450 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-07-11 10:26:05 +09:00
0969cc24fd Add automatic alignment generation to StructureAlignment 2025-07-03 09:33:06 -07:00
0b41684f14 Fix QCPSuperimposer bug (#5005)
Addresses a bug in the code that caused the Newton-Raphson optimization to quit earlier than it should, resulting in poorer alignments.
2025-06-09 14:19:55 -07:00
1172869397 Uniprotxml parse ligand tag (#5001)
* enable handling of <ligand> tags in UniProt XML files

* test parsing of <ligand> in UniProt XML

* add name to CONTRIB.rst

* format with black

* enable capture of multiple ligands from uniprot xml file. update tests accordingly

* add mock UniProt XML file with multiple ligand tags per feature

* test for correct len of all ligands list and multiple ligands per feature
2025-05-31 00:09:26 +01:00
28f18b2d09 improve coverage of tests 2025-05-29 10:00:50 +01:00
6d03848836 change url in test 2025-05-29 10:00:50 +01:00
ebcc56b389 add tests for bad url and http error 2025-05-29 10:00:50 +01:00
137dca3eb9 test: add test to check if Location.fromstring is static
requested by peterjc

I agree to my contributions being dual licensed under the BSD 3-Clause and Biopython License
Signed-off-by: Fynn Freyer <fynn.freyer@googlemail.com>
2025-03-28 14:47:27 +00:00
0304aa8162 Removed support for user-provided --fmt 2025-03-22 06:59:36 +01:00
4f39ac9c3b Changed overlapping hit fields (tabular fmt 2) to numeric type 2025-03-22 06:59:36 +01:00
38f0fed34a Infer the tabular format from the header 2025-03-22 06:59:36 +01:00
86decf2df1 Fixed docstring 2025-03-22 06:59:36 +01:00
1cec609d6c Added testing for notextw plain text output 2025-03-22 06:59:36 +01:00
2e45868a64 Standardized assertion format 2025-03-22 06:59:36 +01:00
ecc4136d22 Moved model information to the HSP in the tabular format parser 2025-03-22 06:59:36 +01:00
164fdf0163 Fixed issues in text format testing 2025-03-22 06:59:36 +01:00
7f4b9eaf44 Fixed formatting 2025-03-22 06:59:36 +01:00
b7f1782578 Tests names standardization 2025-03-22 06:59:36 +01:00
35a3324e21 Added infernal text indexer 2025-03-22 06:59:36 +01:00
9757867b6b Corrected testing function name 2025-03-22 06:59:36 +01:00
45087bb9af Better fmt support in tabular format indexer 2025-03-22 06:59:36 +01:00
2eaeb318fc Enhanced spacing 2025-03-22 06:59:36 +01:00
42ed0d1a4e Added support for tabular output format 3 2025-03-22 06:59:36 +01:00
343b33473b Changed tests files names 2025-03-22 06:59:36 +01:00
361870aa9d Added tabular format indexer and related tests 2025-03-22 06:59:36 +01:00
10e37cecc3 Removed dependency on the header to guess tabular format in preparation for the Indexer 2025-03-22 06:59:36 +01:00
bd913800e2 Added tests for cmscan text output parsing 2025-03-22 06:59:36 +01:00
262f82f53b Fixed an issue with cmscan tabular file processing 2025-03-22 06:59:36 +01:00
86f68f9ad2 Updated counter in cmsearch tabular tests to match cmsearch text output method 2025-03-22 06:59:36 +01:00
2f2fef1b1d Added support for cmsearch hits with non-consecutive hits 2025-03-22 06:59:36 +01:00
1cad982f2d Added tests for cmsearch output with multiple queries 2025-03-22 06:59:36 +01:00
f0f6694f96 Added support for HMM-only searches 2025-03-22 06:59:36 +01:00
213fd253b0 Added Infernal text output parser and tests 2025-03-22 06:59:36 +01:00
c475ee96ee Added Infernal tabular format parser and tests 2025-03-22 06:59:36 +01:00