Skip to content
Arto Bendiken edited this page Sep 18, 2015 · 22 revisions

VCF to RDF Mapping

The team worked to produce an ontology mapping and supporting software to expose Variant Call Format (VCF) files as linked data, to facilitate offline batch conversion of VCF to various RDF formats as well as to enable online SPARQL querying of VCF files directly.

BioHackathon 2015 Team

Software Produced

Examples

Command-Line Interface (CLI)

The CLI utility called vcf2rdf transforms VCF files into RDF (currently outputting N-Triples):

vcf2rdf Homo_sapiens.1.vcf.gz Homo_sapiens.2.vcf.gz ...

The input files can be either plain text VCF or compressed by bgzip (as in the above example).

Application Programming Interface (API)

The RDF::VCF gem can be used like any other RDF.rb reader plugin:

require 'rdf/vcf'

RDF::VCF::Reader.open('Homo_sapiens.vcf.gz') do |reader|
  reader.each_statement do |statement|
    p statement
  end
end