bioimageit_core.containers package

Submodules

bioimageit_core.containers.data_containers module

BioImageIT data containers.

Implements data containers defined in SciXTracer

Classes

Container Data RawData ProcessedData Dataset Experiment Run

class bioimageit_core.containers.data_containers.Container(md_uri='', uuid='')

Bases: object

Interface fo all BioImageIT containers

Containers are classes to store and interact with dedicated types of metadata

md_uri

URI of the metadata in the database or file system depending on backend

Type:

str

uuid

Unique identifier of the metadata

Type:

str

class bioimageit_core.containers.data_containers.Data

Bases: Container

Interface for data container

Data container aims at manipulating the metadata of a single data

name

Name of the data

author

Author of the data

date

Date when the data is created

format

Data format (txt, csv, tif, …)

uri

URI of the data as stored in the database

class bioimageit_core.containers.data_containers.Dataset

Bases: Container

Container for a dataset metadata

name

Name of the dataset

uris

List of the URIs of the data (metadata) in the URIs

size()
class bioimageit_core.containers.data_containers.DatasetInfo(name, url, uuid)

Bases: object

Contains the info of a dataset

name

Name of the dataset

Type:

str

url

URL of the metadata file

Type:

str

uuid

Unique ID of the dataset

Type:

str

class bioimageit_core.containers.data_containers.Experiment

Bases: Container

Container for an experiment .. attribute:: name

Name of the experiment

author

Username of the experiment author

date

Creation date of the experiment

raw_dataset

URI of the raw dataset

processed_datasets

URIs of the processed datasets

keys

List of vocabulary keys used in the experiment

set_key(key)
class bioimageit_core.containers.data_containers.ProcessedData

Bases: Data

Container for processed data

run

URI of the Run metadata file

inputs

Information about the inputs that generated this processed data. It is a list of ProcessedDataInputContainer

output

Information about how the output is referenced in the process that generates this processed data ex: {“name”: “o”, “label”: “Processed image”}

add_input(id_: str, data: Data)
add_input_(id_: str, uri: str, uuid: str, type_: str)
set_info(name='', author='', date='', format_='', url='')
set_output(id_: str, label: str)
class bioimageit_core.containers.data_containers.ProcessedDataInputContainer(name: str = '', uri: str = '', uuid: str = '', type_: str = 'raw')

Bases: object

Container for processed data origin input

name

Name of the input (the unique name in the process)

uri

The uri of the input metadata

class bioimageit_core.containers.data_containers.RawData

Bases: Data

Container for a Raw data

key_value_pairs

Dictionary containing the key-value pairs (key=value)

Type:

dict

metadata

Dictionary of extra metadata (ex: image acquisition settings)

Type:

dict

set_key_value_pair(key, value)
class bioimageit_core.containers.data_containers.Run

Bases: Container

Container for a run (processing or job execution)

process_name

Name of the process (ex: ndsafir)

process_uri

Unique URI of the process (ex: github url)

processed_dataset

URI of the processed dataset

parameters

List of parameters using the RunParameterContainer object

inputs

List of the run inputs using RunInputContainer object

add_input(name: str = '', dataset: str = '', query: str = '', origin_output_name: str = '')
add_parameter(name, value)
set_dataset(dataset)
set_process(name, uri)
class bioimageit_core.containers.data_containers.RunInputContainer(name: str = '', dataset: str = '', query: str = '', origin_output_name: str = '')

Bases: object

Container for a run input

name

Name of the input (ex -i)

dataset

Name of the dataset containing the inputs (ex ‘data’)

query

Query used to select images in the dataset (ex ‘name=image.tif’)

origin_output_name

Name of the output in the parent run if run on a processed dataset

class bioimageit_core.containers.data_containers.RunParameterContainer(name: str = '', value: str = '')

Bases: object

Container for a run parameter

name

Name of the parameter

value

Value of the parameter

bioimageit_core.containers.runners_containers module

class bioimageit_core.containers.runners_containers.Job

Bases: object

Container for a job information

A job information lists all the needed information to run a tool on an experiment

experiment

Container of the experiment to process

Type:

Experiment

tool

Tool to run

Type:

Tool

parameters

Set of parameters that setup the tool.

Type:

dict

inputs

Description of the job inputs in the database

Type:

JobInputs

output_dataset_name

Unique name of the output dataset

Type:

str

set_experiment(experiment)
set_input(name, dataset, query, origin_output_name='')
set_output_dataset_name(name)
set_param(key, value)
set_tool(tool)
class bioimageit_core.containers.runners_containers.JobInput(name: str = '', dataset: str = '', query: str = '', origin_output_name: str = '')

Bases: object

Container for a job input

