Models¶
ComPath database model.
-
class
compath.models.
User
(**kwargs)[source]¶ User 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.
-
property
is_admin
¶ Is this user an administrator?.
-
property
-
class
compath.models.
Role
(**kwargs)[source]¶ Role 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.
-
class
compath.models.
PathwayMapping
(**kwargs)[source]¶ Mapping 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.
-
service_1_name
¶ service name (e.g., KEGG or Reactome
-
service_1_pathway_id
¶ pathway 1 id
-
service_1_pathway_name
¶ pathway 1 name
-
service_2_name
¶ service name (e.g., KEGG or Reactome
-
service_2_pathway_id
¶ pathway 2 id
-
service_2_pathway_name
¶ pathway 2 name
-
type
¶ Type of Mapping (isPartOf or equivalentTo)
-
accepted
¶ accepted mapping by the admin/curator consensus
-
get_complement_mapping_info
(service_name, pathway_id, pathway_name)[source]¶ Return the info corresponding to the other pathway in a mapping.
-
static
has_pathway_tuple
(type, service_name, pathway_id, pathway_name)[source]¶ Return a filter to get all mappings matching type, service and pathway name and id.
-
static
has_descendant_pathway_tuple
(type, service_name, pathway_id, pathway_name)[source]¶ Return a filter to get all the descendants mappings matching a isPartOf relationship (the predicates), service and pathway name and id.
-
static
has_ancestry_pathway_tuple
(type, service_name, pathway_id, pathway_name)[source]¶ Return a filter to get all the ancestries mappings matching a isPartOf relationship (the subjects), service and pathway name and id.
-
static
has_pathway
(service_name, pathway_id, pathway_name)[source]¶ Return a filter to get all mappings matching service and pathway name and id.
-
static
has_database_pathway
(service_name)[source]¶ Return a filter to get all mappings matching service a name.
-
property
is_acceptable
¶ Return true if the mapping has enough votes to be accepted.
- Return type
-
-
class
compath.models.
Vote
(**kwargs)[source]¶ Vote 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 vote, by default is up-vote
-