# Path: bipy/toolbox/htseq_count.py
# def _load_htseq_count_file(filename):
# def _make_length_dict(gtf_file):
# def calculate_rpkm(count_file, gtf_file):
# def combine_counts(in_files, column_names=None, out_file=None):
# def _get_outfilename(input_file):
# def run(input_file, gtf_file, out_file=None):
# def run_with_config(input_file, config, stage, out_file=None):


import yaml
import unittest
import os
import shutil
from bipy.toolbox import htseq_count
from bcbio.utils import safe_makedir

STAGENAME = "htseq-count"


class TestHtseqcount(unittest.TestCase):

    def setUp(self):
        self.config_file = "test/htseq-count/test_htseq_count.yaml"
        with open(self.config_file) as in_handle:
            self.config = yaml.load(in_handle)

        self.input_file = self.config["input"]
        self.gtf = self.config["annotation"]["file"]
        self.stage_config = self.config["stage"][STAGENAME]
        self.options = self.stage_config["options"]

    def test_run(self):
        out_file = "results/htseq-count/test_run.count"

# Path: bipy/toolbox/htseq_count.py
# def _load_htseq_count_file(filename):
# def _make_length_dict(gtf_file):
# def calculate_rpkm(count_file, gtf_file):
# def combine_counts(in_files, column_names=None, out_file=None):
# def _get_outfilename(input_file):
# def run(input_file, gtf_file, out_file=None):
# def run_with_config(input_file, config, stage, out_file=None):


# Path: test/htseq-count/test_htseq_count.py
import yaml
import unittest
import os
import shutil
from bipy.toolbox import htseq_count
from bcbio.utils import safe_makedir


STAGENAME = "htseq-count"


class TestHtseqcount(unittest.TestCase):

    def setUp(self):
        self.config_file = "test/htseq-count/test_htseq_count.yaml"
        with open(self.config_file) as in_handle:
            self.config = yaml.load(in_handle)

        self.input_file = self.config["input"]
        self.gtf = self.config["annotation"]["file"]
        self.stage_config = self.config["stage"][STAGENAME]
        self.options = self.stage_config["options"]

    def test_run(self):
        out_file = "results/htseq-count/test_run.count"

        run_result = htseq_count.run(self.input_file,