-
Notifications
You must be signed in to change notification settings - Fork 102
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
check for off-by-1 errors #8
Comments
good idea. |
so all starts in bedFile.h are converted to 0-based (gff, vcf have 1 subtracted) and ends are unchanged. So everything will have BED-like coordinates. import pybedtools
b = pybedtools.BedTool('pybedtools/test/data/c.gff')
d = iter(b).next()
print d
d.start = d.start
print d gives: so the start has changed. Thoughts on how to address this? |
Phew, nice catch. It seems that the fundamental issue is that there are 2 different 'start' values -- one is in import pybedtools
b = pybedtools.BedTool('pybedtools/test/data/c.gff')
d = iter(b).next()
print d.fields[3] # 465
print d.start # 464 Is there a good reason for bedFile.h to subtract 1? |
| Is there a good reason for bedFile.h to subtract 1? then it makes things like .length work the same for all. if self.file_type != "bed": start -= 1 will that solve everything? |
looks like it won't . . .
i just added a test for starts to be able to check this, 50974ad |
OK, I think this is fixed now. I assumed these conventions:
If a user tries to use .fields[3] for something, hopefully the fact that they have to do an extra int() on it will be a reminder that it's different than the already-as-an-int Interval.start. (see c0163ce for this, which includes BED- and GFF-specific tests) |
closing as this is tested and documented (thanks @daler). |
you guys have probably already handled this but let's add some tests that mix gff and bed input/output and make sure everything is as we expect for length, overlap amount, etc.
The text was updated successfully, but these errors were encountered: