Skip to content

Commit

Permalink
Add Aligner and pyopal.align to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Jan 17, 2024
1 parent a74e4df commit ffffb94
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 9 deletions.
9 changes: 9 additions & 0 deletions docs/api/aligner.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Aligner
=======

.. currentmodule:: pyopal


.. autoclass:: pyopal.Aligner
:special-members: __init__
:members:
34 changes: 27 additions & 7 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
API Reference
=============

.. currentmodule:: pyopal


Functions
---------

.. autofunction:: pyopal.align


Classes
-------

.. toctree::
:hidden:

alphabet <alphabet>
score_matrix <score_matrix>
database <database>
aligner <aligner>
result <result>


.. currentmodule:: pyopal


.. only:: html

Alphabet
--------
^^^^^^^^

.. autosummary::
:nosignatures:
Expand All @@ -25,7 +35,7 @@ API Reference


ScoreMatrix
-----------
^^^^^^^^^^^

.. autosummary::
:nosignatures:
Expand All @@ -34,16 +44,25 @@ API Reference


Database
--------
^^^^^^^^

.. autosummary::
:nosignatures:

pyopal.Database


Aligner
^^^^^^^

.. autosummary::
:nosignatures:

pyopal.Aligner


Results
-------
^^^^^^^

.. autosummary::
:nosignatures:
Expand All @@ -52,3 +71,4 @@ API Reference
pyopal.EndResult
pyopal.FullResult


11 changes: 9 additions & 2 deletions pyopal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def align(
Arguments:
query (`str` or byte-like object): The sequence to query the
database with.
database (`~pyopal.BaseDatabase`): The database sequences
to align the query to.
database (iterable of `str` or byte-like objects): The database
sequences to align the query to.
score_matrix (`~pyopal.ScoreMatrix`): The scoring matrix
to use for the alignment.
Expand Down Expand Up @@ -108,6 +108,13 @@ def align(
the main threads for aligning, otherwise spawns a
`multiprocessing.pool.ThreadPool`.
Yields:
`~pyopal.ScoreResult`: Results for the alignment of the query
to each target sequence in the database. The actual type depends
on the requested ``mode``: it will be `ScoreResult` for mode
``score``, `EndResult` for mode ``end`` and `FullResult` for
mode ``full``.
"""
# derive default parameters
if threads == 0:
Expand Down

0 comments on commit ffffb94

Please sign in to comment.