Skip to content

himamis/parse-vcf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-vcf

This library parses variant call files (VCF) written in standard c++. The parser implements the VCF4.3 grammar, although it is more permissive.

Getting Started

Check out a copy of this library, include all the files from the src folder and you're ready to go. A minimal example:

#include "DefaultHandler.h"
#include "SNVEntry.h"
#include "VCFParser.h"
#include <iostream>
#include <fstream>

class ExampleHandler: public parsevcf::DefaultHandler {

	void entry(const parsevcf::SNVEntry& entry) {
		std::cout << entry.id();
		std::cout.flush();
	}
};

int main() {
	std::fstream input("name-of-file.vcf");
	ExampleHandler handler;
	parsevcf::VCFParser parser(input, handler);

	parser.parse();
}

Running the tests

To run the tests just call make.

License

This project is licensed under the GPLv2 License - see the LICENSE file for details

About

An extendable parser for vcf files written in C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published