omero.util.populate_metadata module

Populate bulk metadata tables from delimited text files.

class util.populate_metadata.BulkToMapAnnotationContext(client, target_object, file=None, fileid=None, cfg=None, cfgid=None, attach=False, options=None)[source]

Bases: _QueryContext

Processor for creating MapAnnotations from BulkAnnotations.

get_bulk_annotation_file()[source]
get_target(target_object)[source]
parse()[source]
populate(table)[source]
write_to_omero(batch_size=1000, loops=10, ms=500)[source]
class util.populate_metadata.DatasetWrapper(value_resolver)[source]

Bases: PDIWrapper

get_image_id_by_name(iname, dname=None)[source]
class util.populate_metadata.DeleteMapAnnotationContext(client, target_object, file=None, fileid=None, cfg=None, cfgid=None, attach=False, options=None)[source]

Bases: _QueryContext

Processor for deleting MapAnnotations in the BulkAnnotations namespace on these types: Image WellSample Well PlateAcquisition Plate Screen

parse()[source]
populate()[source]
write_to_omero(batch_size=1000, loops=10, ms=500)[source]
class util.populate_metadata.HeaderResolver(target_object, headers, column_types=None)[source]

Bases: object

Header resolver for known header names which is responsible for creating the column set for the OMERO.tables instance.

DEFAULT_COLUMN_SIZE = 1
columns_sanity_check(columns)[source]
create_columns()[source]
create_columns_dataset()[source]
create_columns_plate()[source]
create_columns_project()[source]
create_columns_screen()[source]
dataset_keys = {'image': omero.grid.ImageColumn, 'image_name': omero.grid.StringColumn}
static get_column_types(row)[source]
static is_row_column_types(row)[source]
plate_keys = {'column': omero.grid.LongColumn, 'field': omero.grid.ImageColumn, 'image': omero.grid.ImageColumn, 'row': omero.grid.LongColumn, 'well': omero.grid.WellColumn, 'wellsample': omero.grid.ImageColumn}
project_keys = {'dataset': omero.grid.DatasetColumn, 'dataset_name': omero.grid.StringColumn, 'image': omero.grid.ImageColumn, 'image_name': omero.grid.StringColumn}
screen_keys = {'column': omero.grid.LongColumn, 'field': omero.grid.ImageColumn, 'image': omero.grid.ImageColumn, 'plate': omero.grid.PlateColumn, 'row': omero.grid.LongColumn, 'well': omero.grid.WellColumn, 'wellsample': omero.grid.ImageColumn}
class util.populate_metadata.ImageData(image)[source]

Bases: object

Largely “mock” object which is intended to simulate the data returned by querying a Image but without the overhead of storing all the Ice fields.

exception util.populate_metadata.MetadataError[source]

Bases: Exception

Raised by the metadata parsing context when an error condition is reached.

class util.populate_metadata.PDIWrapper(value_resolver)[source]

Bases: ValueWrapper

get_image_id_by_name(iname, dname=None)[source]
class util.populate_metadata.ParsingContext(client, target_object, file=None, fileid=None, cfg=None, cfgid=None, attach=False, column_types=None, options=None)[source]

Bases: object

Generic parsing context for CSV files.

get_column_widths()[source]
parse()[source]
parse_from_handle(data)[source]
populate(rows)[source]
post_process()[source]
write_to_omero(batch_size=1000, loops=10, ms=500)[source]
class util.populate_metadata.PlateData(plate)[source]

Bases: object

Largely “mock” object which is intended to simulate the data returned by querying a Plate but without the overhead of storing all the Ice fields.

class util.populate_metadata.PlateWrapper(value_resolver)[source]

Bases: SPWWrapper

get_well_by_id(well_id, plate=None)[source]
subselect(rows, names)[source]

If we’re processing a plate but the bulk-annotations file contains a plate column then select rows for this plate only

class util.populate_metadata.ProjectWrapper(value_resolver)[source]

Bases: PDIWrapper

get_image_id_by_name(iname, dname=None)[source]
class util.populate_metadata.SPWWrapper(value_resolver)[source]

Bases: ValueWrapper

get_image_name_by_id(iid, pid=None)[source]
get_well_by_id(well_id, plate=None)[source]
parse_plate(plate, wells_by_location, wells_by_id, images_by_id)[source]

Accepts PlateData instances

resolve_well(column, row, value)[source]
class util.populate_metadata.ScreenWrapper(value_resolver)[source]

Bases: SPWWrapper

get_plate_name_by_id(plate)[source]
get_well_by_id(well_id, plate=None)[source]
resolve_plate(column, row, value)[source]
class util.populate_metadata.Skip[source]

Bases: object

Instance to denote a row skip request.

class util.populate_metadata.ValueResolver(client, target_object)[source]

Bases: object

Value resolver for column types which is responsible for filling up non-metadata columns with their OMERO data model identifiers.

AS_ALPHA = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'ag', 'ah', 'ai', 'aj', 'ak', 'al', 'am', 'an', 'ao', 'ap', 'aq', 'ar', 'as', 'at', 'au', 'av', 'aw', 'ax', 'ay', 'az']
WELL_REGEX = re.compile('^([a-zA-Z]+)(\\d+)$')
get_image_id_by_name(iname, dname=None)[source]
get_image_name_by_id(iid, pid=None)[source]
get_plate_name_by_id(plate)[source]
get_well_name(well_id, plate=None)[source]
resolve(column, value, row)[source]
subselect(valuerows, names)[source]
v = 122
class util.populate_metadata.ValueWrapper(value_resolver)[source]

Bases: object

subselect(rows, names)[source]
class util.populate_metadata.WellData(well)[source]

Bases: object

Largely “mock” object which is intended to simulate the data returned by querying a Well but without the overhead of storing all the Ice fields.

class util.populate_metadata.WellSampleData(well_sample)[source]

Bases: object

Largely “mock” object which is intended to simulate the data returned by querying a WellSample but without the overhead of storing all the Ice fields.

util.populate_metadata.get_config(session, cfg=None, cfgid=None)[source]
util.populate_metadata.parse_column_types(column_type_list)[source]
util.populate_metadata.parse_target_object(target_object)[source]
util.populate_metadata.usage(error)[source]

Prints usage so that we don’t have to. :)