Appendix: API documentation

This page contains automatically generated documentation from the Enrich2 codebase. It is intended for developers and advanced users.

storemanager — Abstract class for Enrich2 data

This module contains the class definition for the StoreManager abstract class, the shared base class for most classes in the Enrich2 project. This class provides general behavior for the GUI and for handling HDF5 data files.

StoreManager class

seqlib — Sequencing library file handling and element counting

This module provides class definitions for the various types of sequencing library designs usable by Enrich2. Data for each FASTQ file (or pair of overlapping FASTQ files for overlapping paired-end data) is read into its own SeqLib object. If necessary, FASTQ files should be split by index read before being read by a SeqLib object. SeqLib objects are coordinated by Selection objects.

SeqLib and VariantSeqLib are abstract classes.

SeqLib class

VariantSeqLib class

BarcodeSeqLib class

BcvSeqLib class

BcidSeqLib class

BasicSeqLib class

OverlapSeqLib class

IdOnlySeqLib class

SeqLib helper classes

Aligner class

WildTypeSequence class

class enrich2.wildtype.WildTypeSequence(parent_name)

Container class for wild type sequence information. Used by VariantSeqLib objects and Selection or Experiment objects that contain variant information.

Requires a parent_name that associates this object with a StoreManager object for the purposes of error reporting and logging.

duplicate(new_parent_name)

Create a copy of this object with the new_parent_name.

Uses the configure and serialize methods to perform the copy.

position_tuples(protein=False)

Return a list of tuples containing the position number (after offset adjustment) and single-letter symbol (nucleotide or amino acid) for each position the wild type sequence.

serialize()

Format this object as a config object suitable for dumping to a config file.

BarcodeMap class

class enrich2.barcodemap.BarcodeMap(mapfile, is_variant=False)

Dictionary-derived class for storing the relationship between barcodes (keys) and variants (values). Requires the path to a mapfile, containing lines in the format 'barcode<whitespace>variant' for each barcode expected in the library. This file can be plain text or compressed (.bz2 or .gz).

Barcodes must only contain the characters ACGT and variants must only contain the characters ACGTN (lowercase characters are converted to uppercase).

Blank lines and lines that begin with # (comments) are ignored.

is_variant is a boolean that is True if the barcodes are assigned to variant DNA sequences, or False if the barcodes are assigned to arbitrary identifiers. If this is True, additional error checking is performed on the variant DNA sequences.

selection — Functional score calculation using SeqLib count data

This module provides class definitions for the Selection class. This is where functional scores are calculated from the SeqLib count data. For time series data, each time point in the selection can have multiple SeqLib assigned to it, in which case the counts for each element will be added together. Each time series selection must have a time point 0 (the “input library”).

Selection class

Selection helpers

condition — Dummy class for GUI

This module provides class definitions for the Condition classes. This class is required for proper GUI operation. All condition-related behaviors are in the Experiment class.

Condition class

experiment — Aggregation of replicate selections

This module provides class definitions for the Experiment. Functional scores for selections within the same condition are combined to generate a single functional score (and associated error) for each element in each experimental condition.

Experiment class

Enrich2 plotting

Text goes here.

Sequence-function map plotting

Text goes here.

Utility functions

Configuration object type detection

Functions for identifying the type of StoreManager derived object associated with a given configuration object (decoded from a JSON file as described here).

enrich2.config_check.element_type(cfg)

Get the type of StoreManager derived object specified by the configuration object.

Parameters:cfg (dict) – decoded JSON object
Returns:The class name of the StoreManager derived object specified by cfg.
Return type:str
Raises:ValueError – If the class name cannot be determined.
enrich2.config_check.is_condition(cfg)

Check if the given configuration object specifies a Condition.

Parameters:cfg (dict) – decoded JSON object
Returns:True if cfg if specifies a Condition, else False.
Return type:bool
enrich2.config_check.is_experiment(cfg)

Check if the given configuration object specifies an Experiment.

Parameters:cfg (dict) – decoded JSON object
Returns:True if cfg if specifies an Experiment, else False.
Return type:bool
enrich2.config_check.is_selection(cfg)

Check if the given configuration object specifies a Selection.

Parameters:cfg (dict) – decoded JSON object
Returns:True if cfg if specifies a Selection, else False.
Return type:bool
enrich2.config_check.is_seqlib(cfg)

Check if the given configuration object specifies a SeqLib derived object.

Parameters:cfg (dict) – decoded JSON object
Returns:True if cfg if specifies a SeqLib derived object, else False.
Return type:bool
enrich2.config_check.seqlib_type(cfg)

Get the type of SeqLib derived object specified by the configuration object.

Parameters:cfg (dict) – decoded JSON object
Returns:The class name of the SeqLib derived object specified by cfg.
Return type:str
Raises:ValueError – If the class name cannot be determined.

Dataframe and index helper functions

Variant helper functions

HGVS variant regular expressions

Enrich2 entry points