Models¶
This module contains the SQLAlchemy database models that support the definition cache and graph cache.
-
class
pybel.manager.models.
Base
(**kwargs)¶ The most base type
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
class
pybel.manager.models.
Namespace
(**kwargs)[source]¶ Represents a BEL Namespace.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
uploaded
¶ The date of upload
-
keyword
¶ Keyword that is used in a BEL file to identify a specific namespace
-
pattern
¶ Contains regex pattern for value identification.
-
miriam_id
¶ MIRIAM resource identifier matching the regular expression
^MIR:001\d{5}$
-
version
¶ Version of the namespace
-
url
¶ BELNS Resource location as URL
-
name
¶ Name of the given namespace
-
domain
¶ Domain for which this namespace is valid
-
species
¶ Taxonomy identifiers for which this namespace is valid
-
description
¶ Optional short description of the namespace
-
created
¶ DateTime of the creation of the namespace definition file
-
query_url
¶ URL that can be used to query the namespace (externally from PyBEL)
The author of the namespace
-
license
¶ License information
-
contact
¶ Contact information
-
-
class
pybel.manager.models.
NamespaceEntry
(**kwargs)[source]¶ Represents a name within a BEL namespace.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
name
¶ Name that is defined in the corresponding namespace definition file
-
identifier
¶ The database accession number
-
encoding
¶ The biological entity types for which this name is valid
-
-
class
pybel.manager.models.
Network
(**kwargs)[source]¶ Represents a collection of edges, specified by a BEL Script.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
name
¶ Name of the given Network (from the BEL file)
-
version
¶ Release version of the given Network (from the BEL file)
Authors of the underlying BEL file
-
contact
¶ Contact email from the underlying BEL file
-
description
¶ Descriptive text from the underlying BEL file
-
copyright
¶ Copyright information
-
disclaimer
¶ Disclaimer information
-
licenses
¶ License information
-
blob
¶ A pickled version of this network
-
classmethod
name_contains
(name_query)[source]¶ Build a filter for networks whose names contain the query.
-
classmethod
description_contains
(description_query)[source]¶ Build a filter for networks whose descriptions contain the query.
-
classmethod
id_in
(network_ids)[source]¶ Build a filter for networks whose identifiers appear in the given sequence.
-
store_bel
(graph)[source]¶ Insert a BEL graph.
- Parameters
graph (pybel.BELGraph) – A BEL Graph
-
-
class
pybel.manager.models.
Modification
(**kwargs)[source]¶ The modifications that are present in the network are stored in this table.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
type
¶ Type of the stored modification e.g. Fusion, gmod, pmod, etc
-
variantString
¶ HGVS string if sequence modification
-
residue
¶ Three letter amino acid code if PMOD
-
position
¶ Position of PMOD or GMOD
-
-
class
pybel.manager.models.
Node
(**kwargs)[source]¶ Represents a BEL Term.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
type
¶ The type of the represented biological entity e.g. Protein or Gene
-
is_variant
¶ Identifies weather or not the given node is a variant
-
has_fusion
¶ Identifies weather or not the given node is a fusion
-
bel
¶ Canonical BEL term that represents the given node
-
data
¶ PyBEL BaseEntity as JSON
-
-
class
pybel.manager.models.
Author
(**kwargs)[source]¶ Contains all author names.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
class
pybel.manager.models.
Citation
(**kwargs)[source]¶ The information about the citations that are used to prove a specific relation are stored in this table.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
db
¶ Type of the stored publication e.g. PubMed
-
db_id
¶ Reference identifier of the publication e.g. PubMed_ID
-
title
¶ Title of the publication
-
journal
¶ Journal name
-
volume
¶ Volume of the journal
-
issue
¶ Issue within the volume
-
pages
¶ Pages of the publication
-
date
¶ Publication date
-
first_id
¶ First author
-
last_id
¶ Last author
-
property
is_enriched
¶ Return if this citation has been enriched for name, title, and other metadata.
- Return type
-
-
class
pybel.manager.models.
Evidence
(**kwargs)[source]¶ This table contains the evidence text that proves a specific relationship and refers the source that is cited.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
text
¶ Supporting text from a given publication
-
-
class
pybel.manager.models.
Property
(**kwargs)[source]¶ The property table contains additional information that is used to describe the context of a relation.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
is_subject
¶ Identifies which participant of the edge if affected by the given property
-
modifier
¶ The modifier: one of activity, degradation, location, or translocation
-
relative_key
¶ Relative key of effect e.g. to_tloc or from_tloc
-
property
side
¶ Return either
pybel.constants.SUBJECT
orpybel.constants.OBJECT
.- Return type
-
-
class
pybel.manager.models.
Edge
(**kwargs)[source]¶ Relationships between BEL nodes and their properties, annotations, and provenance.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
bel
¶ Valid BEL statement that represents the given edge
-
md5
¶ The hash of the source, target, and associated metadata
-
data
¶ The stringified JSON representing this edge
-
to_json
(include_id=False)[source]¶ Create a dictionary of one BEL Edge that can be used to create an edge in a
BELGraph
.
-
insert_into_graph
(graph)[source]¶ Insert this edge into a BEL graph.
- Parameters
graph (pybel.BELGraph) – A BEL graph
-