Closed genestack-solomatin closed 10 years ago
Thanks for the feedback and example case. Unfortunately it's not easy to maintain order when you have a small target_lines
parameter, since it will end up being forced to break inside nested features. The easy fix is either to ignore nesting (target_lines=1
) or not set target_lines
at all and let it process across the file. target_lines
is meant as a workaround to handle memory issues.
Since GFF does not have a defined order and nested items can be anywhere in the file, this library was not designed with order guarantees under all conditions. If you need that it might be worth looking at Ryan Dale's gffutils:
https://github.com/daler/gffutils/tree/refactor
This stores the GFF in a database, allowing you to grab out sections based on your ordering criteria. Hope this helps.
Steps to reproduce: Create file sorted in certain order (III -> I)
Run python code :
Observed result:
Expected result: Contig sort order should not affect output
Note: Sorting file in order (I -> III) will give: