Skip to main content

Light Mastodon project file reader for Python

Project description

Light Mastodon Reader for Python

This is a lighter version of Mastodon Reader for Python from Chrisoph Sommer.

Import the spots and links tables, features, tags and meta data from a Mastodon project file.

Ported to Python from: matlab-mastodon-importer

This reader is lighter mainly because it does not depend on pandas nor on networkx and it therefore only depends on numpy.

Example

Read the mastodon file:

from micromastodonreader import MicroMastodonReader

mr = MicroMastodonReader("demo/demo.mastodon")

# show meta data
meta_data = mr.read_metadata()

# read spot and link tables with features and tags columns
spots, links, tag_definition, features = mr.read(tags=True, features=True)

spots is a numpy.ndarray where:

  • spots[int_id] is the cell with id int_id
  • spots[int_id, 0] is the x coordinate of the cell int_id
  • spots[int_id, 1] is the y coordinate of the cell int_id
  • spots[int_id, 2] is the z coordinate of the cell int_id
  • spots[int_id, 3] is the time of the cell int_id
  • spots[int_id, 3:10] are the values of the elongation matrix representing the cell int_id sphere
  • spots[int_id, 10] is the bsrs (??) of int_id

links is a numpy.ndarray where:

  • links[int_pos] is an edge
  • links[int_pos, 2] is the id of the edge
  • links[int_pos, 0] is the id of the cell at time t
  • links[int_pos, 1] is the id of the cell at time t + 1

tag_definition and features are a bit more complicated 🫠

You can also read information separately

# read only spot and link tables
spots, links = mr.read_tables()

# read tag_definition
tag_definition = mr.read_tags()

# read features
mr.read_features()

Installation

Current version

pip install git+git://github.com/GuignardLab/python-mastodon-importer-light

pip

pip install micro-mastodon-reader

more information on PyPi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micro_mastodon_reader-1.1.1.tar.gz (377.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

micro_mastodon_reader-1.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file micro_mastodon_reader-1.1.1.tar.gz.

File metadata

  • Download URL: micro_mastodon_reader-1.1.1.tar.gz
  • Upload date:
  • Size: 377.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for micro_mastodon_reader-1.1.1.tar.gz
Algorithm Hash digest
SHA256 8136b3079b956746cbc5a5121f7df5e872c94eabdd7e00c5f23a568dbff921c6
MD5 e2d6f9e51801ed199d12730b24d3d4d0
BLAKE2b-256 f4eef01771e11bc1401288c5af8ad7d55c09501e9e34b65c7195f50026cdba8e

See more details on using hashes here.

File details

Details for the file micro_mastodon_reader-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for micro_mastodon_reader-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 baa9d16542770dec0a8c12daa5dd6f8d5ea8f56508706c6b4309c5508b8cf9a7
MD5 ef2c033fda1c44aea0569d8fc49231f1
BLAKE2b-256 039df79e681f33353cb2d7e14643efcc5d745fbed5a8d266b74f33528ebbc039

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page