cfe-lab / cfe-lab/MiCall

Strange alignment result

Open
#331 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
21
Forks
11
Avg merge
12h 5m
Merged PRs (30d)
24

Description

While trying to write a test for issue #299, I discovered strange behaviour in the Gotoh alignment algorithm that we're using. Here's a small script to reproduce the problem:

import gotoh

gap_open = 40
gap_extend = 10
use_terminal_gap_penalty = 1
reference = 'EFACDE'
query =     'SFACDS'
aligned_ref, aligned_query, score = gotoh.align_it_aa(
    reference,
    query,
    gap_open,
    gap_extend,
    use_terminal_gap_penalty)
print(aligned_ref)
print(aligned_query)

The results are:

-EFACDE
S-FACDS

If I replace the E's with H's, I get this:

HFACDH
SFACDS

I understand that some substitutions are more likely than others, but why would it behave differently at the start and the end? If gap_open + gap_extend <= 10, then it opens a gap at both ends for E, and if it's less than or equal to 5, then it opens a gap for H.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied reproduction script and inspect the implementation behind gotoh.align_it_aa, focusing on terminal gap handling and the substitution scoring that produces different results for E and H. Compare the alignment and score in both cases; done means the asymmetric behavior is explained and, if incorrect, corrected with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.