MauricioCarneiro/gamgee — pull request #41 by MauricioCarneiro (2014-05-20 15:41:15+00:00)
Title: Initial support for VCFs

this is a rather large commit, but the functionality being added is very
similar to the ones already existing for SAM records.

Variant Header
--------------

VariantHeader is similar to the SamHeader in that it is only produced
once by the reader and a pointer to it is passed around to all the vcf
records. In this commit we provide the full API for creating headers
through the VariantHeaderBuilder (this may change in the future),
reading header using the VariantReader and writing out headers using the
VariantWriter.

Itemized changes:

* add VariantHeaderBuilder class with full construction API
* add VariantHeader implmentation with full API to access the useful parts of the header more functionality should only be added if needed
* add tests to all member functions of the api and the builder.

Variant Body
------------

VariantBody is similar to the SamBody in that it carries all of the
information in the VCF record. The current API only offers minimal
functionality to the simple fields of the record, more will be added
soon (as needed). There is no setter or builder to create variant
bodies, but the VariantReader can load a variant body from a VCF/BCF
file using one of the provided iterators. Variant is just like Sam, a
wrapper object that inherits from VarianBody and contains a pointer to a
the corresponding VariantHeader.

Itemized changes:

* Variant and VariantBody API first implementation (still lots to do, only basic functionality added)
* add tests to the vcf api

Readers and Writers
------------------

Simple implementation of readers and writers for variants (similar to
the Sam readers and writers).

* add VariantWriter to write variant records to VCF/BCF files
* add VariantReader to read in VCF/BCF files into Variant objects
* add VariantIterator a simple one record at a time iterator for variants use it with the SingleVariantReader alias (similar to SingleSamReader)

General updates to the framework
--------------------------------

* move utils and hts_memory to their own namespace and directories
* generalize c-string array to vector conversion for htslib structures
* update copy-assignment constructors to give the strong exception guarantee
* add minor corrections to doxygen comments

closes #36 #35 #34