https://github.com/bluebrain/morphology-workflows

Workflows used for morphology processing.

https://github.com/bluebrain/morphology-workflows

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    3 of 3 committers (100.0%) from academic institutions
  • Institutional organization owner
    Organization bluebrain has institutional domain (portal.bluebrain.epfl.ch)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

morphology neuroscience

Keywords from Contributors

neuron
Last synced: 5 months ago · JSON representation

Repository

Workflows used for morphology processing.

Basic Info
Statistics
  • Stars: 5
  • Watchers: 5
  • Forks: 2
  • Open Issues: 3
  • Releases: 30
Archived
Topics
morphology neuroscience
Created about 4 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog Contributing License Authors

README.md

workflow Logo

Version Build status Coverage License Documentation status DOI

Warning

The Blue Brain Project concluded in December 2024, so development has ceased under the BlueBrain GitHub organization. Future development will take place at: https://github.com/openbraininstitute/morphology-workflows

Morphology Workflows

This project contains several workflows for processing morphologies: - Initialize: create the initial configuration files that the user can then update according to its needs. - Fetch: download morphologies from online database (like Allen, NeuroMorpho or MouseLight). - Placeholders: compute the placeholders for a given region and mtype set. - Curate: from raw morphologies, ensures that morphologies can be used with the rest of BBP codes (click on the image for more details). - Annotate: create various annotations on morphologies needed by specific BBP codes (click on the image for more details). - Repair: process morphologies to correct for artifacts of in-vitro reconstruction (click on the image for more details). - Clone: clone morphologies and apply some variability (click on the image for more details). - Transform: transform morphologies by rescaling the soma, the sections and their diameters (click on the image for more details).

In a nutshell, the user provides a list of morphologies in a .csv file, with their names and paths and a luigi.cfg configuration file. Each workflow is run independently and creates an output folder, with one subfolder per task. In each, there will be a report.csv and a data folder containing the output files of the task if any. In the report.csv file, columns contain paths to these files, additional information, error messages if the task failed on that morphologies, as well as a flag is_valid, used in subsequent tasks to filter valid morphologies. At the end of each workflow, another report.csv file is created, with the main output columns of each tasks, and a report.pdf containing a human readable summary of the result of the workflow.

Usually, the user should run the Curate workflow, then the Annotate workflow and finally the Repair workflow.

The complete documentation can be found here: * stable: https://morphology-workflows.readthedocs.io/en/stable/ * latest: https://morphology-workflows.readthedocs.io/en/latest/

Installation

This should be installed using pip:

bash pip install morphology-workflows

Usage

Create inputs for the workflows using the Initialize workflow

Usually, user should create a new project folder using this workflow. It will create the files required to run the other workflows. For example, the command:

bash morphology-workflows Initialize --source-database NeuroMorpho

will create the inputs to download the morphologies from the NeuroMorpho database and the run the other workflows on these morphologies.

If the user wants to provide arbitrary morphologies to the Curate / Annotate / Repair workflows, the following command can be used:

bash morphology-workflows Initialize --input-dir <path-to-the-morphologies>

in order to create the dataset required by these workflows.

Once the Initialize workflows is complete, the user can update the outputs according to its needs (see the next sections for details about each workflow).

Create inputs for the Fetch workflow

This workflow helps fetching morphologies from online databases. This workflow only needs a configuration file, which depends on the source from which the morphologies are fetched.

The possible sources are:

  • NeuroMorpho
  • MouseLight
  • Allen

For each of them, the configuration file should be a JSON file containing a list of objects like the following examples:

  • NeuroMorpho: JSON [ { "species": "mouse", "brain_region": "neocortex", "cell_type": "interneuron", "nb_morphologies": 10 } ]

  • MouseLight: JSON [ { "brain_region": "neocortex", "nb_morphologies": 10, "seed": 0 } ]

  • Allen: JSON [ { "species": "Mus musculus", "brain_region": "VISli", "cell_type": "pyramidal", "nb_morphologies": 10, "seed": 0 } ]

In these examples, the seed attribute is optional and is only used to sample which morphologies are fetched among those which pass the filter.

Each JSON object in the list will give a set of morphologies to fetch, depending on the given filters. Note that all attributes are optional, so it's possible to pass an empty object to fetch all the morphologies from the database, though it is not recommended.

Create inputs for the Curate, Annotate and Repair workflows

The Annotate and Repair workflows should usually be run after the Curate workflow since their inputs should be the outputs of the Curate workflow. But it is still possible to run them on arbitrary inputs (though the morphologies must be valid, as the ones processed by the Curate workflow).

The inputs should consist in:

  • a directory containing the input morphologies.
  • a CSV file with the following columns:
    1. morph_path: the path to the morphology file.
    2. morph_name: the name of the morphology.
    3. mtype: the morphology-type of the morphology (this column is optional).

Any other column is kept into the results but not used in the workflows.

