Skip to content

Commit

Permalink
project name becomes TRamWAy
Browse files Browse the repository at this point in the history
  • Loading branch information
François Laurent committed Mar 30, 2017
1 parent 141065f commit 5b75f45
Show file tree
Hide file tree
Showing 52 changed files with 142 additions and 144 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# InferenceMAP
# TRamWAy

*InferenceMAP* helps analyzing single molecule dynamics. It infers the diffusivity, drift, force and potential across space and time.
*TRanWAy* helps analyzing single molecule dynamics. It infers the diffusivity, drift, force and potential across space and time. It will eventually localize and track molecules in stacks of images.

**Disclaimer:**
This implementation is under heavy development and is not yet suitable even for testing purposes!
To get the official implementation, please follow [this link](https://research.pasteur.fr/en/software/inferencemap/ "research.pasteur.fr/en/software/inferencemap").
To get similar software, please follow [this link](https://research.pasteur.fr/en/software/inferencemap/ "research.pasteur.fr/en/software/inferencemap").

The [official documentation](http://inferencemap.readthedocs.io/en/latest/) is now on [readthedocs](http://inferencemap.readthedocs.io/en/latest/).
The [official documentation](http://TRamWAy.readthedocs.io/en/latest/) is now on [readthedocs](http://TRamWAy.readthedocs.io/en/latest/).

## Installation

You will need Python >= 2.7 or >= 3.5.

git clone https://github.com/influencecell/inferencemap
cd inferencemap
git clone https://github.com/DecBayComp/TRamWAy
cd TRamWAy
pip install --user -e .

`pip install` will install some Python dependencies if missing, but you may still need to install the [HDF5 reference library](https://support.hdfgroup.org/downloads/index.html "support.hdfgroup.org/downloads").
Expand Down
6 changes: 3 additions & 3 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Reference library
=================

The :mod:`inferencemap` package is the top |inferencemap| package. It features ``if __name__ == '__main__':`` guarded code.
The :mod:`tramway` package is the top |tramway| package. It features ``if __name__ == '__main__':`` guarded code.

The recommended starting point is :mod:`inferencemap.helper`.
The recommended starting point is :mod:`tramway.helper`.

.. toctree::

Expand All @@ -17,5 +17,5 @@ The recommended starting point is :mod:`inferencemap.helper`.
inferencemap.tesselation
inferencemap.inference

.. |inferencemap| replace:: **InferenceMAP**
.. |tramway| replace:: **TRamWAy**

18 changes: 9 additions & 9 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# InferenceMAP documentation build configuration file, created by
# TRamWAy documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 24 11:46:04 2017.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -71,9 +71,9 @@ def __getattr__(cls, name):
master_doc = 'index'

# General information about the project.
project = u'InferenceMAP'
copyright = u'2017, François Laurent, Jean-Baptiste Masson'
author = u'François Laurent'
project = u'TRamWAy'
copyright = u'2017, Institut Pasteur, François Laurent, Jean-Baptiste Masson'
author = u'François Laurent, Jean-Baptiste Masson'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -225,7 +225,7 @@ def __getattr__(cls, name):
#html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'inferencemap-doc'
htmlhelp_basename = 'tramway-doc'

# -- Options for LaTeX output ---------------------------------------------

Expand All @@ -247,7 +247,7 @@ def __getattr__(cls, name):
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'InferenceMAP.tex', u'InferenceMAP Documentation',
(master_doc, 'TRamWAy.tex', u'TRamWAy Documentation',
u'François Laurent', 'manual'),
]

Expand Down Expand Up @@ -277,7 +277,7 @@ def __getattr__(cls, name):
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'inferencemap', u'InferenceMAP Documentation',
(master_doc, 'inferencemap', u'TRamWAy Documentation',
[author], 1)
]

Expand All @@ -291,8 +291,8 @@ def __getattr__(cls, name):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'InferenceMAP', u'InferenceMAP Documentation',
author, 'InferenceMAP', 'One line description of project.',
(master_doc, 'TRamWAy', u'TRamWAy Documentation',
author, 'TRamWAy', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
16 changes: 7 additions & 9 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
.. InferenceMAP documentation master file, created by
.. TRamWAy documentation master file, created by
sphinx-quickstart on Tue Jan 24 11:46:04 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
InferenceMAP documentation
TRamWAy documentation
==========================

|inferencemap| helps analyzing single molecule dynamics. It infers the diffusivity, drift, force and potential across space and time.
|tramway| helps analyzing single molecule dynamics. It infers the diffusivity, drift, force and potential across space and time.

|inferencemap| as for its stable version by now is based on Bayesian analysis of Random Walks. In addition to estimating spatial maps of physical parameters, it can generate large amounts of trajectories in the inferred maps using the master equation approximation of the Fokker-Planck describing the motion.
|tramway| as for its stable version by now is based on Bayesian analysis of Random Walks. In addition to estimating spatial maps of physical parameters, it can generate large amounts of trajectories in the inferred maps using the master equation approximation of the Fokker-Planck describing the motion.

Finally, |inferencemap| provides multiple representations of both raw data and inferred fields.
Finally, |tramway| provides multiple representations of both raw data and inferred fields.

.. warning::

This implementation is under heavy development and is not yet suitable even for testing purposes!

Most notably, the proper inference logic is not fully implemented yet!

You can get the stable version `here <https://research.pasteur.fr/en/software/inferencemap/>`_.
You can get similar software `here <https://research.pasteur.fr/en/software/inferencemap/>`_.


Where to start
Expand Down Expand Up @@ -71,5 +69,5 @@ Where to start
.. |seconds| replace:: **seconds**
.. |um| replace:: **µm**
.. in index, installation, quickstart, quickstart.concepts, quickstart.fileformats, api,
.. |inferencemap| replace:: **InferenceMAP**
.. |tramway| replace:: **TRamWAy**

10 changes: 5 additions & 5 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ You will need Python >= 2.7 or >= 3.5.

::

git clone https://github.com/influencecell/inferencemap
cd inferencemap
git clone https://github.com/DecBayComp/TRamWAy
cd tramway
pip install --user -e .

The ``-e`` option is necessary if you intend to update or modify the code and have the modifications reflected in your installed |inferencemap|.
The ``-e`` option is necessary if you intend to update or modify the code and have the modifications reflected in your installed |tramway|.

``pip install`` will install some Python dependencies if missing, but you may still need to install the `HDF5 reference library <https://support.hdfgroup.org/downloads/index.html>`_.

To compile the documentation and get a local copy, after installing |inferencemap| do::
To compile the documentation and get a local copy, after installing |tramway| do::

cd doc
make html

The generated documentation will be available at ``_build/html/index.html`` from the ``doc`` repository.

.. |inferencemap| replace:: **InferenceMAP**
.. |tramway| replace:: **TRamWAy**

12 changes: 6 additions & 6 deletions doc/quickstart.commandline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Partitioning the data points

The first step consists of tesselating the space and partitioning the data points into the cells of the tesselation::

> python -m inferencemap tesselate -h
> python -m inferencemap -i example.trxyt tesselate -m kmeans
> python -m tramway tesselate -h
> python -m tramway -i example.trxyt tesselate -m kmeans

``-h`` shows the help message for the ``tesselate`` command. ``-i`` allows to specify the tracking data file. ``-m`` allows to specify the tesselation method.

Expand All @@ -31,23 +31,23 @@ The available methods are:

A key parameter is ``--knn`` (or shorter ``-n``). It combines with any of the above methods and allows to impose a lower bound on the number of points (or nearest neighbors) associated with each cell of the mesh, independently of the way the mesh has been grown::

> python -m inferencemap -i example.trxyt tesselate -m gwr -w -n 50
> python -m tramway -i example.trxyt tesselate -m gwr -w -n 50


Visualizing the partition
-------------------------

To visualize on the screen::

> python -m inferencemap -i example.imt.h5 show-cells
> python -m tramway -i example.rwa show-cells

To print the figure in an image file::

> python -m inferencemap -i example.imt.h5 show-cells -p png
> python -m tramway -i example.rwa show-cells -p png

To overlay the Delaunay graph instead of the Voronoi graph::

> python -m inferencemap -i example.imt.h5 show-cells -D
> python -m tramway -i example.rwa show-cells -D


.. |xyt| replace:: *.xyt*
Expand Down
12 changes: 6 additions & 6 deletions doc/quickstart.concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
Concepts
========

|inferencemap| generates maps of the dynamic parameters that dictate the motion of single molecules. These parameters may include the diffusion, forces (directional biases), interaction (potential) energies and drift.
|tramway| generates maps of the dynamic parameters that dictate the motion of single molecules. These parameters may include the diffusion, forces (directional biases), interaction (potential) energies and drift.

|inferencemap| takes molecule locations or trajectories data as input.
|tramway| takes molecule locations or trajectories data as input.

A preliminary processing step before generating maps consists of segmentating space and time into cells that accomodate enough molecule locations so that the inference is made possible and, on the hand, are small enough so that relevant spatial(-temporal) variations in the dynamic parameters can be observed.

At this stage, in both the library and generated files, |inferencemap| distinguishes between several entities.
At this stage, in both the library and generated files, |tramway| distinguishes between several entities.

Tesselation and point-cell association
The tesselation that can be viewed as a graph of cells such that an edge is indicative of a neighborhood relationship between the connected cells. A tesselation may be grown from the data but is formely represented as a separate entity.
However in practical terms the tesselation is conveniently stored together with the complete dataset (or a link to it), as well as the partition of the dataset abstracted as a point-cell association.
These data are maintained together in such a collection so that the tesselation can be edited with some features that may not necessary while - for example - performing the inference.
See also the |imt| file format and the :class:`~inferencemap.tesselation.CellStats` datatype.
See also the |imt| file format and the :class:`~tramway.tesselation.CellStats` datatype.

Dynamic parameters map
The dataset is prepared again for the inference so that each cell is reified and can contain both the corresponding locations/translocations and physical parameters.
The graphical structure of the tesselation is also reflected at this stage in a simplified form so that implementing the inference is made easier.
See also the |map| file format and the :class:`~inferencemap.inference.Distributed`.
See also the |map| file format and the :class:`~tramway.inference.Distributed`.


.. |inferencemap| replace:: **InferenceMAP**
.. |tramway| replace:: **TRamWAy**
.. |imt| replace:: *.imt.h5*
.. |map| replace:: *.map.h5*

2 changes: 1 addition & 1 deletion doc/quickstart.demos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Demos
=====

The ``examples`` repository in ``inferencemap`` contains a collection of demos. You can get a list of them with the command::
The ``examples`` repository in ``tramway`` contains a collection of demos. You can get a list of them with the command::

> python -m examples -h

Expand Down
20 changes: 10 additions & 10 deletions doc/quickstart.fileformats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ File formats
Point and trajectory files
--------------------------

|inferencemap| accepts text files as input data files with |txt|, |xyt|, |trxyt| or any other extension. These text files contain numerical values organized in tab-delimited columns such that each row specifies the euclidean coordinates of the position of a molecule along with time and optionally trajectory number.
|tramway| accepts text files as input data files with |txt|, |xyt|, |trxyt| or any other extension. These text files contain numerical values organized in tab-delimited columns such that each row specifies the euclidean coordinates of the position of a molecule along with time and optionally trajectory number.

Trajectory number, if available, is the first column. Time in |seconds| is always the last columns. All the intermediate columns - usually two (`x`, `y`) or three (`x`, `y`, `z`) - are the coordinates in |um| of the position.

A single dataset can be split in several files.

Tesselation *.imt.h5* files
Tesselation *.imt.rwa* files
---------------------------

Subextension |imtalone| is not compulsory but adding any subextension is recommended.
Subextension |imtalone| is not compulsory.
In Python, a |imt| file can be loaded one at a time as follows::

from inferencemap.io import HDF5Store
from tramway.io import HDF5Store

hdf = HDF5Store(path_to_imt_file)
hdf = HDF5Store(path_to_rwa_file)
cells = hdf.peek('cells')
hdf.close

The tesselation/partition object is ``cells``.

See :class:`~inferencemap.tesselation.CellStats` for further reference information about ``cells`` structure.
See :class:`~tramway.tesselation.CellStats` for further reference information about ``cells`` structure.

Infered map *.map.h5* files
Infered map *.map.rwa* files
---------------------------

(to do)
Expand All @@ -37,9 +37,9 @@ Infered map *.map.h5* files
.. |xyt| replace:: *.xyt*
.. |trxyt| replace:: *.trxyt*
.. |imtalone| replace:: *.imt*
.. |imt| replace:: *.imt.h5*
.. |map| replace:: *.map.h5*
.. |imt| replace:: *.imt.rwa*
.. |map| replace:: *.map.rwa*
.. |seconds| replace:: **seconds**
.. |um| replace:: **µm**
.. |inferencemap| replace:: **InferenceMAP**
.. |tramway| replace:: **TRamWAy**

14 changes: 7 additions & 7 deletions doc/quickstart.helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Partitioning the tracking data

The first step consists of tesselating the space so that the point data can be partitioned in cells with an adequate number of points and spatial extent.

:mod:`inferencemap.helper.tesselation` exposes the :func:`~inferencemap.helper.tesselation.tesselate` method that be called the following way::
:mod:`tramway.helper.tesselation` exposes the :func:`~tramway.helper.tesselation.tesselate` method that be called the following way::

path_to_tracking_data = 'example.trxyt'
cells = tesselate(path_to_tracking_data, 'grid', avg_cell_count=40)
Expand Down Expand Up @@ -53,15 +53,15 @@ The above expression takes only a maximum number of points per cell. The minimum
Visualizing the partition
-------------------------

A simple command from the :mod:`inferencemap.helper.tesselation` module::
A simple command from the :mod:`tramway.helper.tesselation` module::

cell_plot(cells)

The Delaunay graph can be overlain instead of the Voronoi graph::

cell_plot(cells, xy_layer='delaunay')

Here ``cells`` can equally be a path to a |h5| tesselation file or the object returned by :func:`~inferencemap.helper.tesselation.tesselate`.
Here ``cells`` can equally be a path to a |h5| tesselation file or the object returned by :func:`~tramway.helper.tesselation.tesselate`.

The generated figure can be saved into a file instead of being shown on the screen::

Expand All @@ -77,28 +77,28 @@ Infering physical parameters

The data should first be prepared::

from inferencemap.inference import *
from tramway.inference import *

prepared_map = Distributed(cells)

For now only the diffusivity can be estimated::

diffusivity_map = inferD(prepared_map, localization_error=0.2)

See also :mod:`inferencemap.inference`.
See also :mod:`tramway.inference`.

Visualizing maps
----------------

::

from inferencemap.plot.map import *
from tramway.plot.map import *
import matplotlib.pyplot as plt

plot_scalar_2d(diffusivity_map)
plt.show()

See also :mod:`inferencemap.plot.map`.
See also :mod:`tramway.plot.map`.

.. |h5| replace:: *.h5*

6 changes: 3 additions & 3 deletions doc/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Quick Start Guide
=================

|inferencemap| is a feature-rich library written in Python. Feel free to try its :ref:`demo scripts <quickstart.demos>`.
|tramway| is a feature-rich library written in Python. Feel free to try its :ref:`demo scripts <quickstart.demos>`.

|Inferencemap| is primarily intented to be imported as a library in a Python environment (see its :ref:`high-level interface <quickstart.helpers>`).
|tramway| is primarily intented to be imported as a library in a Python environment (see its :ref:`high-level interface <quickstart.helpers>`).

It also features a :ref:`command-line interface <quickstart.commandline>` for limited usage outside of the Python language.

Expand All @@ -20,5 +20,5 @@ In both cases, you may run into :ref:`common concepts <quickstart.concepts>`. Yo
quickstart.fileformats
quickstart.helpers

.. |inferencemap| replace:: **InferenceMAP**
.. |tramway| replace:: **TRamWAy**

7 changes: 3 additions & 4 deletions examples/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
fullmatch = re.fullmatch
import importlib
#from pathlib import Path
#from inferencemap.helper.tesselation import *


def main():
Expand Down Expand Up @@ -52,9 +51,9 @@ def main():
demo = demo.replace('_', '-')
demos[demo] = module

parser = argparse.ArgumentParser(prog='inferencemap-demo', \
description='InferenceMAP demo launcher.', \
epilog='See also https://github.com/influencecell/inferencemap')
parser = argparse.ArgumentParser(prog='tramway-demo', \
description='TRamWAy demo launcher.', \
epilog='See also https://github.com/DecBayComp/TRamWAy')
#parser.add_argument('demo', choices=demos.keys())
hub = parser.add_subparsers(title='demos', \
description="type '%(prog)s demo-name --help' for additional help")
Expand Down

0 comments on commit 5b75f45

Please sign in to comment.