annotator¶
Annotation of SBML models.
Handle the XML annotations and notes in SBML. Annotate models from information in annotation csv files. Thereby a model can be fully annotated from information stored in a separate annotation store.
Annotation is performed via searching for ontology terms which describe the model and model components. A standard workflow is looking up the components for instance in things like OLS ontology lookup service.
ExternalAnnotation
¶
Class for handling SBML annotations defined in external source.
This corresponds to a single entry in the external annotation file. Allows to handle more complex annotation scenarios, e.g. patterns for identifiers.
The columns are
pattern sbml_type annotation_type qualifier resource name
Initialize ExternalAnnotation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
d
|
dict[str, Any]
|
one row of the annotation file, |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
if a required column is missing |
ValueError
|
if a value is not one of the supported choices |
ModelAnnotator
¶
Helper class for annotating SBML models.
Initialize ModelAnnotator.
:param doc: SBMLDocument :param annotations: iterable of ModelAnnotation
get_SBMLQualifier
staticmethod
¶
Lookup of SBMLQualifier for given qualifier string.
:param qualifier_type: BQB or BQM :return: SBML qualifier string
annotate_sbase
staticmethod
¶
Annotate SBase based on given annotation data.
:param sbase: libsbml.SBase :param annotation: Annotation :return:
read_annotations_df
staticmethod
¶
Read annotations from given file into DataFrame.
Supports "xlsx", "tsv", "csv", "json", "*"
:param file_path: either path to file, or data in dict format :param file_format: annotation file format :return: pandas.DataFrame
read_annotations
staticmethod
¶
Read annotations from given file into DataFrame.
Supports "xlsx", "tsv", "csv", "json", "*"
:param file_path: either path to file, or data in dict format :param file_format: annotation file format :return: list of annotation objects
annotate_sbml
¶
Annotate a given SBML file with the provided annotations.
:param source: SBML to annotation :param annotations_path: external file with annotations :param filepath: annotated SBML file :return: annotated SBMLDocument
annotate_sbml_doc
¶
Annotates given SBML document using the annotations file.
:param doc: SBMLDocument :param external_annotations: ModelAnnotations :return: annotated SBMLDocument