dict_to_amino_acid_matrix sizes by len(d), so blosum62_matrix is 25×25 with zero padding
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- numpy, python
- Domain
- bioinformatics
Research direction
Start from dict_to_amino_acid_matrix in pepdata, where np.zeros is sized by len(d) while the fill loop iterates over alphabet. Check the shapes of blosum62_matrix and blosum30_matrix against blosum50_matrix and pmbec_matrix to confirm the padding. Change the allocation to len(alphabet), then verify the shapes and that the filled values are unchanged. Note that this changes two public array shapes, so a release note is needed.
Written by the indexing model from the issue text.
Description
def dict_to_amino_acid_matrix(d, alphabet=canonical_amino_acids):
n_aa = len(d)
result_matrix = np.zeros((n_aa, n_aa), dtype="float32")
for i, aa_row in enumerate(alphabet):
...
The function sizes the matrix by the number of rows in d, but fills only len(alphabet) rows and columns (20 by default). BLOSUM62 has 25 rows (the 20 canonical residues plus B, J, Z, X and *) and BLOSUM30 has 24. On master a5dffe3:
| array | shape | filled |
|---|---|---|
blosum62_matrix |
(25, 25) | rows/cols 20-24 are all 0 |
blosum30_matrix |
(24, 24) | rows/cols 20-23 are all 0 |
blosum50_matrix |
(20, 20) | all |
pmbec_matrix |
(20, 20) | all |
The padding doesn't correspond to any residue, and 0 is a real BLOSUM score, so it reads like data. The shapes also differ between matrices that callers would expect to be interchangeable, for example as embeddings indexed by letter_to_index.
Fix. Size the matrix by len(alphabet). That changes the shape of two public arrays, so it is a behavior change and needs a release note. pirl-unc/weirdo has the same helper in weirdo/amino_acid_alphabet.py.
- Dominant language
- Python
- Stars
- 58
- Forks
- 16
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openvax/pepdata
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
PeptideVectorizer fails with the default normalize_row=True on current scikit-learnPossibly taken @iskandr claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Similar issues
-
flow-measurement measurement
Difficulty 1/5 Under an hour Newbie friendliness 76/100
MichaelYcJo/SpecSeal#1366 ·
-
bug c/evals c/ui size:L
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Arize-ai/phoenix#17633 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TransformerLensOrg/TransformerLens#1980 ·
Maintainers usually reply within 1 day
-
Module: Solr Needs: Lead Needs: Triage Theme: Search Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
internetarchive/openlibrary#14284 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 69/100
SpaceCowMedia/commander-spellbook-backend#1292 · 1 comment ·
Maintainers usually reply within 1 day