Skip to content

Commit 5870a35

Browse files
committed
Adding the notebook.
1 parent 5e636f2 commit 5870a35

1 file changed

Lines changed: 138 additions & 0 deletions

File tree

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "74a45bfa-2af5-4a9d-9285-84f34a82d986",
6+
"metadata": {},
7+
"source": [
8+
"# Ag3"
9+
]
10+
},
11+
{
12+
"cell_type": "code",
13+
"execution_count": null,
14+
"id": "a46f23bf-2635-4249-b115-aa8cfd35d33f",
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"import malariagen_data\n",
19+
"\n",
20+
"ag3 = malariagen_data.Ag3(\n",
21+
" \"simplecache::gs://vo_agam_release_master_us_central1\",\n",
22+
" simplecache=dict(cache_storage=\"../gcs_cache\"),\n",
23+
" cohorts_analysis=\"20230516\",\n",
24+
")\n",
25+
"ag3"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": null,
31+
"id": "8130522f-98de-463f-83fd-a1c1c460e00e",
32+
"metadata": {},
33+
"outputs": [],
34+
"source": [
35+
"hap_df = ag3.haplotypes_frequencies(\"2L:2,358,158-2,431,617\", \"admin1_year\", sample_sets=(\"AG1000G-BF-A\", \"AG1000G-BF-B\", \"AG1000G-BF-C\"))\n",
36+
"hap_df"
37+
]
38+
},
39+
{
40+
"cell_type": "code",
41+
"execution_count": null,
42+
"id": "2cefad62-e558-4797-9d1a-4b501ad364b0",
43+
"metadata": {},
44+
"outputs": [],
45+
"source": [
46+
"ag3.plot_frequencies_heatmap(hap_df.query(\"max_af > .05\"))"
47+
]
48+
},
49+
{
50+
"cell_type": "code",
51+
"execution_count": null,
52+
"id": "6bac8aca-8835-43b7-84c0-f6eb62594d91",
53+
"metadata": {},
54+
"outputs": [],
55+
"source": [
56+
"hap_xr = ag3.haplotypes_frequencies_advanced(region=\"2L:2,358,158-2,431,617\", area_by=\"admin1_iso\", period_by=\"year\", sample_sets = [\"AG1000G-BF-A\", \"AG1000G-BF-B\"])"
57+
]
58+
},
59+
{
60+
"cell_type": "code",
61+
"execution_count": null,
62+
"id": "2770b59a-6b6d-4458-99cf-cdf08e47ddac",
63+
"metadata": {},
64+
"outputs": [],
65+
"source": [
66+
"ag3.plot_frequencies_time_series(hap_xr)"
67+
]
68+
},
69+
{
70+
"cell_type": "markdown",
71+
"id": "a771fda2-ae68-46bc-b38e-2f4ba6b41b71",
72+
"metadata": {},
73+
"source": [
74+
"# Af1"
75+
]
76+
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": null,
80+
"id": "415cc454-ffdd-4bff-8881-95180bcf66f6",
81+
"metadata": {},
82+
"outputs": [],
83+
"source": [
84+
"af1 = malariagen_data.Af1(\n",
85+
" \"simplecache::gs://vo_afun_release_master_us_central1\",\n",
86+
" simplecache=dict(cache_storage=\"../gcs_cache\"),\n",
87+
")\n",
88+
"af1"
89+
]
90+
},
91+
{
92+
"cell_type": "code",
93+
"execution_count": null,
94+
"id": "5d8fb2b5-5b49-4856-8e1c-895174e32f04",
95+
"metadata": {},
96+
"outputs": [],
97+
"source": [
98+
"hap_xr = af1.haplotypes_frequencies_advanced(\n",
99+
" region=\"2RL:2,358,158-2,431,617\",\n",
100+
" area_by=\"admin1_iso\",\n",
101+
" period_by=\"year\",\n",
102+
" sample_sets=[\"1232-VO-KE-OCHOMO-VMF00044\"],\n",
103+
" min_cohort_size=10,\n",
104+
")\n",
105+
"ag3.plot_frequencies_time_series(hap_xr)"
106+
]
107+
},
108+
{
109+
"cell_type": "code",
110+
"execution_count": null,
111+
"id": "ef2cb769-4a8d-49fe-8e28-c9dc1af0159d",
112+
"metadata": {},
113+
"outputs": [],
114+
"source": []
115+
}
116+
],
117+
"metadata": {
118+
"kernelspec": {
119+
"display_name": "Python 3 (ipykernel)",
120+
"language": "python",
121+
"name": "python3"
122+
},
123+
"language_info": {
124+
"codemirror_mode": {
125+
"name": "ipython",
126+
"version": 3
127+
},
128+
"file_extension": ".py",
129+
"mimetype": "text/x-python",
130+
"name": "python",
131+
"nbconvert_exporter": "python",
132+
"pygments_lexer": "ipython3",
133+
"version": "3.10.11"
134+
}
135+
},
136+
"nbformat": 4,
137+
"nbformat_minor": 5
138+
}

0 commit comments

Comments
 (0)