molyso.mm package

MM Module, contains Mother Machine analysis specific functionality.

molyso.mm.cell_detection module

documentation

class molyso.mm.cell_detection.Cell(top, bottom, channel)[source]

Bases: object

A Cell.

Parameters:
  • top – coordinate of the ‘top’ of the cell, in channel coordinates
  • bottom – coordinate of the ‘bottom’ of the cell, in channel coordinates
  • channel – Channel object the cell belongs to
bottom

Returns the absolute (on rotated image) coordinate of the cell bottom.

Returns:
cell_image

The cell image, cropped out of the channel image.

Returns:image
Return type:numpy.ndarray
centroid

Returns the (absolute coordinate on rotated image) centroid (2D). :return: :rtype: list

centroid_1d

Returns the (one dimensional) (absolute coordinate on rotated image) centroid. :return: centroid :rtype: float

channel
crop_out_of_channel_image(channel_image)[source]

Crops the clel out of a provided image. Used internally for Cell.cell_image(), and to crop cells out of fluorescence channel images.

Parameters:channel_image (numpy.ndarray) –
Returns:image
Return type:numpy.ndarray
length

Returns the cell length.

Returns:length
local_bottom
local_top
top

Returns the absolute (on rotated image) coordinate of the cell top.

Returns:top
class molyso.mm.cell_detection.Cells(channel, bootstrap=True)[source]

Bases: object

A Cells object, a collection of Cell objects.

cell_type

alias of Cell

cells_list
centroids

Returns the centroids of the cells.

Returns:centroids
Return type:list
channel
clean()[source]

Performs clean-up.

nearest_tree
molyso.mm.cell_detection.find_cells_in_channel(image)[source]
molyso.mm.cell_detection.find_cells_in_channel_classic(image)[source]
Parameters:image
Returns:

molyso.mm.channel_detection module

documentation

class molyso.mm.channel_detection.Channel(image, left, right, top, bottom)[source]

Bases: object

Parameters:
  • image
  • left
  • right
  • top
  • bottom
bottom
Returns:
cells
cells_type

alias of molyso.mm.cell_detection.Cells

centroid
Returns:
channel_image
clean()[source]

Peforms clean up routines.

crop_out_of_image(image)[source]
Parameters:image
Returns:
detect_cells()[source]

Performs Cell detection (by instantiating a Cells object).

get_coordinates()[source]
Returns:
image
left
putative_orientation
real_bottom
real_top
right
top
Returns:
class molyso.mm.channel_detection.Channels(image, bootstrap=True)[source]

Bases: object

docstring

align_with_and_return_indices(other_channels)[source]
Parameters:other_channels
Returns:
centroids
Returns:
channel_type

alias of Channel

channels_list
clean()[source]

Performs clean up routines.

find_nearest(pos)[source]
Parameters:pos
Returns:
image
nearest_tree
molyso.mm.channel_detection.alternate_vertical_channel_region_detection(image)[source]
Parameters:image
Returns:
molyso.mm.channel_detection.find_channels(image)[source]

channel finder :param image: :return:

molyso.mm.channel_detection.horizontal_channel_detection(image)[source]

@param image: @return:

molyso.mm.channel_detection.vertical_channel_region_detection(image)[source]
Parameters:image
Returns:

molyso.mm.fluorescence module

molyso.mm.highlevel module

molyso.mm.highlevel_interactive_ground_truth module

documentation

molyso.mm.highlevel_interactive_ground_truth.interactive_ground_truth_main(args, tracked_results)[source]

Ground truth mode entry function.

Parameters:
  • args
  • tracked_results
Returns:

raise SystemExit:
 

molyso.mm.highlevel_interactive_viewer module

documentation

molyso.mm.highlevel_interactive_viewer.interactive_main(args)[source]
Parameters:args
Raises:SystemExit

molyso.mm.image module

molyso.mm.tracking module

documentation

class molyso.mm.tracking.TrackedPosition[source]

Bases: object

A TrackedPosition object contains various CellTracker objects for each channel within a multipoint position, as well as other information associated with the position.

align_channels(progress_indicator=<callable_iterator object>)[source]
Parameters:progress_indicator
find_first_valid_time()[source]

Finds the first valid time point for the position.

get_tracking_work_size()[source]
Returns:
guess_channel_orientation()[source]

Tries to guess the channel orientation. 1 if the closed end (‘mother side’) is the high coordinates, -1 if low …