A job input is all the information needed to select the input data files of a job in an experiment

name

Name of the input (ex -i)

Type:

str

dataset

Name of the dataset containing the inputs (ex ‘data’)

Type:

str

query

Query used to select images in the dataset (ex ‘name=image.tif’)

Type:

str

origin_output_name

Name of the output in the parent run if run on a processed dataset

Type:

str

class bioimageit_core.containers.runners_containers.JobInputs

Bases: object

Container for multiple inputs of a job

inputs

List of all the job inputs

Type:

list

add_input(name, dataset, query, origin_output_name='')

Add a job input

Parameters:
  • name (str) – Name of the input (ex -i)

  • dataset (str) – Name of the dataset containing the inputs (ex ‘data’)

  • query (str) – Query used to select images in the dataset (ex ‘name=image.tif’)

  • origin_output_name (str) – Name of the output in the parent run if run on a processed dataset

add_job_input(job_input)

Add a job input

Parameters:

job_input (JobInput) – input to be added

count()

get the number of input

bioimageit_core.containers.tools_containers module

BioIMageIT tool containers.

This module contains containers for Tool info and tool database

bioimageit_core.containers.tools_containers.PARAM_NUMBER()
bioimageit_core.containers.tools_containers.PARAM_STRING()
bioimageit_core.containers.tools_containers.PARAM_SELECT()
bioimageit_core.containers.tools_containers.PARAM_BOOLEAN()
bioimageit_core.containers.tools_containers.PARAM_FILE()
bioimageit_core.containers.tools_containers.IO_PARAM()
bioimageit_core.containers.tools_containers.IO_INPUT()
bioimageit_core.containers.tools_containers.IO_OUTPUT()
bioimageit_core.containers.tools_containers.Classes()
-------
bioimageit_core.containers.tools_containers.ToolsCategoryContainer()
bioimageit_core.containers.tools_containers.ToolIndexContainer()
bioimageit_core.containers.tools_containers.ToolContainer()
bioimageit_core.containers.tools_containers.ToolParameterContainer()
bioimageit_core.containers.tools_containers.ToolDatabaseContainer()
bioimageit_core.containers.tools_containers.CmdSelectContainer()
class bioimageit_core.containers.tools_containers.CmdSelectContainer

Bases: object

Container for a select parameter options

names

List of the options names

Type:

list

values

List of the options values

Type:

list

size()

Number of options

add()

Add an option

add(name: str, value: str)

Add an option

Parameters:
  • name – Name of the option

  • value – Value of the option

content_str()
size()

Calculate the number of options

Returns:

Number of options

Return type:

Int

class bioimageit_core.containers.tools_containers.Tool

Bases: object

Container for a tool parameter information

id

Id of the tool

Type:

str

name

Tool name

Type:

str

version

Tool version (ex 1.0.0)

Type:

str

description

Tool short description (used for the man page)

Type:

str

command

Command executed when tool is ran

Type:

str

inputs

Tool inputs stored in a list of ToolParameter

Type:

list

outputs

Tool outputs stored in a list of ToolParameter

Type:

list

tests

List of unit tests

Type:

list

help

Url to the help page

Type:

str

is_param()

Check if a parameter exists

inputs_size()

Returns the number of inputs

outputs_size()

Returns the number of outputs

display()

Display the tool information to console

container()

Get the first container in the requirements

Returns:

Description of the container requirement (origin, type, uri)

Return type:

dict

display()

Print the tool information to console.

fullname()

fullname of the tool

the full name is “{name}_v{version}”

inputs_size()

Calculate the number of inputs

Returns:

Number of inputs

Return type:

int

is_param(name: str) bool

Check if a parameter exists

Parameters:

name – Name of the parameter to check

Returns:

True if the parameter exists, False otherwise

Return type:

bool

man()

Display the tool man page

outputs_size()

Calculate the number of outputs

Returns:

Number of outputs

Return type:

int

param_size()

Calculate the number of parameters

Returns:

Number of inputs

Return type:

int

class bioimageit_core.containers.tools_containers.ToolIndexContainer

Bases: object

Container for a tool main information

uri

URI of the XML file

id: str

Id of the tool

name: str

Tool name

version: str

Tool version (ex 1.0.0)

type

Tool type (‘sequential’, ‘merge’)

categories

List of the tool categories

serialize(direction: str = 'h', show_uri=False)

Serialize the tool main info

Parameters:
  • direction (str) – h for horizontal, and v for vertical

  • show_uri (bool) – True to show the tool URI

to_dict()
class bioimageit_core.containers.tools_containers.ToolParameterContainer

Bases: object

Container for a tool parameter information

name

Parameter name

Type:

str

description

Parameter description

Type:

str

value

