{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "fname = 'data/pax-2017-07-11_06_12d_22d_mix_D200mW_A400mW.hdf5'" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'2017-07-11_06_12d_22d'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pathlib import Path\n", "fname = Path(fname)\n", "assert fname.is_file(), 'File not found.'\n", "\n", "mlabel = '_'.join(fname.stem.replace('pax-', '').replace('alex-', '').split('_')[:4])\n", "mlabel" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Thu Oct 5 16:11:59 PDT 2017\r\n" ] } ], "source": [ "!date" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Imports" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/anto/miniconda3/envs/py36/lib/python3.6/site-packages/seaborn/apionly.py:6: UserWarning: As seaborn no longer sets a default style on import, the seaborn.apionly module is deprecated. It will be removed in a future version.\n", " warnings.warn(msg, UserWarning)\n" ] } ], "source": [ "import os\n", "from pathlib import Path\n", "import numpy as np\n", "from IPython.display import display, HTML, Math\n", "import pandas as pd\n", "import matplotlib as mpl\n", "mpl.rcParams['font.sans-serif'].insert(0, 'Arial')\n", "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "from heatmap import heatmap48, spotsh, spotsv\n", "import pybroom as br" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " - Optimized (cython) burst search loaded.\n", " - Optimized (cython) photon counting loaded.\n", "--------------------------------------------------------------\n", " You are running FRETBursts (version 0.6.5).\n", "\n", " If you use this software please cite the following paper:\n", "\n", " FRETBursts: An Open Source Toolkit for Analysis of Freely-Diffusing Single-Molecule FRET\n", " Ingargiola et al. (2016). http://dx.doi.org/10.1371/journal.pone.0160716 \n", "\n", "--------------------------------------------------------------\n" ] } ], "source": [ "from fretbursts import *" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": true }, "outputs": [], "source": [ "sns = init_notebook(apionly=True)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": true }, "outputs": [], "source": [ "plt.rcParams['font.size'] = 14" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%config InlineBackend.figure_format = 'retina'" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# Instead of importing, \"load\" some utility functions using `%run -i`.\n", "# This gives these functions access to variables defined in the notebok (e.g. mlabel).\n", "# Defines: savefig, save_name, info_html, cal_phrate, make_df_spots, make_df_bursts\n", "# cal_phrate_alex, make_df_bursts_alex\n", "%run -i utils.py " ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": true }, "outputs": [], "source": [ "plot_timetraces = True\n", "skip_ch = (12, 13)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": true }, "outputs": [], "source": [ "save_figures = True\n", "savefigdir = 'figures'\n", "highres = True" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Load Data" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": true }, "outputs": [], "source": [ "d = loader.photon_hdf5(str(fname), ondisk=True)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "12d ~6nM 22d ~620pM\n", "12d:22d mixed 1:2, then diluted 10x\n", "same gasket as measurement 5\n", "powers: D200mW_A400mW\n", "