Skip to content

Commit

Permalink
Added environment_full.yml and a simplified version of environment.yml.
Browse files Browse the repository at this point in the history
  • Loading branch information
miltondp committed Oct 25, 2018
1 parent a55165f commit 8c2b0ec
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 11 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ Ran 92 tests in 47.056s
OK
```

Keep in mind that if you want to fully reproduce the results in the manuscript,
then you need to install the full environment using the file
`environment_full.yml`, which has additional dependencies. The one we used
before (`environment.yml`) has the minimum set of packages needed to run
Clustermatch.


## Reproducing results

Expand Down
7 changes: 0 additions & 7 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,13 @@ channels:
- defaults
dependencies:
- tabulate=0.8
- requests=2.18
- ipython=6.2
- joblib=0.11
- matplotlib=2.1
- numpy=1.13
- pandas=0.21
- python=3.6
- scikit-learn=0.19
- scipy=1.0.0
- seaborn=0.8
- xlrd=1.1
- xlwt=1.2
- openpyxl=2.4
- pillow=5.1
- pip:
- minepy==1.2.1
- pyclustering==0.8.1
22 changes: 22 additions & 0 deletions environment_full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: clustermatch
channels:
- defaults
dependencies:
- tabulate=0.8
- requests=2.18
- ipython=6.2
- joblib=0.11
- matplotlib=2.1
- numpy=1.13
- pandas=0.21
- python=3.6
- scikit-learn=0.19
- scipy=1.0.0
- seaborn=0.8
- xlrd=1.1
- xlwt=1.2
- openpyxl=2.4
- pillow=5.1
- pip:
- minepy==1.2.1
- pyclustering==0.8.1
30 changes: 26 additions & 4 deletions utils/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@
from scipy.cluster.hierarchy import fcluster
from scipy.spatial.distance import squareform, pdist
import pandas as pd
import matplotlib
import seaborn as sns
import requests

try:
import matplotlib
import seaborn as sns
sns.set(context="paper", font="monospace")
MATPLOTLIB_INSTALLED = True
except:
MATPLOTLIB_INSTALLED = False

try:
import requests
REQUESTS_INSTALLED = True
except:
REQUESTS_INSTALLED = False

from utils.misc import get_temp_file_name

sns.set(context="paper", font="monospace")

RESULTS_DIR = 'results'

Expand All @@ -38,6 +48,9 @@ def func_wrapper(*args, **kwargs):


def get_clustergrammer_link(square_matrix, names):
if not REQUESTS_INSTALLED:
raise ValueError('requests is not installed')

# save sim matrix as csv and get clustergrammer visualization
df = pd.DataFrame(square_matrix)
df['names'] = names
Expand Down Expand Up @@ -170,6 +183,9 @@ def save_partitions(partitions, timestamp, extra_columns=None, columns_order=Non

@setup_results_dir
def save_coassociation_matrix(ensemble, partition, timestamp, columns_order=None, image_format='pdf'):
if not MATPLOTLIB_INSTALLED:
raise ValueError('matplotlib is not installed')

condensed_matrix = _get_condensed_distance_matrix(ensemble)
full_matrix = squareform(condensed_matrix)
full_matrix = 1 - full_matrix
Expand Down Expand Up @@ -209,6 +225,9 @@ def save_coassociation_matrix(ensemble, partition, timestamp, columns_order=None

@setup_results_dir
def save_similarity_matrix(partition, feature_names, sim_matrix, timestamp, image_format='pdf'):
if not MATPLOTLIB_INSTALLED:
raise ValueError('matplotlib is not installed')

partition_idxs_sorted = np.argsort(partition)
sim_matrix_sorted = sim_matrix[partition_idxs_sorted, :]
sim_matrix_sorted = sim_matrix_sorted[:, partition_idxs_sorted]
Expand Down Expand Up @@ -238,6 +257,9 @@ def save_reps_comparison(reps_comparison, timestamp):

@setup_results_dir
def save_clustermap(sim_matrix, feature_names, sources_names, partition_linkage, timestamp, image_format='pdf'):
if not MATPLOTLIB_INSTALLED:
raise ValueError('matplotlib is not installed')

font_scale = (50.0 / len(feature_names))
# sns.set(font_scale=font_scale)

Expand Down

0 comments on commit 8c2b0ec

Please sign in to comment.