Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/cmap/cmapPy.git into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
naviddianati committed Oct 30, 2019
2 parents 7dc505d + 4520702 commit a9bf5dc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions cmapPy/visualization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import scattergram
import stratogram
import cohort_view
from . import scattergram
from . import stratogram
from . import cohort_view
12 changes: 8 additions & 4 deletions cmapPy/visualization/cohort_view.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@


import logging

from IPython.display import display
import pandas as pd

import numpy as np
import pandas as pd

logger = logging.getLogger()



Expand Down Expand Up @@ -69,7 +74,7 @@ def cohort_view_table(df,

df = df.T
num_categories = len(df.columns)
print "num_categories: {}".format(num_categories)
logger.info("num_categories: {}".format(num_categories))

# Test comopound fields
cpd_columns = [c for c in df.columns if 'Test subset' in c]
Expand Down Expand Up @@ -158,7 +163,6 @@ def display_cohort_stats_table(table, barplot_column):
# indexes of the rows corresponding to categories, exludes
# the last "total" sums
group_ids = [x for x in table.index if 'Total' not in x]
print group_ids

# Sum of numbers in Total column (excluding Grand Total, obviously)
total = table.loc['Grand Total', 'Total']
Expand Down Expand Up @@ -220,4 +224,4 @@ def display_cohort_stats_table(table, barplot_column):
)
)



6 changes: 5 additions & 1 deletion cmapPy/visualization/scattergram.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
@contact: [email protected]
'''

import matplotlib
import logging
import os

import matplotlib

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns

logger = logging.getLogger()


def scattergram(
df, columns, column_names, title="",
Expand Down
4 changes: 1 addition & 3 deletions cmapPy/visualization/stratogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import seaborn as sns

logger = logging.getLogger()
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')

figure_dpi = 150

Expand Down Expand Up @@ -102,7 +101,6 @@ def stratogram(
for name, group in grouped:
row_is_test_compounds = is_test_category(name)
name = group[category_label].unique()
print name
assert len(name) == 1
name = name[0]

Expand Down Expand Up @@ -272,7 +270,7 @@ def plot_row_of_histograms(

except Exception as e:
plt.text(0.01, 0.5, 'ERROR')
print str(e)
logger.errot(str(e))

if row_id == 0:
plt.xlabel(colname + " ",
Expand Down

0 comments on commit a9bf5dc

Please sign in to comment.