Repository navigation
docs: Database with custom scoring example
#10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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) | ||||||||||||||||||||
|
Comment on lines
+493
to
+494
|
||||||||||||||||||||
| >>> 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
AI
Jan 5, 2026
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).