Parameter value

Type:

str

type

Parameter type (format)

Type:

str

is_data

False if parameter is param and True if parameter is data

Type:

bool

io

IO type if parameter is IO (in IO_XXX names)

Type:

str

default_value

Parameter default value

Type:

str

select_info

Choices for a select parameter

Type:

BiCmdSelect

is_advanced

True if parameter is advanced

Type:

bool

display()

Display the tool parameter information to console

class bioimageit_core.containers.tools_containers.ToolTestParameterContainer

Bases: object

Container for a tool test information

type

Parameter type (param or output)

Type:

str

name

Name of the parameter

Type:

str

value

Value of the parameter

Type:

str

file

Reference file path for output

Type:

str

compare

Comparison method name

Type:

str

display()

Display the container content

class bioimageit_core.containers.tools_containers.ToolsCategoryContainer

Bases: object

Container for a category of tools

These are the metadata of a tools category for the tool-shed structure

id:

ID of the category. It must be a unique name

name:

Name of the category. It is the name printed to the user interfaces

thumbnail:

URI to an image that illustrate the category tools

parent:

ID of the parent category in the category tree. Set to ‘root’ for a top level category

Module contents

class bioimageit_core.containers.CmdSelectContainer

Bases: object

Container for a select parameter options

names

List of the options names

Type:

list

values

List of the options values

Type:

list

size()

Number of options

add()

Add an option

add(name: str, value: str)

Add an option

Parameters:
  • name – Name of the option

  • value – Value of the option

content_str()
size()

Calculate the number of options

Returns:

Number of options

Return type:

Int

class bioimageit_core.containers.Container(md_uri='', uuid='')

Bases: object

Interface fo all BioImageIT containers

Containers are classes to store and interact with dedicated types of metadata

md_uri

URI of the metadata in the database or file system depending on backend

Type:

str

uuid

Unique identifier of the metadata

Type:

str

class bioimageit_core.containers.Data

Bases: Container

Interface for data container

Data container aims at manipulating the metadata of a single data

name

Name of the data

author

Author of the data

date

Date when the data is created

format

Data format (txt, csv, tif, …)

uri

URI of the data as stored in the database

class bioimageit_core.containers.Dataset

Bases: Container

Container for a dataset metadata

name

Name of the dataset

uris

List of the URIs of the data (metadata) in the URIs

size()
class bioimageit_core.containers.DatasetInfo(name, url, uuid)

Bases: object

Contains the info of a dataset

name

Name of the dataset

Type:

str

url

URL of the metadata file

Type:

str

uuid

Unique ID of the dataset

Type:

str

class bioimageit_core.containers.Experiment

Bases: Container

Container for an experiment .. attribute:: name

Name of the experiment

author

Username of the experiment author

date

Creation date of the experiment

raw_dataset

URI of the raw dataset

processed_datasets

URIs of the processed datasets

keys

List of vocabulary keys used in the experiment

set_key(key)
class bioimageit_core.containers.Job

Bases: object

Container for a job information

A job information lists all the needed information to run a tool on an experiment

experiment

Container of the experiment to process

Type:

Experiment

tool

Tool to run

Type:

Tool

parameters

Set of parameters that setup the tool.

Type:

dict

inputs

Description of the job inputs in the database

Type:

JobInputs

output_dataset_name

Unique name of the output dataset

Type:

str

set_experiment(experiment)
set_input(name, dataset, query, origin_output_name='')
set_output_dataset_name(name)
set_param(key, value)
set_tool(tool)
class bioimageit_core.containers.JobInput(name: str = '', dataset: str = '', query: str = '', origin_output_name: str = '')

Bases: object

Container for a job input

A job input is all the information needed to select the input data files of a job in an experiment

name

Name of the input (ex -i)

Type:

str

dataset

Name of the dataset containing the inputs (ex ‘data’)

Type:

str

query

Query used to select images in the dataset (ex ‘name=image.tif’)

Type:

str

origin_output_name

Name of the output in the parent run if run on a processed dataset

Type:

str

class bioimageit_core.containers.ProcessedData

Bases: Data

Container for processed data

run

URI of the Run metadata file

inputs

Information about the inputs that generated this processed data. It is a list of ProcessedDataInputContainer

output

Information about how the output is referenced in the process that generates this processed data ex: {“name”: “o”, “label”: “Processed image”}

add_input(id_: str, data: Data)
add_input_(id_: str, uri: str, uuid: str, type_: str)
set_info(name='', author='', date='', format_='', url='')
set_output(id_: str, label: str)
class bioimageit_core.containers.ProcessedDataInputContainer(name: str = '', uri: str = '', uuid: str = '', type_: str = 'raw')

Bases: object

