<jupyter_start><jupyter_text>Volcano plot<jupyter_code>set_style()
fig, ax = plt.subplots(1, sharex=False, sharey=False, figsize=(10,7))
ax = fig.get_axes()[0] 

x_lim = (-6,6)
y_lim = (-50, 700)
ax.set_xlim(x_lim)
ax.set_ylim(y_lim)

for val in [0.4, -0.4]: 
    ax.vlines(val, y_lim[0], y_lim[1], 'k','dashed', alpha=0.5)

for val in [0.05]: 
    ax.hlines(val, x_lim[0], x_lim[1], 'k','dashed', alpha=0.5)

df = scores.query('logROR_avg<0.4 and logROR_avg>-0.4')
y = -np.log(df['p_val_max'])
x = df['logROR_avg']
hue = df.get('logROR_avg').values>0
sns.scatterplot( x, y, ax=ax, color='darkgray', size=10)

df = scores.query('p_val_max>0.05')
y = -np.log(df['p_val_max'])
x = df['logROR_avg']
hue = df.get('logROR_avg').values>0
sns.scatterplot( x, y, ax=ax, color='darkgray', size=10)

df = scores.query('p_val_max<=0.05').query('logROR_avg>0.4 or logROR_avg<-0.4')
y = -np.log(df['p_val_max'])
x = df['logROR_avg']
hue = df.get('logROR_avg').values>0
sns.scatterplot( x, y, ax=ax, hue=hue, size=12)

sns.despine()
ax.tick_params(labelsize=12)
ax.tick_params('x', pad=15)
plt.title('')
plt.xlabel('')
plt.ylabel('')
ax.legend([])

plt.tight_layout()
plt.show()<jupyter_output>/home/pc2800/envs/sex_risks/lib/python3.5/site-packages/ipykernel_launcher.py:17: RuntimeWarning: divide by zero encountered in log
/home/pc2800/envs/sex_risks/lib/python3.5/site-packages/ipykernel_launcher.py:29: RuntimeWarning: divide by zero encountered in log<jupyter_text>Distribution of all logROR<jupyter_code>set_style()
fig, ax = plt.subplots(1, sharex=False, sharey=False, figsize=(10,7))
ax = fig.get_axes()[0] 

x_lim = (-6,6)
y_lim = (-0.1, 1)
ax.set_xlim(x_lim)
ax.set_ylim(y_lim)

x = scores.get('logROR_avg').values
sns.distplot(x, color='mediumseagreen',bins=100)

sns.despine()
ax.tick_params(labelsize=12, pad=5)
plt.title('')
plt.xlabel('')
plt.ylabel('')
ax.legend([])

plt.tight_layout()
plt.show()<jupyter_output><empty_output><jupyter_text>Distribution of significant logROR<jupyter_code>scores = scores.query('p_val_max<0.05')

hide = u.load_np('adr_hide')
scores = scores.query('adr_name not in @hide')
set_style()
fig, ax = plt.subplots(1, sharex=False, sharey=False, figsize=(10,7))
ax = fig.get_axes()[0] 

x_lim = (-6,6)
#y_lim = (-0.1, 1)
ax.set_xlim(x_lim)
#ax.set_ylim(y_lim)

x = scores.query('logROR_avg>0').get('logROR_avg').values
sns.distplot(x, color='palevioletred',bins=100,norm_hist=False)

x = scores.query('logROR_avg<0').get('logROR_avg').values
sns.distplot(x, color='skyblue',bins=100)

sns.despine()
ax.tick_params(labelsize=12, pad=5)
plt.title('')
plt.xlabel('')
plt.ylabel('')
ax.set_yticks([0,0.5,1,1.5,2], minor=False)
ticks = list([str(round(x,2)) for x in np.linspace(0,1,5)])
ax.set_yticklabels(ticks)
ax.legend([])

plt.tight_layout()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2059032716927454, 'fraction_numerical': 0.0430298719772404, 'mean_word_length': 6.501333333333333, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '379494', 'license': 'MIT', 'n_tokens_mistral': 1371, 'n_tokens_neox': 1291, 'n_words': 191, 'path': 'Code/fig_volcano.ipynb', 'repo_name': 'tatonetti-lab/sex_risks', 'size': '2812'}