rust-bio / rust-bio-tools

A set of command line utilities based on Rust-Bio.
MIT License
182 stars 24 forks source link

vcf-split breaks sorting #229

Closed fgvieira closed 2 years ago

fgvieira commented 2 years ago

vcf-split keeps breakends together, but I thought it would just keep them in the same file. In practice, it moves the records around and breaks the file sorting.

So, for example, records:

III     3226364 MantaDEL:78744:0:0:0:0:0
III     3228674 MantaBND:78991:0:1:1:0:0:1
III     3228676 MantaBND:78991:0:1:0:1:0:1
III     3228678 MantaINS:78991:0:0:0:0:0
III     3228681 MantaDEL:78991:0:0:0:0:1
III     3228782 MantaBND:78991:0:1:0:1:0:0
III     3228783 MantaBND:78991:0:1:1:0:0:0

become:

III     3226364 MantaDEL:78744:0:0:0:0:0
III     3228678 MantaINS:78991:0:0:0:0:0
III     3228681 MantaDEL:78991:0:0:0:0:1
III     3228674 MantaBND:78991:0:1:1:0:0:1
III     3228676 MantaBND:78991:0:1:0:1:0:1
III     3228782 MantaBND:78991:0:1:0:1:0:0
III     3228783 MantaBND:78991:0:1:1:0:0:0

Is there any reason why this behavior? Would it make sense to add an option to keep the records sorted?

thanks,

johanneskoester commented 2 years ago

Good catch. This is of course not intended.

tedil commented 2 years ago

Closing because this has been fixed with #244