You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was confused that an offset of 2 would translate from 11869 -> 11870
Looking at the code its clear that this is a mistake:
/// Genomic coordinate at offset into feature, taking strandedness into account@property coordinateAtOffset(long offset) const
{
// GFF3 features are 1-based coordinatesassert(offset >0);
offset--; // necessary in a 1-based closed coordinate system// for - strand count from end; for +, ., and ? strand count from startimmutableauto begin = (this.strand =='-' ? this.end : this.start);
// for - strand count backward; for +, ., and ? strand count forwardimmutableauto direction = (this.strand =='-' ? -1 : 1);
returnOB(begin + (direction * offset));
}
Agree that GFF3 is 1-based, and agree that GFF3 features are 1-based coordinates, but since you are dealing with OFFSETS (deltas), zero is still a reasonable input value.
Function should be revised to take >= 0 values, and should not offset--. Tests will then have to be updated.
The text was updated successfully, but these errors were encountered:
Yeah all this code was from a while ago. When it was part of gff3d we used the offsets as 1-based (even though that doesn't really make sense). There are actually a couple more functions that are implemented incorrectly.
This should be OB(this.length - 1) since the end is inclusive in a one-based system.
This should be this.length - 1 since the end is inclusive in a one-based system.
/// Genomic coordinate at end of feature, taking strandedness into account@property coordinateAtEnd() const
{
returnthis.coordinateAtOffset(this.length);
}
This should be this.length - 1 since the end is inclusive in a one-based system.
This is incorrect should be :
/// Genomic coordinate at end of feature, taking strandedness into account@property coordinateAtEnd() const
{
returnthis.coordinateAtOffset(this.length -1);
}
When looking at this unit test:
dhtslib/source/dhtslib/gff/package.d
Lines 21 to 47 in ca928a7
I was confused that an offset of 2 would translate from 11869 -> 11870
Looking at the code its clear that this is a mistake:
Agree that GFF3 is 1-based, and agree that GFF3 features are 1-based coordinates, but since you are dealing with OFFSETS (deltas), zero is still a reasonable input value.
Function should be revised to take >= 0 values, and should not
offset--
. Tests will then have to be updated.The text was updated successfully, but these errors were encountered: