{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# [PyBroMo](http://tritemio.github.io/PyBroMo/) - GUI Trajectory explorer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "This notebook is part of [PyBroMo](http://tritemio.github.io/PyBroMo/) a \n", "python-based single-molecule Brownian motion diffusion simulator \n", "that simulates confocal [smFRET](http://en.wikipedia.org/wiki/Single-molecule_FRET)\n", "experiments. You can find the full list of notebooks in \n", "[Usage Examples](http://tritemio.github.io/PyBroMo/#usage-examples).\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## *Overview*\n", "\n", "*In this notebook implements an interactive 3-D trajectories visualizer. To visualize trajectories you need simulatte the trajectories first.*\n", "\n", "*For more info see [PyBroMo Homepage](http://tritemio.github.io/PyBroMo/)*." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Simulation setup" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Together with a few standard python libraries we import **PyBroMo** using the short name `pbm`. \n", "All **PyBroMo** functions will be available as `pbm.`*something*." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "import numpy as np\n", "import tables\n", "import matplotlib.pyplot as plt\n", "plt.rcParams['path.simplify_threshold'] = 1.0\n", "import pybromo as pbm\n", "print('Numpy version:', np.__version__)\n", "print('Matplotlib version:', plt.matplotlib.__version__)\n", "print('PyTables version:', tables.__version__)\n", "print('PyBroMo version:', pbm.__version__)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Load trajectories" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#SIM_DIR = r'E:\\Data\\pybromo'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "S = pbm.ParticlesSimulation.from_datafile('016') #, path=SIM_DIR)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plotting the emission" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%matplotlib qt" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "p = pbm.plotter.EmissionPlotter(S, duration=0.1, decimate=100, color_pop=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For simulations using `radial = False` (i.e. the 3D trajectories saved):" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "p = pbm.plotter.TrackEmPlotter(S, duration=0.005, decimate=20)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For simulations using `radial = True` (i.e. the z-r 2D trajectories saved):" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "p = pbm.plotter.TrackEmPlotterR(S, duration=0.01, decimate=100)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python 3.6 (py36)", "language": "python", "name": "py36" }, "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.6.0" } }, "nbformat": 4, "nbformat_minor": 1 }