Container for processed data origin input

name

Name of the input (the unique name in the process)

uri

The uri of the input metadata

class bioimageit_core.containers.RawData

Bases: Data

Container for a Raw data

key_value_pairs

Dictionary containing the key-value pairs (key=value)

Type:

dict

metadata

Dictionary of extra metadata (ex: image acquisition settings)

Type:

dict

set_key_value_pair(key, value)
class bioimageit_core.containers.Run

Bases: Container

Container for a run (processing or job execution)

process_name

Name of the process (ex: ndsafir)

process_uri

Unique URI of the process (ex: github url)

processed_dataset

URI of the processed dataset

parameters

List of parameters using the RunParameterContainer object

inputs

List of the run inputs using RunInputContainer object

add_input(name: str = '', dataset: str = '', query: str = '', origin_output_name: str = '')
add_parameter(name, value)
set_dataset(dataset)
set_process(name, uri)
class bioimageit_core.containers.RunInputContainer(name: str = '', dataset: str = '', query: str = '', origin_output_name: str = '')

Bases: object

Container for a run input

name

Name of the input (ex -i)

dataset

Name of the dataset containing the inputs (ex ‘data’)

query

Query used to select images in the dataset (ex ‘name=image.tif’)

origin_output_name

Name of the output in the parent run if run on a processed dataset

class bioimageit_core.containers.RunParameterContainer(name: str = '', value: str = '')

Bases: object

Container for a run parameter

name

Name of the parameter

value

Value of the parameter

class bioimageit_core.containers.Tool

Bases: object

Container for a tool parameter information

id

Id of the tool

Type:

str

name

Tool name

Type:

str

version

Tool version (ex 1.0.0)

Type:

str

description

Tool short description (used for the man page)

Type:

str

command

Command executed when tool is ran

Type:

str

inputs

Tool inputs stored in a list of ToolParameter

Type:

list

outputs

Tool outputs stored in a list of ToolParameter

Type:

list

tests

List of unit tests

Type:

list

help

Url to the help page

Type:

str

is_param()

Check if a parameter exists

inputs_size()

Returns the number of inputs

outputs_size()

Returns the number of outputs

display()

Display the tool information to console

container()

Get the first container in the requirements

Returns:

Description of the container requirement (origin, type, uri)

Return type:

dict

display()

Print the tool information to console.

fullname()

fullname of the tool

the full name is “{name}_v{version}”

inputs_size()

Calculate the number of inputs

Returns:

Number of inputs

Return type:

int

is_param(name: str) bool

Check if a parameter exists

Parameters:

name – Name of the parameter to check

Returns:

True if the parameter exists, False otherwise

Return type:

bool

man()

Display the tool man page

outputs_size()

Calculate the number of outputs

Returns:

Number of outputs

Return type:

int

param_size()

Calculate the number of parameters

Returns:

Number of inputs

Return type:

int

class bioimageit_core.containers.ToolIndexContainer

Bases: object

Container for a tool main information

uri

URI of the XML file

id: str

Id of the tool

name: str

Tool name

version: str

Tool version (ex 1.0.0)

type

Tool type (‘sequential’, ‘merge’)

categories

List of the tool categories

serialize(direction: str = 'h', show_uri=False)

Serialize the tool main info

Parameters:
  • direction (str) – h for horizontal, and v for vertical

  • show_uri (bool) – True to show the tool URI

to_dict()
class bioimageit_core.containers.ToolParameterContainer

Bases: object

Container for a tool parameter information

name

Parameter name

Type:

str

description

Parameter description

Type:

str

value

Parameter value

Type:

str

type

Parameter type (format)

Type:

str

is_data

False if parameter is param and True if parameter is data

Type:

bool

io

IO type if parameter is IO (in IO_XXX names)

Type:

str

default_value

Parameter default value

Type:

str

select_info

Choices for a select parameter

Type:

BiCmdSelect

is_advanced

True if parameter is advanced

Type:

bool

display()

Display the tool parameter information to console

class bioimageit_core.containers.ToolTestParameterContainer

Bases: object

Container for a tool test information

type

Parameter type (param or output)

Type:

str

name

Name of the parameter

Type:

str

value

Value of the parameter

Type:

str

file

Reference file path for output

Type:

str

compare

Comparison method name

Type:

str

display()

Display the container content

class bioimageit_core.containers.ToolsCategoryContainer

Bases: object

Container for a category of tools

These are the metadata of a tools category for the tool-shed structure

id:

ID of the category. It must be a unique name

name:

Name of the category. It is the name printed to the user interfaces

thumbnail:

URI to an image that illustrate the category tools

parent:

ID of the parent category in the category tree. Set to ‘root’ for a top level category