119 lines
45 KiB
Plaintext
119 lines
45 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"id": "a540c86a-3bed-4543-b952-342c796d7507",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import numpy as np\n",
|
||
|
"import pandas as pd\n",
|
||
|
"import seaborn as sns\n",
|
||
|
"import matplotlib.pyplot as plt"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"id": "dc1ec4fb-4073-4d32-887f-e488ef0a9437",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"t = np.arange(0,45)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"id": "74ff2c1e-6c77-4aef-a26f-e86e5b1ce2d8",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# create signal\n",
|
||
|
"sig = -3*np.ones((6,45))\n",
|
||
|
"for rownum, start in enumerate([15,12,16,2,14,100]):\n",
|
||
|
" sig[rownum,start:] = 0"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"id": "fdc289c2-b05f-4851-9fb2-01a7bda5dd5f",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# create measurement\n",
|
||
|
"meas = np.ones((6,45))\n",
|
||
|
"data2 = {'well':[], 'cycle': [], 'fluorescence': []}\n",
|
||
|
"data = {}\n",
|
||
|
"for row in range(6):\n",
|
||
|
" value = sig[row,0]\n",
|
||
|
" for col in range(45):\n",
|
||
|
" diff = sig[row,col] - value\n",
|
||
|
" value += 0.4*diff\n",
|
||
|
" meas[row,col] = value\n",
|
||
|
" data2['well'].append('well {}'.format(row+1))\n",
|
||
|
" data2['cycle'].append(col)\n",
|
||
|
" data2['fluorescence'].append(value)\n",
|
||
|
" data[f'well {row}'] = meas[row]\n",
|
||
|
"data[f'cycle'] = t\n",
|
||
|
"df = pd.DataFrame(data2)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"id": "6e5b1731-6d98-41dd-8a38-f8c168aeaace",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkMAAAGwCAYAAACq12GxAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB/OElEQVR4nO3deXxU9dX48c+dNfsCCVkgEFYhsi8KWkhwA7S4tValj0pbKbYgIFXR+qhYF1yoRaVF7Y8Hpa5tKVZaF2g1UQSULYCIbAYIhEAC2Ulmvb8/JjMhJpmZJDfMHXLeL+eVzOTmzjdMTE7OPd9zFFVVVYQQQgghOilDqBcghBBCCBFKEgwJIYQQolOTYEgIIYQQnZoEQ0IIIYTo1CQYEkIIIUSnJsGQEEIIITo1CYaEEEII0amZQr0AvXO73RQVFREbG4uiKKFejhBCCCGCoKoqVVVVpKenYzD4z/1IMBRAUVERGRkZoV6GEEIIIdqgsLCQHj16+D1GgqEAYmNjAc8/ZlxcXIhXI4QQQohgVFZWkpGR4fs97o8EQwF4L43FxcVJMCSEEEKEmWBKXKSAWgghhBCdmgRDQgghhOjUJBgSQgghRKcmwZAQQgghOjUJhoQQQgjRqUkwJIQQQohOTYIhIYQQQnRqEgwJIYQQolOTYEgIIYQQnZoEQ0IIIYTo1MIuGPrTn/5E7969iYiIYNSoUXz++ed+j8/Ly2PUqFFERETQp08fXn755XO0UiGEEEKEg7AKht59913mzZvHQw89xPbt2xk/fjxTpkzhyJEjzR5fUFDA1Vdfzfj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aL
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"sns.lineplot(data=df, x=\"cycle\", y=\"fluorescence\", hue=\"well\");\n",
|
||
|
"plt.savefig(\"pcr_results.png\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 9,
|
||
|
"id": "841e114f-dd6d-4136-a093-8070a3069643",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"df.to_csv('pcr_sample_1.csv', index=False)"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3 (ipykernel)",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.11.10"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 5
|
||
|
}
|