Open abhinavsns opened 1 month ago
As I understand that's part of the specifications :
line: String terminated by a line separator, in one of the following classes. Either a data line,
a comment line, or a blank line. Discussed more fully in subsection 1.4.
line separator: Either carriage return (\r, equivalent to \x0d), newline (\n, equivalent to \x0a), or carriage return followed by newline (\r\n, equivalent to \x0d\x0a). The same line separator must be used throughout the file.
https://samtools.github.io/hts-specs/BEDv1.pdf
How does python/R handle it ?
I do not know how python/R handles it but I see that the standard indeed requires that. The standard seems counterintuitive. Are there any non-trivial advantages of such a design?
On the develop branch 1b51e2d3e6ece2e5adf1ac7274246ee57fa9a81a
Consider example.bed file with 1 entry and 1 line:
Not that there is no empty line at the end
Output is an empty interval collection:
whereas if there is an empty line present in example.bed (1 entry, 2 lines):
Then the output is as expected:
It seems like the last entry of a file is not being read.