Skip to content

Commit

Permalink
add missing packages to environment.yml
Browse files Browse the repository at this point in the history
fix extracted path in figure files
  • Loading branch information
marakeby committed Sep 22, 2021
1 parent 1ca87e0 commit fa04fa5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
10 changes: 5 additions & 5 deletions analysis/extended_figures/figure_ed5_importance.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@ def plot_high_genes2(ax, layer=1, graph ='hist', direction='h'):
else:
column = 'coef'

node_importance = pd.read_csv(join(module_path,'./extracted/node_importance_graph_adjusted.csv'), index_col=0)
node_importance = pd.read_csv(join(module_path,'./figure_3/extracted/node_importance_graph_adjusted.csv'), index_col=0)
high_nodes = node_importance[node_importance.layer == layer].abs().nlargest(10, columns=[column])
# high_nodes = node_importance[node_importance.layer == layer].abs().nlargest(10, columns=['coef'])
features = list(high_nodes.index)
response = pd.read_csv(join(module_path,'./extracted/response.csv'), index_col=0)
df_in = pd.read_csv(join(module_path, './extracted/gradient_importance_detailed_{}.csv').format(layer), index_col=0)
response = pd.read_csv(join(module_path,'./figure_3/extracted/response.csv'), index_col=0)
df_in = pd.read_csv(join(module_path, './figure_3/extracted/gradient_importance_detailed_{}.csv').format(layer), index_col=0)
df_in = df_in.copy()
df_in = df_in.join(response)
df_in['group'] = df_in.response
Expand Down Expand Up @@ -395,8 +395,8 @@ def shorten_names(name):
fontproperties = {'family': 'Arial', 'weight': 'normal', 'size': 6}

def plot_axis(axis):
node_importance = pd.read_csv(join(module_path,'extracted/node_importance_graph_adjusted.csv'), index_col=0)
response = pd.read_csv(join(module_path, 'extracted/response.csv'), index_col=0)
node_importance = pd.read_csv(join(module_path,'figure_3/extracted/node_importance_graph_adjusted.csv'), index_col=0)
response = pd.read_csv(join(module_path, 'figure_3/extracted/response.csv'), index_col=0)
print response.head()
layers = sorted(list(node_importance.layer.unique()))
print layers
Expand Down
6 changes: 3 additions & 3 deletions analysis/extended_figures/figure_ed7_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def corrfunc(x, y, **kws):

def plot_activation(ax, column='coef_combined', layer=3, pad=200):

node_activation = pd.read_csv(join(module_path,'extracted/node_importance_graph_adjusted.csv'), index_col=0)
response = pd.read_csv(join(module_path,'extracted/response.csv'), index_col=0)
df = pd.read_csv(join(module_path,'extracted/activation_{}.csv'.format(layer)), index_col=0)
node_activation = pd.read_csv(join(module_path,'figure_3/extracted/node_importance_graph_adjusted.csv'), index_col=0)
response = pd.read_csv(join(module_path,'figure_3/extracted/response.csv'), index_col=0)
df = pd.read_csv(join(module_path,'figure_3/extracted/activation_{}.csv'.format(layer)), index_col=0)
df.columns = get_pathway_names(df.columns)
if layer==1:
column='coef_combined'
Expand Down
6 changes: 4 additions & 2 deletions analysis/figure_3/figure_3_sankey.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from os.path import dirname, realpath

from config_path import PATHWAY_PATH
from setup import saving_dir
from analysis.vis_utils import get_reactome_pathway_names

Expand Down Expand Up @@ -543,8 +545,8 @@ def get_fromated_network(links, high_nodes_df, col_name, remove_others):
# shorten names

def get_short_names(all_node_labels):
'/Users/haithamelmarakeby/PycharmProjects/pnet2/analysis/figure_3/extracted/pathways_short_names.xlsx'
df = pd.read_excel(join(module_path, './extracted/pathways_short_names.xlsx'), index_col=0)

df = pd.read_excel(join(PATHWAY_PATH, 'pathways_short_names.xlsx'), index_col=0)
mapping_dict = {}
for k, v in zip(df['Full name'].values, df['Short name (Eli)'].values):
mapping_dict[k] = str(v)
Expand Down
5 changes: 4 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- pip=18.1
- enum34=1.1.6
- futures=3.3.0
- h5py=2.9.0
- h5py=2.9.0l.c
- hdf5=1.10.4
- imageio=2.6.1
- keras=2.2.4
Expand All @@ -27,9 +27,12 @@ dependencies:
- tensorboard=1.12.2
- tensorflow=1.12.0
- yaml=0.1.7
- plotly-orca=1.3.1
- pip:
- adjusttext==0.7.3
- lifelines==0.19.5
- matplotlib==2.2.4
- psutil==5.8.0
- networkx==2.2
- pyvis==0.1.7.0
- requests==2.23.0
Expand Down

0 comments on commit fa04fa5

Please sign in to comment.