hts.run package

Submodules

hts.run.constants module

hts.run.run module

synopsis

The Run Class.

class hts.run.run.Run(plates, path=None, **kwargs)[source]

Bases: object

Run describes all information connected to one run of a high

throughput screening experiment

name

Name of the run

Type

str

plates

collections.OrderedDict of Plate instances

Type

collections.OrderedDict of Plate

width

Width of the plates

Type

int

height

Height of the plates

Type

int

_protocol

Protocol instance

Type

Protocol

_platelayout

PlateLayout instance

Type

PlateLayout

_qc

A collection of QualityControl instance

Type

dict of dict of QualityControl instance

raw_qc

QualityControl instance - NEEDED?

Type

QualityControl

net_qc

QualityControl instance - NEEDED?

Type

QualityControl

experimenter

Name of the experimenter

Type

str

experimenter

Mail address of the experimenter

Type

str

..todo:: Implement me :)

__iter__()[source]

Iterates over plates.

__str__()[source]

Create string for Run instance.

add_data_from_data_frame(tags, plate_data_type='meta_data')[source]
Parameters

tags (list of str) – HTS data and meta data is joined on the columns defined by tags.

add_meta_data(tag=None, **kwargs)[source]

Set self.data_frame to merged internal and meta_data.

Parameters
  • tag – The meta data tag defining which meta data to use. If tag is not set and there is only one set of meta data it will be used.

  • **kwargs – kwargs passed on to run_io.add_meta_data

analysis(**kwargs)[source]

Perform analysis and save the results.

Perform analysis and save the results. Parameters are taken from the protocol and the run config. Each ProtocolTask tagged with “analysis” is run. Each ProtocolTask may be run multiple times, if several dicts are defined for it (this could be either in protocol, or in the run config.)

classmethod create(origin, path, format=None, dir=False, **kwargs)[source]

Create Run instance.

Create Run instance.

Parameters
  • origin (str) – At current only “config” or “plates”

  • format (str) – Format of the origin, at current not specified

  • path (str) – Path to input file or directory

  • dir (Bool) – True if all files in directory shall be read, else false.

Todo

Write checks for format and path.

classmethod create_from_config(path, file, reload=True)[source]

Read config and use data to create Run instance.

Read config and use data to create Run instance.

Parameters
  • path (str) – Path to input configobj file

  • file (str) – Filename of configobj file

  • force (boolean) – If not force and the run instance exists as a pickle, reload the pickle instead of reloading the data.

classmethod create_from_csv_file(path, file, **kwargs)[source]

Read csv data and create Run instance.

Read csv data and create Run instance.

Parameters
  • path (str) – Path to input csv file

  • file (str) – Filename of csv file

classmethod create_from_envision(path, file)[source]

Read envision data and create Run instance.

Read envision data and create Run instance.

Parameters
  • path (str) – Path to input configobj file

  • file (str) – Filename of configobj file

Todo

Write checks if path and file exists when necessary.

property data_frame
property data_frame_samples
do_task(type, type_attribute='_{}', force=True)[source]

Perform task. A task could be e.g. qc or analysis.

filter(**kwargs)[source]

Filter run data according to filter keyword arguments.

Filter run data according to filter arguments. The values for each plates are concatenated.

Parameters

kwargs – Keyword arguments for filtering.

Returns

list of floats

get_run_config_data()[source]

Extract relevant meta data for qc and analysis reports. Returns list of tuples: [(key_str, value_str)]

property gp_models
classmethod map_config_file_definition(config, n_plate)[source]

Extract the files from the config file.

merger_add_data_from_data_frame(replicate_defining_column, *args, **kwargs)[source]
merger_rank_samples(replicate_defining_column, *args, **kwargs)[source]
merger_summarize_statistical_significance(replicate_defining_column, *args, **kwargs)[source]
preprocess()[source]

Perform data preprocessing.

Perform data preprocessing.

protocol(path=None, format=None)[source]