Note that the column names should not contain spaces between commas and names. * a luigi.cfg file containing the configuration for all the tasks of the workflow. * an optional logging.conf file containing the logging configuration. If you prefer default logging behavior, remove this file and comment line in logging_conf_file = logging.conf in luigi.cfg.

The examples folder contains examples for the luigi.cfg and logging.conf files.

These inputs can be created using the Fetch workflow that downloads morphologies from online databases and create the dataset in the correct format.

Run the workflows

These workflows are based on the luigi library but can be run via the command line interface. For example, you can run the Curate workflow with the following command:

bash morphology-workflows Curate

NOTE: This command must be executed from a directory containing a luigi.cfg file. An example of such file is given in the examples directory.

By default, a local scheduler is used but it is also possible to use a Luigi's master scheduler using the -m / --master-scheduler trigger:

bash morphology-workflows -m Curate

Once the Curate workflow has run, the Annotate and Repair workflows can be run directly, they will just take the results of the Curate workflow as input:

bash morphology-workflows Annotate morphology-workflows Repair

Note that it is also possible to run the 3 workflows directly because each workflow depends on each other: bash morphology-workflows Repair

More details can be found in the command line interface section of the documentation or by running the commands:

bash morphology-workflows --help morphology-workflows <workflow> --help

Results

Each workflow will create several new directories, one for each sub-step. These new directories can be nested into a global result directory for each workflow, using the result_path parameter. These directories contain intermediate data so it is possible to understand why a morphology could not be validated at a given step. The invalid morphologies should be manually fixed before being processed again by the workflows.

The main workflows (Curate, Annotate and Repair) will also create a final CSV file which contains most of the relevant data of the workflow (main sub-step results and final morphology paths). Finally, the Repair workflow can generate morphology releases that contain the final morphologies that could be validated and automatically fixed by the workflow. Usually these morphologies are the most relevant ones for later use.

The morphologies marked as invalid may be fixed manually before rerunning the workflow on them.

Examples

The examples folder contains a simple example that will fetch and process a set of morphologies. A dataset.csv file is provided which is taken as input for the workflows. A luigi.cfg file is also provided to give a default configuration for the workflows. This example can simply be run using the following command:

bash ./run_curation.sh

This script will create a new directory out_curated which will contain the report and all the results.

Citation

When you use this software, we kindly ask you to cite the following DOI:

DOI

Funding & Acknowledgment

The development of this software was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government’s ETH Board of the Swiss Federal Institutes of Technology.

For license and authors, see LICENSE.txt and AUTHORS.md respectively.

Copyright © 2021-2022 Blue Brain Project/EPFL

Owner

  • Name: The Blue Brain Project
  • Login: BlueBrain
  • Kind: organization
  • Email: bbp.opensource@epfl.ch
  • Location: Geneva, Switzerland

Open Source Software produced and used by the Blue Brain Project

GitHub Events

Total
  • Delete event: 2
  • Push event: 2
  • Pull request event: 4
  • Create event: 1
Last Year
  • Delete event: 2
  • Push event: 2
  • Pull request event: 4
  • Create event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 70
  • Total Committers: 3
  • Avg Commits per committer: 23.333
  • Development Distribution Score (DDS): 0.214
Top Committers
Name Email Commits
Adrien Berchet a****t@e****h 55
Alexis Arnaudon a****n@e****h 11
alex4200 a****z@e****h 4
Committer Domains (Top 20 + Academic)
epfl.ch: 3

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 18
  • Total pull requests: 146
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 8 days
  • Total issue authors: 5
  • Total pull request authors: 5
  • Average comments per issue: 1.61
  • Average comments per pull request: 0.88
  • Merged pull requests: 138
  • Bot issues: 0
  • Bot pull requests: 9
Past Year
  • Issues: 0
  • Pull requests: 10
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 days
  • Issue authors: 0
  • Pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 1.9
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • arnaudon (13)
  • KeremKurban (2)
  • ThibLY (1)
  • FrancescoCasalegno (1)
  • lidakanari (1)
Pull Request Authors
  • adrien-berchet (127)
  • arnaudon (31)
  • dependabot[bot] (11)
  • alex4200 (3)
  • bbpgithubaudit (1)
Top Labels
Issue Labels
enhancement (2) bug (1)
Pull Request Labels
dependencies (11)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 140 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 29
  • Total maintainers: 3
pypi.org: morphology-workflows

Workflows used for morphology processing.

  • Versions: 29
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 140 Last month
Rankings
Dependent packages count: 10.0%
Downloads: 13.8%
Average: 17.5%
Forks count: 19.2%
Dependent repos count: 21.8%
Stargazers count: 23.1%
Last synced: 6 months ago

Dependencies

.github/workflows/commitlint.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/publish-sdist.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/run-tox.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • awalsh128/cache-apt-pkgs-action latest composite
  • codecov/codecov-action v3 composite
  • mikepenz/action-junit-report v3 composite
package.json npm
pyproject.toml pypi
setup.py pypi
docs/environment.yml conda
  • graphviz
  • python 3.8.*