Ejemplo n.º 1
0
#
###########################################################################

from matplotlib.ticker import FuncFormatter, MaxNLocator
import numpy as np
import pickle; import numpy as np; import matplotlib.pyplot as plt;
import os
import sys
import scipy.stats as stats
import mol_utils

codepath = os.getcwd()+'/'
sys.path.append(codepath)


DRM_words = mol_utils.pickleload(codepath+'DRM_words.dump')['DRM_words']
labels = [DRM_words[i] for i in np.array([10, 16, 11, 4, 12, 17, 8, 14, 19 , 21, 7, 13, 5, 20, 3, 9, 15, 18, 6])-3]
def format_fn(tick_val, tick_pos):
    if int(tick_val)<len(labels):
        return labels[int(tick_val)]
    else:
        return ''

###########################################################################
#
#  Z-score version of figures
#
###########################################################################

mediansZscores = mol_utils.pickleload(codepath+'factor_analysis_results_overlap_plus_mean_FT0.dump')['mediansPvals'];
keys1 = sorted(mediansZscores['Semantics2'].keys())
Ejemplo n.º 2
0
import gensim
import re
import copy
import sklearn.cross_decomposition as cross
from sklearn import linear_model as lm
from sklearn import model_selection as mod_sel
import matplotlib.pyplot as plt
import scipy.stats as stats
import os
import pickle
import mol_utils

basepath = os.getcwd() + '/'
sys.path.append(basepath)

v = mol_utils.pickleload(basepath + 'aux/horizontal_barchart_data.dump')

corr = v['corr']
corr2 = v['corr2']
DRV_words2 = v['DRV_words2']
mols = v['mols']
chems = v['chems']
corr2a = v['corr2a']
sorted_correls_DRV = v['sorted_correls_DRV']

sorted_correls_DRV_mols = [x for (y, x) in sorted(zip(corr2, mols))]

sorted_correls_DRV_mols = [x for (y, x) in sorted(zip(corr2, mols))]

# Create the bars
# The parameters are:
Ejemplo n.º 3
0
import os
import matplotlib.pyplot as plt
import scipy.stats as stats
import pickle
import numpy as np
import sys
import mol_utils as mu

basepath = os.getcwd() + '/'
sys.path.append(basepath)
codepath = basepath

try:
    mediansPvals = mu.pickleload(
        codepath +
        'moleculeAnalysis_results_overlap_plus_mean_2.0_FT0_expandSet.dump'
    )['mediansZscores']
except:
    mediansPvals = mu.pickleload(
        codepath +
        'moleculeAnalysis_results_overlap_plus_mean_2.0_FT0_expandSet.dump'
    )['mediansPvals']
markers = ['s', '<', 'o']
#markerfacecolors = ['white','black','lightgrey']
linestyles = ['solid', 'solid', 'solid']  #'dashed','-.']
fig, ax = plt.subplots()
for style, key, marker in zip(linestyles,
                              ['Semantics2', 'Perceptual', 'Half2'], markers):
    keys0 = [k for k in sorted(mediansPvals[key].keys()) if not k == 0]
    if key == 'Perceptual':
        key2 = 'DirRat'