# Path: bipy/toolbox/sam.py
# def downsample_bam(bam_file, target_reads, out_file=None):
# def _get_reads_in_bamfile(bam_file):
# def _get_percentage_to_sample(bam_file, target_reads):
# def bam2sam(in_file, out_file=None):
# def is_sam_or_bam(in_file):
# def is_bam(in_file):
# def is_sam(in_file):
# def coordinate_sort_sam(in_file, config, out_file=None):
# def sortsam(in_file, out_file=None):
# def only_mapped(in_file, out_file=None):
# def only_unmapped(in_file, out_file=None):
# def sam2bam(in_file, out_file=None):
# def bamsort(in_file, out_prefix=None):
# def bam_name_sort(in_file, out_prefix=None):
# def bamindex(in_file):
# def bamdiff(pair, out_prefix=None):
#     def get_out_file(out_prefix, in_file, number):
#     def __init__(self, config):
#     def __call__(self, pair):
#     def _get_handles(self, in_file):
#     def _dump_rest(self, handles, read):
#     def _process_reads(self, handles_0, handles_1, read0, read1):
#     def _score_read_pair(self, read0, read1):
#     def _az_score_read_pair(self):
# class Disambiguate(AbstractStage):


import yaml
import unittest
import os
import hashlib
import tempfile
from bipy.toolbox import sam
from bcbio.utils import file_exists, flatten


cur_dir = os.path.dirname(os.path.realpath(__file__))
CONFIG_FILE = os.path.join(cur_dir, "test_sam.yaml")


class TestSam(unittest.TestCase):

    def setUp(self):
        with open(CONFIG_FILE) as in_handle:
            self.config = yaml.load(in_handle)

    def test_disambiguate(self):
        in_files = self.config["input_bamdiff"]

# Path: bipy/toolbox/sam.py
# def downsample_bam(bam_file, target_reads, out_file=None):
# def _get_reads_in_bamfile(bam_file):
# def _get_percentage_to_sample(bam_file, target_reads):
# def bam2sam(in_file, out_file=None):
# def is_sam_or_bam(in_file):
# def is_bam(in_file):
# def is_sam(in_file):
# def coordinate_sort_sam(in_file, config, out_file=None):
# def sortsam(in_file, out_file=None):
# def only_mapped(in_file, out_file=None):
# def only_unmapped(in_file, out_file=None):
# def sam2bam(in_file, out_file=None):
# def bamsort(in_file, out_prefix=None):
# def bam_name_sort(in_file, out_prefix=None):
# def bamindex(in_file):
# def bamdiff(pair, out_prefix=None):
#     def get_out_file(out_prefix, in_file, number):
#     def __init__(self, config):
#     def __call__(self, pair):
#     def _get_handles(self, in_file):
#     def _dump_rest(self, handles, read):
#     def _process_reads(self, handles_0, handles_1, read0, read1):
#     def _score_read_pair(self, read0, read1):
#     def _az_score_read_pair(self):
# class Disambiguate(AbstractStage):


# Path: test/sam/test_sam.py
import yaml
import unittest
import os
import hashlib
import tempfile
from bipy.toolbox import sam
from bcbio.utils import file_exists, flatten



cur_dir = os.path.dirname(os.path.realpath(__file__))
CONFIG_FILE = os.path.join(cur_dir, "test_sam.yaml")


class TestSam(unittest.TestCase):

    def setUp(self):
        with open(CONFIG_FILE) as in_handle:
            self.config = yaml.load(in_handle)

    def test_disambiguate(self):
        in_files = self.config["input_bamdiff"]

        disambiguate = sam.Disambiguate(self.config)