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

Fix coordinate range check for negative strands in mafNextWithPos #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShahilPema
Copy link

The previous implementation incorrectly applied the same coordinate range check for both positive and negative strands. This caused false positives for out-of-range errors on negative strand entries, particularly when the start position was close to the source size.

Changes made:

  1. Separated the checks for positive and negative strands.
  2. For positive strands: Still check if (start + size) exceeds srcSize.
  3. For negative strands: Only check if start is less than srcSize.
  4. Added an explicit check for invalid strand characters.

This fix ensures proper handling of coordinates for both strands in MAF files, preventing false error reports for valid negative strand entries.

Example of a previously failing, but valid entry:
s Callithrix_geoffroyi.k119_747665 2539 15 - 2549 ----------------------------------------------TAA-A-TAAATA-A-ATA------------A

This change impacts all tools using the mafNextWithPos function, including
mafSpeciesSubset and other MAF manipulation utilities.

Tested with previously failing MAF files to confirm correct behavior.

@NullModel
Copy link
Contributor

We are very curious what processing pipelines are producing MAF files with negative strand coordinates. I don't think we have ever seen such before.

@NullModel
Copy link
Contributor

I mean negative strand for the first sequence in a block, the 'reference' sequence. Yes, other sequences will have negative strand coordinates, but not the first one.

@maximilianh
Copy link
Contributor

Hi @ShahilPema, can you also tell us what you're trying to do? We often wonder what the context of a question is, and in general also what our alignments are used for. I understand if you don't want explain a full project, in case there are concerns about publication work, just a little more than what you consider a bug, some more context is always interesting for us. Thanks! You can also send non-public messages to [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants