# Path: vcfpy/reader.py
# class Reader:
#     def from_stream(
#         klass, stream, path=None, tabix_path=None, record_checks=None, parsed_samples=None
#     ):
#     def from_path(klass, path, tabix_path=None, record_checks=None, parsed_samples=None):
#     def __init__(self, stream, path=None, tabix_path=None, record_checks=None, parsed_samples=None):
#     def fetch(self, chrom_or_region, begin=None, end=None):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
#     def __iter__(self):
#     def __next__(self):
# 
# Path: vcfpy/writer.py
# def format_atomic(value, section):
# def format_value(field_info, value, section):
#     def from_stream(klass, stream, header, path=None, use_bgzf=None):
#     def from_path(klass, path, header):
#     def __init__(self, stream, header, path=None):
#     def _write_header(self):
#     def close(self):
#     def write_record(self, record):
#     def _serialize_record(self, record):
#     def _serialize_info(self, record):
#     def _serialize_call(self, format_, call):
#     def _empty_to_dot(klass, val):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
# class Writer:


import os
from vcfpy import reader
from vcfpy import writer
# -*- coding: utf-8 -*-
"""Roundtrip-test: read in VCF file and write out again
"""



__author__ = "Manuel Holtgrewe <manuel.holtgrewe@bihealth.de>"


def test_vcf_roundtrip(tmpdir_factory):
    # open reader with VCF file to read from
    in_path = os.path.join(os.path.dirname(__file__), "vcfs/full_vcf43.vcf")
    r = reader.Reader.from_path(in_path)
    # open temporary file and setup the Writer with header info from reader
    out_path = tmpdir_factory.mktemp("write_header").join("out.vcf")

# Path: vcfpy/reader.py
# class Reader:
#     def from_stream(
#         klass, stream, path=None, tabix_path=None, record_checks=None, parsed_samples=None
#     ):
#     def from_path(klass, path, tabix_path=None, record_checks=None, parsed_samples=None):
#     def __init__(self, stream, path=None, tabix_path=None, record_checks=None, parsed_samples=None):
#     def fetch(self, chrom_or_region, begin=None, end=None):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
#     def __iter__(self):
#     def __next__(self):
# 
# Path: vcfpy/writer.py
# def format_atomic(value, section):
# def format_value(field_info, value, section):
#     def from_stream(klass, stream, header, path=None, use_bgzf=None):
#     def from_path(klass, path, header):
#     def __init__(self, stream, header, path=None):
#     def _write_header(self):
#     def close(self):
#     def write_record(self, record):
#     def _serialize_record(self, record):
#     def _serialize_info(self, record):
#     def _serialize_call(self, format_, call):
#     def _empty_to_dot(klass, val):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
# class Writer:


# Path: tests/test_roundtrip.py
import os
from vcfpy import reader
from vcfpy import writer

# -*- coding: utf-8 -*-
"""Roundtrip-test: read in VCF file and write out again
"""



__author__ = "Manuel Holtgrewe <manuel.holtgrewe@bihealth.de>"


def test_vcf_roundtrip(tmpdir_factory):
    # open reader with VCF file to read from
    in_path = os.path.join(os.path.dirname(__file__), "vcfs/full_vcf43.vcf")
    r = reader.Reader.from_path(in_path)
    # open temporary file and setup the Writer with header info from reader
    out_path = tmpdir_factory.mktemp("write_header").join("out.vcf")

    w = writer.Writer.from_path(out_path, r.header)