Experiment

class starfish.core.experiment.experiment.Experiment(fovs, codebook, extras, *, src_doc=None)[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(self, filter_fn, …)

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

fovs(self, filter_fn, …)

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

fovs_by_name(self, \*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(self)

Return all names and fovs in the experiment

keys(self)

Return all fov names in the experiment

values(self)

Return all FieldOfViews in the experiment

verify_version(semantic_version_str)

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

fov(self, filter_fn:Callable[[starfish.core.experiment.experiment.FieldOfView], bool]=<function Experiment.<lambda> at 0x7fee921e6620>, key_fn:Callable[[starfish.core.experiment.experiment.FieldOfView], str]=<function Experiment.<lambda> at 0x7fee921e66a8>) → starfish.core.experiment.experiment.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

Return type

FieldOfView

fovs(self, filter_fn:Callable[[starfish.core.experiment.experiment.FieldOfView], bool]=<function Experiment.<lambda> at 0x7fee921e67b8>, key_fn:Callable[[starfish.core.experiment.experiment.FieldOfView], str]=<function Experiment.<lambda> at 0x7fee921e6950>) → Sequence[starfish.core.experiment.experiment.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.

Return type

Sequence[FieldOfView]

fovs_by_name(self, *names) → Sequence[starfish.core.experiment.experiment.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.

Return type

Sequence[FieldOfView]

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

Return type

Experiment

items(self)[source]

Return all names and fovs in the experiment

keys(self)[source]

Return all fov names in the experiment

values(self)[source]

Return all FieldOfViews in the experiment

classmethod verify_version(semantic_version_str:str) → semantic_version.base.Version[source]

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

Return type

Version