logger
perform_everything(times)[source]
Parameters:times
Returns:
perform_tracking(progress_indicator=<callable_iterator object>)[source]
Parameters:progress_indicator
remove_empty_channels()[source]

Removes empty channels from the data set.

remove_empty_channels_post_tracking()[source]

Removes empty channels after tracking.

set_times(times)[source]
Parameters:times
molyso.mm.tracking.analyse_cell_fates(tracker, previous_cells, current_cells)[source]
Parameters:
  • tracker
  • previous_cells
  • current_cells
Returns:

molyso.mm.tracking.each_k_tracking_tracker_channels_in_results(tracking)[source]
Parameters:tracking
molyso.mm.tracking.each_pos_k_tracking_tracker_channels_in_results(inner_tracked_results)[source]
Parameters:inner_tracked_results

molyso.mm.tracking_infrastructure module

This module contains cell tracking infrastructure.

class molyso.mm.tracking_infrastructure.CellCrossingCheckingGlobalDuoOptimizerQueue[source]

Bases: object

add_outcome(cost, involved_a, involved_b, what)[source]
Parameters:
  • cost
  • involved_a
  • involved_b
  • what
Returns:

perform_optimal()[source]
Returns:
class molyso.mm.tracking_infrastructure.CellTracker[source]

Bases: object

The CellTracker contains all tracks of a channel.

all_tracked_cells
average_cells

Returns the average count of cells present in this tracked channel.

Returns:
get_cell_by_observation(where)[source]

Returns the associated cell by its observation.

Parameters:where
Returns:
is_tracked(cell)[source]

Returns whether the cell is tracked.

Parameters:cell
Returns:
new_cell()[source]

Creates a new TrackedCell object associated with this tracker.

Returns:
new_observed_cell(where)[source]

Creates a new TrackedCell object, with added observation.

Parameters:where
Returns:
new_observed_origin(where)[source]

Creates a new TrackedCell object and adds it as an origin, with added observation. :param where: :return:

new_origin()[source]

Creates a new TrackedCell object and adds it as an origin.

Returns:
origins
tick()[source]

Ticks the clock. Sets the internal timepoint counter forward by one.

timepoints
class molyso.mm.tracking_infrastructure.TrackedCell(tracker)[source]

Bases: object

Parameters:tracker
add_child(tcell)[source]
Parameters:tcell
Returns:
add_children(*children)[source]
Parameters:children
add_observation(cell)[source]
Parameters:cell
Returns:
children
elongation_rates
Returns:
parent
raw_elongation_rates
raw_trajectories
seen_as
tracker
trajectories
Returns:
ultimate_parent
Returns:
molyso.mm.tracking_infrastructure.to_list(x)[source]
Parameters:x
Returns:

molyso.mm.tracking_output module

documentation

molyso.mm.tracking_output.analyze_tracking(cells, receptor, meta=None)[source]
Parameters:
  • meta
  • cells
  • receptor
molyso.mm.tracking_output.catch_attribute_error(what, otherwise)[source]

runs callable ‘what’ and catches AttributeError, returning ‘otherwise’ if one occurred :param what: callable :param otherwise: alternate result in case of IndexError :return: result of ‘what’ or ‘otherwise’ in case of IndexError

molyso.mm.tracking_output.catch_index_error(what, otherwise)[source]

runs callable ‘what’ and catches IndexErrors, returning ‘otherwise’ if one occurred :param what: callable :param otherwise: alternate result in case of IndexError :return: result of ‘what’ or ‘otherwise’ in case of IndexError

molyso.mm.tracking_output.get_object_unique_id(obj)[source]
Parameters:obj
Returns:
molyso.mm.tracking_output.iterate_over_cells(cells)[source]
Parameters:cells
Returns:
molyso.mm.tracking_output.plot_timeline(p, channels, cells, figure_presetup=None, figure_finished=None, show_images=True, show_overlay=True, leave_open=False)[source]
Parameters:
  • p
  • channels
  • cells
  • figure_presetup
  • figure_finished
  • show_images
  • show_overlay
  • leave_open
molyso.mm.tracking_output.s_to_h(s)[source]

converts seconds to hours :param s: seconds :return: hours

molyso.mm.tracking_output.s_to_h_str(s, *args, **kwargs)[source]

converts seconds to hours as a rounded string :param s: seconds :return: hours :param s: seconds :return: hours string

molyso.mm.tracking_output.tracker_to_cell_list(tracker)[source]
Parameters:tracker
Returns: