Skip to content
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

Choosing the Correct Adjacent Exon along Exon Boundaries #361

Open
jarbesfeld opened this issue Aug 20, 2024 · 3 comments
Open

Choosing the Correct Adjacent Exon along Exon Boundaries #361

jarbesfeld opened this issue Aug 20, 2024 · 3 comments
Labels
bug Something isn't working priority:medium Medium priority

Comments

@jarbesfeld
Copy link
Contributor

Describe the bug

The get_adjacent_exon method needs to be updated to consider edge cases where start or end occurs along the boundaries of the exon.

Steps to reproduce

N/A

Expected behavior

If a segment starts at alt_end_ion the positive strand, the next exon should be selected.
If a segment ends at alt_end_ion the positive strand, the current exon should be selected.
If a segment ends at alt_start_i on exon 1, the following error message should be returned:
"Invalid input. The segment cannot end at the first position on the first exon"
If a segment starts at alt_end_i on the last exon, the following error message should be returned:
"Invalid input. The segment cannot start at the end position on the last exon"

If a segment ends at alt_start_i on the negative strand, the current exon should be selected.
If a segment starts at alt_start_i on the negative strand, the next exon should be selected.
If a segment ends at alt_end_i on exon 1, the following error message should be returned:
"Invalid input. The segment cannot end at the first position on the first exon"
If a segment starts at alt_start_i on the last exon, the following error message should be returned:
"Invalid input. The segment cannot start at the end position on the last exon"

Current behavior

The current logic does not consider these edge cases

Possible reason(s)

N/A

Suggested fix

See expected behavior

Branch, commit, and/or version

issue-224-new-structure

Screenshots

N/A

Environment details

M1 Mac

Additional details

No response

Contribution

None

@jarbesfeld jarbesfeld added the bug Something isn't working label Aug 20, 2024
@korikuzma
Copy link
Member

Current implementation returns first exon with offset when passed:

r = await mapper.genomic_to_tx_segment(
  genomic_ac="NC_000001.11",
  seg_end_genomic=154192100,
  transcript="NM_152263.4",
)

However, it should return the above error message since the output does not make biological sense.

@korikuzma
Copy link
Member

For tx_segment_to_genomic regardless of strand orientation:

If exon_start is 1 and exon_end is None, the exon start offset must be >= 0.
If exon_end is the last exon and exon_start is None, the exon end offset must be <= 0

@korikuzma korikuzma added the priority:high High priority label Aug 20, 2024
@korikuzma
Copy link
Member

    # Positive strand, start == alt_start_i
    resp = test_egc_mapper._get_adjacent_exon(
        tx_exons_genomic_coords=nm_001105539_exons_genomic_coords,
        start=80486225,
        strand=Strand.POSITIVE,
    )
    assert resp == 0

This currently returns exon 1 (0 index) but it should return exon 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:medium Medium priority
Projects
None yet
Development

No branches or pull requests

2 participants