vcfnp icon indicating copy to clipboard operation
vcfnp copied to clipboard

Wish: support for writing in vcflib's binding

Open lbeltrame opened this issue 12 years ago • 3 comments

The reason for this request is to enable possibly filtering and manipulation like you can do with PyVCF, but with a much faster (numpy + C++ backend) interface.

I wrote "in vcflib's binding" rather to vcfnp itself because I think that pushing data from numpy to VCF wouldn't be exactly trivial, also considering that vcfnp parses the various bits of a VCF file independently.

lbeltrame avatar May 23 '13 08:05 lbeltrame

Inspecting vcflib's source code shows that there are no methods to explicitly write a file, since the results of manipulations are outputted as streams.

lbeltrame avatar May 23 '13 09:05 lbeltrame

Yes, as far as I can make out there is no explicit support in the vcflib C++ API for writing a VCF. If ekg adds this upstream I'd be happy to wrap it in the vcflib cython extension.

alimanfoo avatar May 23 '13 12:05 alimanfoo

In data giovedì 23 maggio 2013 05:46:29, Alistair Miles ha scritto:

Yes, as far as I can make out there is no explicit support in the vcflib C++ API for writing a VCF. If ekg adds this upstream I'd be happy to wrap it in

By looking at the code of some of the utilties in vcflib, I see that simply put the header is written to stdout first, then vectors representing records are simply sent to stdout.

I wonder how hard would it be to add a fstream operator to vcflib in addition to ostream that's arelady implemented.

Luca Beltrame - KDE Forums team KDE Science supporter GPG key ID: 6E1A4E79

lbeltrame avatar May 23 '13 12:05 lbeltrame