# Path: cmonkey/tools/util.py
# def read_ratios(result_dir):
#     csvpath = os.path.join(result_dir, 'ratios.tsv.gz')
#     df = pandas.read_csv(csvpath, index_col=0, sep='\t')
#     df.index = map(str, df.index)
#     return df


import matplotlib.pyplot as plt
import numpy as np
import os
import math
import cmonkey.database as cm2db
from cmonkey.tools.util import read_ratios
from sqlalchemy import func, and_
"""plot_expressions.py - make cluster gene expression plots"""


def normalize_js(value):
    if math.isnan(value) or math.isinf(value):
        return 0.0
    else:
        return value


def generate_plots(session, result_dir, output_dir):

# Path: cmonkey/tools/util.py
# def read_ratios(result_dir):
#     csvpath = os.path.join(result_dir, 'ratios.tsv.gz')
#     df = pandas.read_csv(csvpath, index_col=0, sep='\t')
#     df.index = map(str, df.index)
#     return df


# Path: cmonkey/tools/plot_expressions.py
import matplotlib.pyplot as plt
import numpy as np
import os
import math
import cmonkey.database as cm2db
from cmonkey.tools.util import read_ratios
from sqlalchemy import func, and_

"""plot_expressions.py - make cluster gene expression plots"""


def normalize_js(value):
    if math.isnan(value) or math.isinf(value):
        return 0.0
    else:
        return value


def generate_plots(session, result_dir, output_dir):

    ratios = read_ratios(result_dir)