9559 Commits

Author SHA1 Message Date
4c8696aa82 Remove unused or read only globals (flake8 F824) 2025-10-15 14:49:15 +01:00
f7d7ded086 make spheres nicer on first start 2025-10-10 13:20:13 +01:00
682eb13373 Add OpenSCAD code to enable multimaterial printer output 2025-10-10 13:20:13 +01:00
f2004e04da added test and docstring for #5053 2025-10-01 19:19:11 +01:00
5d48cf583f SnapGene: Filter out partial binding sites.
The "primers" packet within a SnapGene file may contain, for every
primers, additional partial binding sites in addition to the full
binding site.

We use the minimum values described in the `HybridizationParams` element
to filter out any binding site that:

* has a matching length shorter than the minimum accepted matching
  length, or
* has a melting temperature lower than the minimum accepted melting
  temperature.

closes #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
20ad9bea6d Handle possible non-existent attributes in clusterbuster.py (#5074)
* Handle possible non-existent attrs in clusterbuster.py

In commit bc0d58b, support was added for gap and weight paramters, but
since these two attributes are not guaranteed to exist by parse and read
methods, an AttributeError could be raised for non-clusterbuster motifs.

An attribute check was added to allow motifs lacking gap and weight to
be formatted properly.

Co-authored-by: Ee Shan Liau Shirley <69098782+shirleyliau@users.noreply.github.com>

* Add names to CONTRIB.rst

* Use try-except to handle missing attributes

Co-authored-by: Ee Shan Liau Shirley <69098782+shirleyliau@users.noreply.github.com>

* Avoid CB output when an attribute is None

In the previous commit, the skipping mechanism was switched to
try-except blocks, and the cases when an attribute is None are
no longer dealt with. This patch re-introduced `if m.weight`
to prevent empty export fields in such cases.

Co-authored-by: Ee Shan Liau Shirley <69098782+shirleyliau@users.noreply.github.com>

---------

Co-authored-by: Ee Shan Liau Shirley <69098782+shirleyliau@users.noreply.github.com>
2025-09-27 16:03:53 +09:00
5b2a50a9ce removing deprecated code 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
0c4fae3d61 Fix F824 in Bio.PDB.vectors (#5067)
Remove unnecessary global statements
2025-09-20 19:11:58 +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
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
4ceee03dbf typo (#5040)
Co-authored-by: Michiel de Hoon <michiel.dehoon@riken.jp>
2025-08-12 16:06:49 +09:00
ff4bed01f5 declare local functions as static (#5037)
Co-authored-by: Michiel Jan Laurens de Hoon <mdehoon@Michiels-MacBook-Air.local>
2025-08-12 00:33:52 +09:00
35bdb3f576 Update YN00 docstrings 2025-07-30 16:28:38 +01:00
053bdc8ed2 Uppercase PAML software names except in run methods 2025-07-30 16:28:38 +01:00
f6e56e5061 Update long docstrings in PAML class methods 2025-07-30 16:28:38 +01:00
aceebefbff Set PAML class names in CamelCase 2025-07-30 16:28:38 +01:00
392ede471d Fixed flake8 rule D209 violations
D209 Multi-line docstring closing quotes should be on a separate line
2025-07-30 16:28:38 +01:00
727b5055ff Updated docstrings to use consistent capitalization. paml >> PAML etc. 2025-07-30 16:28:38 +01:00
95f8119ad9 Updated docstrings to include the output and mention any validation that occurs. Also, changed docstring so they have consistent capitalization. Baseml >> BASEML etc 2025-07-30 16:28:38 +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
feeb7283cf Style change only (#5019)
Co-authored-by: Michiel Jan Laurens de Hoon <mdehoon@Michiels-MacBook-Air.local>
2025-06-21 10:16:04 +09:00
b19a21029a follow recommended style for PyTypeObject (#5014)
* follow recommended style for PyTypeObject

* update

---------

Co-authored-by: Michiel Jan Laurens de Hoon <mdehoon@Michiels-MacBook-Air.local>
2025-06-21 01:13:57 +09: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
91740a7788 Remove unused f-string 2025-05-29 10:00:50 +01:00
2cb91f3c73 linting 2025-05-29 10:00:50 +01:00
28f18b2d09 improve coverage of tests 2025-05-29 10:00:50 +01:00
377635ed52 remove urlerror and httperror 2025-05-29 10:00:50 +01:00
41fa46f50e format with black 2025-05-29 10:00:50 +01:00
49a3981d75 if error is caught should return None instead of final_file 2025-05-29 10:00:50 +01:00
a4b3afbe4a fixed PDBlist.retrieve_pdb_file(); improved error handling, should not show misleading message 2025-05-29 10:00:50 +01:00
10bb678638 fix(SeqFeature): add missing decorator to Location.fromstring factory method
The fromstring method of the abstract Location class is missing a method decorator, which causes the first argument to be interpreted as self.
This doesn't lead to any problems when calling it from the class, but confuses tooling.

Note that the commit that added this (908ee298) speaks of a "fromstring class method", so taking this method in the instance context should be fine.

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
32b9648617 use PyOS_double_to_string to prevent locale-specific behavior (#4982)
* use PyOS_double_to_string to prevent locale-specific behavior

* update

---------
2025-03-26 17:58:08 +09:00
96a734ff9a Remove reference to the fmt override in the documentation 2025-03-22 06:59:36 +01:00
70f553f9c6 Fixed issues in docstring introduced in e477fd8 2025-03-22 06:59:36 +01:00
11bdb70bac Remove reference to the fmt override in the documentation 2025-03-22 06:59:36 +01:00
2db4d2c4e7 Fixed stype
Co-authored-by: Wibowo Arindrarto <343998+bow@users.noreply.github.com>
2025-03-22 06:59:36 +01:00
0304aa8162 Removed support for user-provided --fmt 2025-03-22 06:59:36 +01:00
511648f992 Improved behaviour consistency for the tabular format handling 2025-03-22 06:59:36 +01:00
8663d68cc8 Update documentation 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
1b186f2670 Use lambda function for inclusion conversion 2025-03-22 06:59:36 +01:00