Experiment

class starfish.core.experiment.experiment.Experiment(fovs: Sequence[FieldOfView], codebook: Codebook, extras: dict, *, src_doc: dict = {})[source]

Encapsulates an experiment, with one or more fields of view and a Codebook. An individual FieldOfView can be retrieved using a key, i.e., experiment[fov_name].

Attributes:
codebookCodebook

The codebook associated with this experiment.

extrasDict

Returns the extras dictionary associated with this experiment.

Methods

fov([filter_fn, key_fn])

Given a callable filter_fn, apply it to all the FOVs in this experiment.

fovs([filter_fn, key_fn])

Given a callable filter_fn, apply it to all the FOVs in this experiment.

fovs_by_name(*names)

Given a name or set of names, return all fovs that match.

from_json(json_url)

Construct an Experiment from an experiment.json file format specifier.

items()

Return all names and fovs in the experiment

keys()

Return all fov names in the experiment

values()

Return all FieldOfViews in the experiment

verify_version(semantic_version_str)

Verifies the compatibility of the current starfish version with the experiment version

fov(filter_fn: ~typing.Callable[[~starfish.core.experiment.experiment.FieldOfView], bool] = <function Experiment.<lambda>>, key_fn: ~typing.Callable[[~starfish.core.experiment.experiment.FieldOfView], str] = <function Experiment.<lambda>>) FieldOfView[source]

Given a callable filter_fn, apply it to all the FOVs in this experiment.

Parameters:
filter_fnCallable

Filter to apply to the list of FOVs

key_fnCallable

The key that determines the order of filtered FOVs, default fov.name

Returns:
FieldOfView

The first FOV that fulfills the filter parameters.

Raises:
LookupError

If no FOV matches

fovs(filter_fn: ~typing.Callable[[~starfish.core.experiment.experiment.FieldOfView], bool] = <function Experiment.<lambda>>, key_fn: ~typing.Callable[[~starfish.core.experiment.experiment.FieldOfView], str] = <function Experiment.<lambda>>) Sequence[FieldOfView][source]

Given a callable filter_fn, apply it to all the FOVs in this experiment.

Parameters:
filter_fnCallable

Filter to apply to the list of FOVs

key_fnCallable

The key that determines the order of filtered FOVs, default fov.name

Returns:
Sequence[FieldOfView]

All fovs that pass the filter function.

fovs_by_name(*names) Sequence[FieldOfView][source]

Given a name or set of names, return all fovs that match.

Parameters:
namesstr

The fov names to search for.

Returns:
Sequence[FieldOfView]

All fovs that match the given names.

classmethod from_json(json_url: str) Experiment[source]

Construct an Experiment from an experiment.json file format specifier. Loads configuration from StarfishConfig.

Parameters:
json_urlstr

file path or web link to an experiment.json file

Returns:
Experiment

Experiment object serving the requested experiment data

items()[source]

Return all names and fovs in the experiment

keys()[source]

Return all fov names in the experiment

values()[source]

Return all FieldOfViews in the experiment

classmethod verify_version(semantic_version_str: str) Version[source]

Verifies the compatibility of the current starfish version with the experiment version