Read protocol and attach to Run instance.

Read protocol and attach to Run instance.

Parameters
  • path (str) – Path to input file

  • format (str) – At current only “csv”

Todo

Write checks if path and format exists when necessary.

qc(**kwargs)[source]

Perform quality control and save the results

write(format, path=None, return_string=None, **kwargs)[source]

Serialize and write Run instances.

Serialize Run instance using the stated format.

Parameters
  • format (str) – The output format: Currently only “pickle”.

  • path (str) – Path to output file

Todo

Write checks for format and path.

hts.run.run.merged_replicates(f)[source]
hts.run.run.send_mail(body, email_to, email_from='adriano_conrad_aguzzi@gmail.com', smtp_server='smtp.gmail.com', smtp_port=587, smtp_username='elkewschaper@gmail.com', email_subject='QC_report finished')[source]

hts.run.run_io module

synopsis

Input/output for runs.

hts.run.run_io.add_meta_data(run_data, meta_data_kwargs, meta_data_well_name_pattern=None, filter_condition=None, meta_data_rename=None, meta_data_exclude_columns=None, readouts=None)[source]
hts.run.run_io.convert_well_id_format(well, read='letternumber')[source]
hts.run.run_io.read_csv(file, column_plate_name, column_well, columns_readout, columns_meta, width, height, delimiter=', ', remove_empty_row=True)[source]

Read run data file in csv format, with one row for each well.

E.g.: Plate ID,Well ID,Compound,,Data_0,Data_1,signal XYZ005,A001,Glucose,,4444,5555,0.3

hts.run.run_io.file

The path to the file.

Type

str

hts.run.run_io.column_plate_name

The column with plate name information.

Type

str

hts.run.run_io.column_well

The column with well coordinate information.

Type

str

hts.run.run_io.columns_readouts

Columns with readout data.

Type

list of str

hts.run.run_io.columns_metas

Columns with meta data.

Type

list of str

hts.run.run_io.rename_pd_columns(data_frame, rename_dict)[source]
hts.run.run_io.serialize_as_csv_one_row_per_well(run_data, readouts=None, rename_columns_dict=None, **kwargs)[source]

Write run data file in csv format, with one row for each well.

E.g.: Plate ID,Well ID,Compound,,Data_0,Data_1,signal XYZ005,A001,Glucose,,4444,5555,0.3

hts.run.run_io.readouts

Which readouts will be printed. If not indicated, all readouts are printed.

Type

list of str

hts.run.run_io.plate_name

The name of the plate name column

Type

str

hts.run.run_io.well_name

The name of the well name column

Type

str

hts.run.run_io.plate_layout_name

The name of the plate layout column

Type

str

hts.run.run_io.serialize_as_pandas(run_data, readouts=None, meta_data=None, well_name_pattern='{}{}', filter_condition=None)[source]

Serialize data as pandas with one row == one well.

E.g.: Plate ID,Well ID,Compound,,Data_0,Data_1,signal XYZ005,A001,Glucose,,4444,5555,0.3

hts.run.run_io.readouts

Which readouts will be printed. If not indicated, all readouts are printed.

Type

list of str

hts.run.run_io.plate_name

The name of the plate name column

Type

str

hts.run.run_io.well_name

The name of the well name column

Type

str

hts.run.run_io.plate_layout_name

The name of the plate layout column

Type

str

hts.run.run_io.serialize_run_for_r(run_data, delimiter=', ', column_name=None)[source]

Serialize run data for easy read-in as a data.frame in R.

Serialize run data for easy read-in as a data.frame in R, in e.g. csv or tsv format.

hts.run.run_io.run

A Run instance.

Type

Run

hts.run.run_io.delimiter

A String instance. Defines the delimiter in the output file (e.g. “,” for csv or ” ” for tsv)

Type

str

Returns

The serialized run_data as a string.

Return type

str

..ToDo: Update to fit current Run class.

Module contents