Skip to content

Commit 8010cc3

Browse files
authored
Add files via upload
1 parent 3823c8c commit 8010cc3

File tree

1 file changed

+200
-0
lines changed

1 file changed

+200
-0
lines changed
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "71ea34bd",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import pandas as pd\n",
11+
"import seaborn as sns\n",
12+
"import matplotlib.pyplot as plt"
13+
]
14+
},
15+
{
16+
"cell_type": "code",
17+
"execution_count": null,
18+
"id": "3bd1661e",
19+
"metadata": {},
20+
"outputs": [],
21+
"source": [
22+
"df = pd.read_csv('FilterandFireData.csv')\n",
23+
"display(df)"
24+
]
25+
},
26+
{
27+
"cell_type": "code",
28+
"execution_count": null,
29+
"id": "4887ed3c",
30+
"metadata": {},
31+
"outputs": [],
32+
"source": [
33+
"#extract those with 40ms to specifically extract the data\n",
34+
"forty_time = five_connections[five_connections['Time'] == 40]\n",
35+
"display(forty_time)"
36+
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": null,
41+
"id": "ced5f652",
42+
"metadata": {},
43+
"outputs": [],
44+
"source": [
45+
"#barplot\n",
46+
"mean_accuracies = forty_time.groupby('digit')['Accuracy.FF'].mean()\n",
47+
"plt.figure(figsize=(10, 6)) # for changing the figure size\n",
48+
"mean_accuracies.plot(kind='bar', color= 'green')\n",
49+
"plt.title('Mean Accuracy for Each Digit (0-9)')\n",
50+
"plt.xlabel('Digits')\n",
51+
"plt.ylabel('Mean Accuracy.FF')\n",
52+
"plt.ylim(85,100) \n",
53+
"plt.grid(axis='y')\n",
54+
"plt.show()"
55+
]
56+
},
57+
{
58+
"cell_type": "code",
59+
"execution_count": null,
60+
"id": "e09f0511",
61+
"metadata": {},
62+
"outputs": [],
63+
"source": [
64+
"#boxplot\n",
65+
"plt.figure(figsize=(10,6))\n",
66+
"#df.boxplot(column='Accuracy.FF', by='digit', grid = False)\n",
67+
"sns.boxplot(x='digit', y='Accuracy.FF', data=df, palette='pastel')\n",
68+
"plt.title('Boxplot of Accuracy for Each Digit (0-9)')\n",
69+
"plt.suptitle('') # Suppress the default title to avoid duplication\n",
70+
"plt.xlabel('Digits')\n",
71+
"plt.ylabel('Accuracy.FF')\n",
72+
"plt.ylim(85, 100) # Set the y-axis range\n",
73+
"plt.grid(axis='y')\n",
74+
"plt.grid(axis='x')\n",
75+
"plt.show()"
76+
]
77+
},
78+
{
79+
"cell_type": "code",
80+
"execution_count": null,
81+
"id": "915a4518",
82+
"metadata": {},
83+
"outputs": [],
84+
"source": [
85+
"#histogram\n",
86+
"plt.figure(figsize=(10, 6))\n",
87+
"plt.hist(digit_9['Accuracy.FF'], bins=20, color='skyblue', edgecolor='black')\n",
88+
"plt.title('Histogram of Accuracy')\n",
89+
"plt.xlabel('Accuracy')\n",
90+
"plt.ylabel('Frequency')\n",
91+
"plt.grid(axis='y')\n",
92+
"plt.show()"
93+
]
94+
},
95+
{
96+
"cell_type": "code",
97+
"execution_count": null,
98+
"id": "3dfdeb10",
99+
"metadata": {},
100+
"outputs": [],
101+
"source": [
102+
"#violin plot\n",
103+
"plt.figure(figsize=(10,6))\n",
104+
"sns.violinplot(x='digit', y='Accuracy.FF', data=df, inner=\"quartile\", palette='pastel')\n",
105+
"plt.title('Violin Plot of Accuracy for Each Digit (0-9)')\n",
106+
"plt.xlabel('Digits')\n",
107+
"plt.ylabel('Accuracy')\n",
108+
"plt.show()"
109+
]
110+
},
111+
{
112+
"cell_type": "code",
113+
"execution_count": null,
114+
"id": "6941a7ce",
115+
"metadata": {},
116+
"outputs": [],
117+
"source": [
118+
"genes_data = pd.read_csv('heatmapExpressionData.csv')\n",
119+
"display(genes_data)\n",
120+
"genes = genes_data"
121+
]
122+
},
123+
{
124+
"cell_type": "code",
125+
"execution_count": null,
126+
"id": "33e310ca",
127+
"metadata": {},
128+
"outputs": [],
129+
"source": [
130+
"genes.set_index('GeneName', inplace=True)\n",
131+
"\n",
132+
"#heatmap\n",
133+
"plt.figure(figsize=(12, 8)) #figsize 25,30 adequate to display all genes here\n",
134+
"sns.heatmap(genes, cmap='viridis',linewidths=0.5) #,yticklabels=True \n",
135+
"plt.title('Heatmap of Gene Expression Data')\n",
136+
"plt.xlabel('Samples')\n",
137+
"plt.ylabel('Genes')\n",
138+
"plt.show()"
139+
]
140+
},
141+
{
142+
"cell_type": "code",
143+
"execution_count": null,
144+
"id": "9521c6be",
145+
"metadata": {},
146+
"outputs": [],
147+
"source": [
148+
"plt.figure(figsize=(10, 6))\n",
149+
"sns.scatterplot(x='NAc1', y='NAc4', data=genes)\n",
150+
"plt.title('Scatter Plot of Gene Expression')\n",
151+
"plt.grid(True)\n",
152+
"\n",
153+
"plt.show()"
154+
]
155+
},
156+
{
157+
"cell_type": "code",
158+
"execution_count": null,
159+
"id": "b2865082",
160+
"metadata": {},
161+
"outputs": [],
162+
"source": [
163+
"transposed_genes = genes.set_index('GeneName').transpose()\n",
164+
"\n",
165+
"# Plot a line plot of the gene expression data\n",
166+
"plt.figure(figsize=(12, 8))\n",
167+
"#for gene in transposed_genes.columns:\n",
168+
" #plt.plot(transposed_genes.index, transposed_genes[gene], label=gene)\n",
169+
"transposed_genes.plot(legend=False, alpha=0.5)\n",
170+
"plt.title('Line Plot of Gene Expression Data')\n",
171+
"plt.xlabel('Samples')\n",
172+
"plt.ylabel('Gene Expression')\n",
173+
"#plt.legend(loc='upper right', bbox_to_anchor=(1.25, 1))\n",
174+
"#plt.grid(True)\n",
175+
"plt.show()"
176+
]
177+
}
178+
],
179+
"metadata": {
180+
"kernelspec": {
181+
"display_name": "Python 3 (ipykernel)",
182+
"language": "python",
183+
"name": "python3"
184+
},
185+
"language_info": {
186+
"codemirror_mode": {
187+
"name": "ipython",
188+
"version": 3
189+
},
190+
"file_extension": ".py",
191+
"mimetype": "text/x-python",
192+
"name": "python",
193+
"nbconvert_exporter": "python",
194+
"pygments_lexer": "ipython3",
195+
"version": "3.9.12"
196+
}
197+
},
198+
"nbformat": 4,
199+
"nbformat_minor": 5
200+
}

0 commit comments

Comments
 (0)