Parse maf files

This recipe demonstrate how to parse MAF files using the Bio++ MAF parser, in combination with the boost iostreams library.

First we need to include what we need to read files:

Maf files contain genome alignments, and are therefore quite large. They usually come as compressed files that we can parse directly in a C++ program. This can be achieved thanks to the boost iostreams library, which are fully compatible with the standard iostreams:

The best way to parse a MAF file is to iterate over syntheny blocks it contains. In this example loop, we are interested in the quality scores attached to a special species: