<jupyter_start><jupyter_text>ACE2<jupyter_code>ace2 = df[df["gene_name"] == "Ace2"]
tmp = pd.DataFrame(ace2.groupby(["SRR", "gene_name"])["tpm"].sum()).reset_index()
tmp["age"] = tmp.SRR.map(age_map)
tmp
young = tmp[tmp.age==3]['tpm'].values
old = tmp[tmp.age==22]['tpm'].values
stat, p = stats.ttest_ind(young, old)
fig, ax = plt.subplots(figsize=(7,7))

gene = "ACE2"

labels = ['3 month', "22 month"]
lidx = [1, 2]


x = [young, old]

parts = ax.violinplot(x, showmedians=False, showextrema=False)
for pcidx, pc in enumerate(parts['bodies']):
    pc.set_facecolor('#D43F3A')
    if pcidx==1: pc.set_facecolor('#1f77b4')
    pc.set_edgecolor('black')
    pc.set_alpha(1)

    
mean = [np.mean(i) for i in x]
ax.scatter(lidx, mean, marker='o', color='white', s=30, zorder=3)


######## Add some random "jitter" to the x-axis
x = np.random.normal(1, 0.04, size=len(young))
ax.scatter(x, young, alpha=1, color="k")

x = np.random.normal(2, 0.04, size=len(old))
ax.scatter(x, old, alpha=1, color="k")

##########
ax.set_xticks(lidx)
ax.set_xticklabels(labels)



ax.annotate("p={:,.4f}".format(p), (1.5, ax.get_ylim()[1]*0.02), ha="center")

ax.set_ylim(-0.1)

ax.set_ylabel("Epithelium bulk $ACE2$ TPM")
plt.savefig("./figs/epi_bulk_ace2.png", bbox_inches='tight',dpi=300)

plt.show()
young.mean()/old.mean()
old.mean()/young.mean()<jupyter_output><empty_output><jupyter_text>TMPRS22<jupyter_code>tmprss2 = df[df["gene_name"] == "Tmprss2"]
tmp = pd.DataFrame(tmprss2.groupby(["SRR", "gene_name"])["tpm"].sum()).reset_index()
tmp["age"] = tmp.SRR.map(age_map)
tmp
tmp.groupby("age")["tpm"].mean()
young = tmp[tmp.age==3]['tpm'].values
old = tmp[tmp.age==22]['tpm'].values
stat, p = stats.ttest_ind(young, old)
fig, ax = plt.subplots(figsize=(7,7))

gene = "ACE2"

labels = ['3 month', "22 month"]
lidx = [1, 2]


x = [young, old]

parts = ax.violinplot(x, showmedians=False, showextrema=False)
for pcidx, pc in enumerate(parts['bodies']):
    pc.set_facecolor('#D43F3A')
    if pcidx==1: pc.set_facecolor('#1f77b4')
    pc.set_edgecolor('black')
    pc.set_alpha(1)

    
mean = [np.mean(i) for i in x]
ax.scatter(lidx, mean, marker='o', color='white', s=30, zorder=3)


######## Add some random "jitter" to the x-axis
x = np.random.normal(1, 0.04, size=len(young))
ax.scatter(x, young, alpha=1, color="k")

x = np.random.normal(2, 0.04, size=len(old))
ax.scatter(x, old, alpha=1, color="k")

##########
ax.set_xticks(lidx)
ax.set_xticklabels(labels)



ax.annotate("p={:,.4f}".format(p), (1.5, ax.get_ylim()[1]*0.02), ha="center")

ax.set_ylim(-0.1)

ax.set_ylabel("Epithelium bulk $TPMRSS2$ TPM")
plt.savefig("./figs/epi_bulk_tmprss2.png", bbox_inches='tight',dpi=300)

plt.show()
young.mean()/old.mean()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2307973664959766, 'fraction_numerical': 0.03767373811265545, 'mean_word_length': 5.670731707317073, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '240880', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1216, 'n_words': 197, 'path': 'notebooks/epi_bulk.ipynb', 'repo_name': 'pachterlab/BP_2020', 'size': '2734'}