from __future__ import absolute_import
from .twobit import TwoBitFile


def get_reference_allele(chrom, start, hg19_path):
    twobit_file = TwoBitFile(hg19_path)
    end = start + 1
    refallele = twobit_file[chrom][start:end]
    return refallele

from __future__ import absolute_import
from .twobit import TwoBitFile


def get_reference_allele(chrom, start, hg19_path):
    twobit_file = TwoBitFile(hg19_path)
    end = start + 1
    try:
        refallele = twobit_file[chrom][start:end]
    except TypeError:
        refallele = 'N'
    return refallele

Return N for ref allele in pos uncovered by ref
Return N for ref allele in pos uncovered by ref

This arose during processing of a CGI var file originating from LFR
data (not sure, but LFR is an advanced technique, so it's possible CGI
is calling some positions that aren't called in reference).

  from __future__ import absolute_import
  from .twobit import TwoBitFile
  
  
  def get_reference_allele(chrom, start, hg19_path):
      twobit_file = TwoBitFile(hg19_path)
      end = start + 1
+     try:
-     refallele = twobit_file[chrom][start:end]
+         refallele = twobit_file[chrom][start:end]
+     except TypeError:
+         refallele = 'N'
      return refallele
  
Return N for ref allele in pos uncovered by ref
## Code Before:
from __future__ import absolute_import
from .twobit import TwoBitFile


def get_reference_allele(chrom, start, hg19_path):
    twobit_file = TwoBitFile(hg19_path)
    end = start + 1
    refallele = twobit_file[chrom][start:end]
    return refallele

## Instruction:
Return N for ref allele in pos uncovered by ref
## Code After:
from __future__ import absolute_import
from .twobit import TwoBitFile


def get_reference_allele(chrom, start, hg19_path):
    twobit_file = TwoBitFile(hg19_path)
    end = start + 1
    try:
        refallele = twobit_file[chrom][start:end]
    except TypeError:
        refallele = 'N'
    return refallele
