simplevcf

A simple VCF parser/weriter


License
Apache-2.0
Install
pip install simplevcf==0.2.0

Documentation

simplevcf

Python package PyPI PyPI - Python Version PyPI - License PyPI - Format PyPI - Status

Simple VCF parser/writer with pure python

Documentation

Examples

Read VCF

    with simplevcf.vcfopen('some.vcf.gz') as reader:
        for record in reader:
            # process a record

Read, manipulate and write

    with simplevcf.vcfopen('some.vcf.gz') as reader, with open('output.vcf) as f:
        writer = simplevcf.Writer(f, reader.headers,
                                  reader.samples)
        for record in reader:
            # manipulate a record
            writer.write_record(one)

Access to INFO and CALL

    with simplevcf.vcfopen(test_file) as reader:
        for one in reader:
            print(
                one.INFO['AC'], one.CALL['ERP107576_NovaSeq_SAMEA104707359']['GT'][0])