Fix Contig Length Detection for GFF Parsing #301
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the bug reported in issue #299.
Problem Description
When parsing a GFF file, the contig length is usually extracted from the line:
This length is used to adjust gene coordinates that overlap the contig edge, splitting such genes into two parts to ensure they remain within the contig boundaries (as introduced in PR #206).
However, this line is optional according to the GFF3 specification. As a result, when this line is missing, the contig length is undefined, causing errors during the correction of overlapping gene coordinates.
Solution
To resolve this issue, the correction of overlapping gene coordinates is now performed only after defining the contig length through one of these methods :
##sequence-region
line is present.If no FASTA sequence is provided, the coordinate correction step is skipped. This omission does not pose a problem since the correction is primarily necessary when extracting gene sequences from the FASTA file.