<jupyter_start><jupyter_text>Genotype-filtered Prevalence and Interactive Area-under-curve PlotConfig: 40-yr-simu, 50,000-popu, 0.7-treatment-cvrg, DHAPPQ-ASAQ-AL-cycling<jupyter_code>import pandas as pd 
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import mpld3
from mpld3 import plugins
plt.rcParams['figure.figsize'] = [20,10]
# creating dfs from file
df1 = pd.read_csv('new-monthly_data_0.txt', sep='\t')
# scale func to show x-axis in years
scale_x = 365
ticks_x = ticker.FuncFormatter(lambda x, pos: '{0:g}'.format(x/scale_x))
# total population blood_slide_prevalence plot
fig, ax1 = plt.subplots()
ax1.plot(df1['current_time'], df1['blood_slide_prev'])
ax1.xaxis.set_major_locator(ticker.MultipleLocator(1825)) # 5-year mark
ax1.xaxis.set_major_formatter(ticks_x)
ax1.set_xlabel('years')
ax1.set_ylabel('blood slide prev')
ax1.set_title('Blood Slide Prev. Plot')
# blood slide prev w.r.t. genotype frequency
fig, ax2 = plt.subplots()
ax2.grid(True, alpha=0.3)
df1['new_bsp'] = df1['blood_slide_prev'] * df1.iloc[:,0:151].filter(regex='.....Y2.', axis=1).sum(axis=1)
ax2.plot(df1['current_time'], df1['new_bsp'])
ax2.fill_between(df1['current_time'], df1['new_bsp'], 
                 where=(df1['current_time']<30*365), alpha=0.25)
ax2.xaxis.set_major_locator(ticker.MultipleLocator(1825)) # 5-year mark
ax2.xaxis.set_major_formatter(ticks_x)
#ax1.set_xlabel('years')
#ax1.set_ylabel('blood slide prev')
#ax1.set_title('Blood Slide Prev. Plot')

np.trapz(df1.iloc[:30*12,-1])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1583011583011583, 'fraction_numerical': 0.05148005148005148, 'mean_word_length': 6.404761904761905, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '249161', 'license': 'MIT', 'n_tokens_mistral': 671, 'n_tokens_neox': 623, 'n_words': 109, 'path': 'Archives/190801-areaundercurve/.ipynb_checkpoints/interactive-area-under-curve-checkpoint.ipynb', 'repo_name': 'lizhewen/BoniLabMDR', 'size': '1554'}