# Path: bipy/toolbox/deseq.py
# def load_count_file(in_file, r):
# def make_count_set(conds, r):
# def run(in_file, conds, out_prefix):
# def _plot_disp_ests(r, dispersion_plot_out):
# def _plot_MvA(r, mva_plot_out):
# def run_with_config(in_file, gtf, config):
#     def __init__(self, base_dir):
#     def get_deseq_graphs(self):
#     def get_top_genes(self):
#     def _get_top_by(self, in_file, by="padj"):
#     def __init__(self):
#     def template(self):
#     def generate_report(self, name, figures=None, top_hits=None):
# class DeseqParser(object):
# class DeseqReport(LatexReport):
#     GRAPH_SUFFIXES = ((".dispersions.pdf", "", 1.0),
#                       (".MvA.pdf", "", 1.0))
#     INFO_SUFFIXES = {"annotated": ".annotated.deseq.txt",
#                      "deseq": ".deseq.txt"}
# 
# Path: bipy/utils.py
# def replace_suffix(filename, suffix, delim="."):
#     """ returns a filename with the suffix replaced
#     with a new suffix
#     exampoe: /path/to/test.run.sam -> /path/to/test.run.fa"""
#     dirname = os.path.dirname(filename)
#     filename = os.path.basename(filename)
#     fsplit = filename.split(delim)[:-1]
#     fsplit.append(suffix)
#     return os.path.join(dirname, delim.join(fsplit))


from bipy.toolbox import deseq
from bipy.utils import replace_suffix
from bcbio.utils import safe_makedir, file_exists
import os
import unittest


class TestDeseq(unittest.TestCase):

    def setUp(self):
        self.count_file = "test/data/pasilla_gene_counts.tsv"
        self.conds = ["untreat", "untreat", "untreat", "untreat",
                      "treat", "treat", "treat"]

    def test_run(self):
        out_prefix = "results/tests/deseq/test_deseq"
        safe_makedir(os.path.dirname(out_prefix))

# Path: bipy/toolbox/deseq.py
# def load_count_file(in_file, r):
# def make_count_set(conds, r):
# def run(in_file, conds, out_prefix):
# def _plot_disp_ests(r, dispersion_plot_out):
# def _plot_MvA(r, mva_plot_out):
# def run_with_config(in_file, gtf, config):
#     def __init__(self, base_dir):
#     def get_deseq_graphs(self):
#     def get_top_genes(self):
#     def _get_top_by(self, in_file, by="padj"):
#     def __init__(self):
#     def template(self):
#     def generate_report(self, name, figures=None, top_hits=None):
# class DeseqParser(object):
# class DeseqReport(LatexReport):
#     GRAPH_SUFFIXES = ((".dispersions.pdf", "", 1.0),
#                       (".MvA.pdf", "", 1.0))
#     INFO_SUFFIXES = {"annotated": ".annotated.deseq.txt",
#                      "deseq": ".deseq.txt"}
# 
# Path: bipy/utils.py
# def replace_suffix(filename, suffix, delim="."):
#     """ returns a filename with the suffix replaced
#     with a new suffix
#     exampoe: /path/to/test.run.sam -> /path/to/test.run.fa"""
#     dirname = os.path.dirname(filename)
#     filename = os.path.basename(filename)
#     fsplit = filename.split(delim)[:-1]
#     fsplit.append(suffix)
#     return os.path.join(dirname, delim.join(fsplit))


# Path: test/deseq/test_deseq.py
from bipy.toolbox import deseq
from bipy.utils import replace_suffix
from bcbio.utils import safe_makedir, file_exists
import os
import unittest



class TestDeseq(unittest.TestCase):

    def setUp(self):
        self.count_file = "test/data/pasilla_gene_counts.tsv"
        self.conds = ["untreat", "untreat", "untreat", "untreat",
                      "treat", "treat", "treat"]

    def test_run(self):
        out_prefix = "results/tests/deseq/test_deseq"
        safe_makedir(os.path.dirname(out_prefix))

        result = deseq.run(self.count_file, self.conds, out_prefix=out_prefix)