# Path: mitty/lib/bedfile.py
# def read_bed(bed_fname):
#   return list(map(lambda x: (x[0], int(x[1]), int(x[2])), map(lambda x: x.split(), open(bed_fname, 'r').readlines())))


import logging
import time
import pysam
from mitty.lib.bedfile import read_bed



logger = logging.getLogger(__name__)


# NOTE TO SELF: Though it seems like we could convert the psyam variant handling structures to something
# that looks like it is more useful for us re: read generation, it is not worth the effort and the loss
# in modularity and maintainability. It is better to simply have functions that convert the VCF records
# to the structure used by read generation at a later stage.


# The pysam variant class is a little too convoluted for our use, so we simplify the fields to this
# and add some useful information
# Note the absence of the CHROM field
class Variant(object):
  __slots__ = ('pos', 'ref', 'alt', 'cigarop', 'oplen')

  def __init__(self, pos, ref, alt, cigarop, oplen):
    self.pos = pos
    self.ref = ref
    self.alt = alt
    self.cigarop = cigarop
    self.oplen = oplen

  def tuple(self):

# Path: mitty/lib/bedfile.py
# def read_bed(bed_fname):
#   return list(map(lambda x: (x[0], int(x[1]), int(x[2])), map(lambda x: x.split(), open(bed_fname, 'r').readlines())))


# Path: mitty/lib/vcfio.py
import logging
import time
import pysam
from mitty.lib.bedfile import read_bed




logger = logging.getLogger(__name__)


# NOTE TO SELF: Though it seems like we could convert the psyam variant handling structures to something
# that looks like it is more useful for us re: read generation, it is not worth the effort and the loss
# in modularity and maintainability. It is better to simply have functions that convert the VCF records
# to the structure used by read generation at a later stage.


# The pysam variant class is a little too convoluted for our use, so we simplify the fields to this
# and add some useful information
# Note the absence of the CHROM field
class Variant(object):
  __slots__ = ('pos', 'ref', 'alt', 'cigarop', 'oplen')

  def __init__(self, pos, ref, alt, cigarop, oplen):
    self.pos = pos
    self.ref = ref
    self.alt = alt
    self.cigarop = cigarop
    self.oplen = oplen

  def tuple(self):

    return self.pos, self.ref, self.alt, self.cigarop, self.oplen