Skip to content

Commit 084bef7

Browse files
committed
Created XDE notebook for testing
1 parent 406ad1b commit 084bef7

File tree

5 files changed

+213
-0
lines changed

5 files changed

+213
-0
lines changed

notebooks/Tricahue_XDE.ipynb

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 21,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import tricahue\n",
10+
"import pandas as pd"
11+
]
12+
},
13+
{
14+
"cell_type": "markdown",
15+
"metadata": {},
16+
"source": [
17+
"# XDE Test"
18+
]
19+
},
20+
{
21+
"cell_type": "code",
22+
"execution_count": 22,
23+
"metadata": {},
24+
"outputs": [],
25+
"source": [
26+
"files = [\"C:/Users/smf12/SPUR/Tricahue/tests/test_files/ExpNOTs_GFP.xlsx\", \"C:/Users/smf12/SPUR/Tricahue/tests/test_files/ExpNOTs_GFP_trans.xlsx\"]\n",
27+
"sheet_name = \"Table All Cycles\"\n",
28+
"time_col_name = \"Time\"\n",
29+
"data_cols_offset = 11\n",
30+
"\n",
31+
"XDC_file_name = \"C:/Users/smf12/SPUR/Tricahue/tests/test_files/xperimental_data_connector_template.xlsx\""
32+
]
33+
},
34+
{
35+
"cell_type": "code",
36+
"execution_count": 23,
37+
"metadata": {},
38+
"outputs": [],
39+
"source": [
40+
"# initialize\n",
41+
"xde = tricahue.XDE()"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 24,
47+
"metadata": {},
48+
"outputs": [],
49+
"source": [
50+
"sample_list = xde.generateSampleData(files, sheet_name, time_col_name, data_cols_offset)\n",
51+
"# sample_list"
52+
]
53+
},
54+
{
55+
"cell_type": "code",
56+
"execution_count": 25,
57+
"metadata": {},
58+
"outputs": [
59+
{
60+
"name": "stdout",
61+
"output_type": "stream",
62+
"text": [
63+
"['C:/Users/smf12/SPUR/Tricahue/tests/test_files/ExpNOTs_GFP.xlsx', 'C:/Users/smf12/SPUR/Tricahue/tests/test_files/ExpNOTs_GFP_trans.xlsx']\n"
64+
]
65+
}
66+
],
67+
"source": [
68+
"output_df = xde.buildFinalDF(files,\n",
69+
" sample_list, \n",
70+
" time_col_name, \n",
71+
" data_cols_offset, \n",
72+
" num_rows_btwn_data=0, \n",
73+
" sheet_to_read_from=sheet_name)\n",
74+
"# output_df.head()"
75+
]
76+
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": 26,
80+
"metadata": {},
81+
"outputs": [],
82+
"source": [
83+
"xde.writeToMeasurements(XDC_file_name, output_df)"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": 27,
89+
"metadata": {},
90+
"outputs": [
91+
{
92+
"data": {
93+
"text/html": [
94+
"<div>\n",
95+
"<style scoped>\n",
96+
" .dataframe tbody tr th:only-of-type {\n",
97+
" vertical-align: middle;\n",
98+
" }\n",
99+
"\n",
100+
" .dataframe tbody tr th {\n",
101+
" vertical-align: top;\n",
102+
" }\n",
103+
"\n",
104+
" .dataframe thead th {\n",
105+
" text-align: right;\n",
106+
" }\n",
107+
"</style>\n",
108+
"<table border=\"1\" class=\"dataframe\">\n",
109+
" <thead>\n",
110+
" <tr style=\"text-align: right;\">\n",
111+
" <th></th>\n",
112+
" <th>Measurement ID</th>\n",
113+
" <th>Sample ID</th>\n",
114+
" <th>Signal ID</th>\n",
115+
" <th>Time</th>\n",
116+
" <th>Value</th>\n",
117+
" </tr>\n",
118+
" </thead>\n",
119+
" <tbody>\n",
120+
" <tr>\n",
121+
" <th>0</th>\n",
122+
" <td>Measurement0</td>\n",
123+
" <td>Sample1</td>\n",
124+
" <td>Signal1</td>\n",
125+
" <td>0 h</td>\n",
126+
" <td>740</td>\n",
127+
" </tr>\n",
128+
" <tr>\n",
129+
" <th>1</th>\n",
130+
" <td>Measurement1</td>\n",
131+
" <td>Sample1</td>\n",
132+
" <td>Signal1</td>\n",
133+
" <td>0 h 4 min</td>\n",
134+
" <td>754</td>\n",
135+
" </tr>\n",
136+
" <tr>\n",
137+
" <th>2</th>\n",
138+
" <td>Measurement2</td>\n",
139+
" <td>Sample1</td>\n",
140+
" <td>Signal1</td>\n",
141+
" <td>0 h 8 min</td>\n",
142+
" <td>770</td>\n",
143+
" </tr>\n",
144+
" <tr>\n",
145+
" <th>3</th>\n",
146+
" <td>Measurement3</td>\n",
147+
" <td>Sample1</td>\n",
148+
" <td>Signal1</td>\n",
149+
" <td>0 h 12 min</td>\n",
150+
" <td>773</td>\n",
151+
" </tr>\n",
152+
" <tr>\n",
153+
" <th>4</th>\n",
154+
" <td>Measurement4</td>\n",
155+
" <td>Sample1</td>\n",
156+
" <td>Signal1</td>\n",
157+
" <td>0 h 16 min</td>\n",
158+
" <td>777</td>\n",
159+
" </tr>\n",
160+
" </tbody>\n",
161+
"</table>\n",
162+
"</div>"
163+
],
164+
"text/plain": [
165+
" Measurement ID Sample ID Signal ID Time Value\n",
166+
"0 Measurement0 Sample1 Signal1 0 h 740\n",
167+
"1 Measurement1 Sample1 Signal1 0 h 4 min 754\n",
168+
"2 Measurement2 Sample1 Signal1 0 h 8 min 770\n",
169+
"3 Measurement3 Sample1 Signal1 0 h 12 min 773\n",
170+
"4 Measurement4 Sample1 Signal1 0 h 16 min 777"
171+
]
172+
},
173+
"execution_count": 27,
174+
"metadata": {},
175+
"output_type": "execute_result"
176+
}
177+
],
178+
"source": [
179+
"xls = pd.ExcelFile(XDC_file_name)\n",
180+
"measurement = pd.read_excel(xls, 'Measurement')\n",
181+
"measurement.head()"
182+
]
183+
},
184+
{
185+
"cell_type": "markdown",
186+
"metadata": {},
187+
"source": [
188+
"# End"
189+
]
190+
}
191+
],
192+
"metadata": {
193+
"kernelspec": {
194+
"display_name": ".venv",
195+
"language": "python",
196+
"name": "python3"
197+
},
198+
"language_info": {
199+
"codemirror_mode": {
200+
"name": "ipython",
201+
"version": 3
202+
},
203+
"file_extension": ".py",
204+
"mimetype": "text/x-python",
205+
"name": "python",
206+
"nbconvert_exporter": "python",
207+
"pygments_lexer": "ipython3",
208+
"version": "3.9.13"
209+
}
210+
},
211+
"nbformat": 4,
212+
"nbformat_minor": 2
213+
}

tests/test_files/ExpNOTs_GFP.xlsx

285 KB
Binary file not shown.
561 KB
Binary file not shown.

tests/test_files/ExpNOTs_OD.xlsx

361 KB
Binary file not shown.
816 KB
Binary file not shown.

0 commit comments

Comments
 (0)