<jupyter_start><jupyter_text>Notebook to produce Figure 4 for Chiacchierini et al. (2021) ![Figure 4](./figs/PPP_figs_R2_Fig4.png "Figure 4")<jupyter_code>import sys
sys.path.append('..\\helperfx')

import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.lines as mlines
import matplotlib.transforms as transforms

from settings4figs import *
from fx4figs import *

import trompy as tp
import numpy as np
import dill
import tdt

from scipy.stats import mannwhitneyu

%matplotlib inline
### Reads in data
pickle_in = open('..\\data\\ppp_dfs_latencies.pickle', 'rb')
df_nr_cas, df_nr_malt, df_pr_cas, df_pr_malt = pd.read_pickle(pickle_in, compression=None)<jupyter_output><empty_output><jupyter_text>Panel A - non-restricted correlations<jupyter_code>fig4A = scatter_plus_density(df_nr_cas["latency"], df_nr_cas["time2peak"], df_nr_malt["latency"], df_nr_malt["time2peak"])<jupyter_output>Casein: r=0.2738185137242398, p=0.0013676314737113531
Maltodextrin: r=0.2000421050515578, p=0.02000627152643631<jupyter_text>Panel B - non-restricted correlations<jupyter_code>fig4B = scatter_plus_density(df_pr_cas["latency"], df_pr_cas["time2peak"], df_pr_malt["latency"], df_pr_malt["time2peak"], colors=["blue", "green"])
u, p = mannwhitneyu(df_nr_cas["latency"], df_nr_malt["latency"], alternative="two-sided")
print("NR rats: Lick latency, Casein vs. Malt - U={}, p={}".format(u, p))

u, p = mannwhitneyu(df_nr_cas["time2peak"], df_nr_malt["time2peak"], alternative="two-sided")
print("NR rats: Time to peak, Casein vs. Malt - U={}, p={}".format(u, p))

u, p = mannwhitneyu(df_pr_cas["latency"], df_pr_malt["latency"], alternative="two-sided")
print("PR rats: Lick latency, Casein vs. Malt - U={}, p={}".format(u, p))

u, p = mannwhitneyu(df_pr_cas["time2peak"], df_pr_malt["time2peak"], alternative="two-sided")
print("PR rats: Time to peak, Casein vs. Malt - U={}, p={}".format(u, p))<jupyter_output>NR rats: Lick latency, Casein vs. Malt - U=9048.5, p=0.9217710912000006
NR rats: Time to peak, Casein vs. Malt - U=9323.0, p=0.7427604810552352
PR rats: Lick latency, Casein vs. Malt - U=14095.0, p=2.5330654757519302e-08
PR rats: Time to peak, Casein vs. Malt - U=16750.0, p=0.0008559809071531111
{'fraction_non_alphanumeric': 0.14895509115162295, 'fraction_numerical': 0.08359270787016451, 'mean_word_length': 6.8671328671328675, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '520515', 'license': 'MIT', 'n_tokens_mistral': 1045, 'n_tokens_neox': 916, 'n_words': 192, 'path': 'notebooks/Figure 4.ipynb', 'repo_name': 'mccutcheonlab/PPP_analysis', 'size': '2249'}