Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/pyopal/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,13 @@ cdef class Database(BaseDatabase):

Create a new database with the given sequences.

Example:
>>> # creating a database with a custom scoring matrix
>>> from scoring_matrices import ScoringMatrix
>>>
>>> alphabet = ScoringMatrix.from_name("VTML80").alphabet
>>> db = pyopal.Database(["ATGC", "TTCA"], alphabet=alphabet)

Copilot AI Jan 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example uses DNA sequences ("ATGC", "TTCA") with a protein scoring matrix (VTML80). VTML80 is designed for protein sequences, not DNA. Consider using protein sequences in the example to match the scoring matrix, such as sequences containing amino acid codes like "MVLIGWIFSLIFLLFLFGFLGLLLLLIIGIIFGFLGLLI" (from the issue example).

Suggested change
>>> db = pyopal.Database(["ATGC", "TTCA"], alphabet=alphabet)
>>> db = pyopal.Database(["MVLIGWIFSLIF", "LLFLFGFLGLLL"], alphabet=alphabet)

Copilot uses AI. Check for mistakes.
Comment on lines +493 to +494

Copilot AI Jan 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example demonstrates how to create a Database with a custom alphabet, but doesn't show how to use it with an Aligner to avoid the "database and score matrix have different alphabets" error mentioned in issue #9. Consider extending the example to show the complete workflow of creating both a Database and an Aligner with matching alphabets and performing alignment.

Suggested change
>>> alphabet = ScoringMatrix.from_name("VTML80").alphabet
>>> db = pyopal.Database(["ATGC", "TTCA"], alphabet=alphabet)
>>> scoring = ScoringMatrix.from_name("VTML80")
>>> alphabet = scoring.alphabet
>>> db = pyopal.Database(["ATGC", "TTCA"], alphabet=alphabet)
>>>
>>> # use the same scoring matrix/alphabet when creating the aligner
>>> aligner = pyopal.Aligner(scoring)
>>> result = aligner.align("ATGC", db)

Copilot uses AI. Check for mistakes.

Copilot AI Jan 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is trailing whitespace on this line. Please remove it to maintain code cleanliness.

Suggested change

Copilot uses AI. Check for mistakes.
"""
super().__init__(alphabet=alphabet)
# reset the collection if `__init__` is called more than once
Expand Down
Loading