Struct biodivine_sketchbook::sketchbook::model::_regulation::Regulation
source · pub struct Regulation {
regulator: VarId,
target: VarId,
essential: Essentiality,
regulation_sign: Monotonicity,
}
Expand description
Describes an interaction between two variables, regulator
and target
.
Every regulation can be monotonous and can be set as essential:
Monotonicity is positive
, negative
, dual
, or unknown
. The monotonicity signifies how
the presence of the regulator
affects the value of the target
:
- if the regulation is
positive
, it might only increase thetarget
value - if the regulation is
negative
, it might only decrease thetarget
value - if the regulation is
dual
, it might both increase or decrease thetarget
value (in different contexts)
If essentiality is set to true, the regulator
must have influence on the outcome
of the target
update function in some context. If set to False
, this regulation must have
no effect. If it is Unknown
, the essentiality is not enforced (i.e. the regulator
can
have an influence on the target
, but it is not required).
Regulations can be represented as strings in the
form "regulator_name 'relationship' target_name"
. The ‘relationship’ starts with -
, which
is followed by >
for activation (positive monotonicity), |
for inhibition (negative
monotonicity), *
for dual effect (non-monotonic) or ?
for unspecified monotonicity.
Finally, an additional X
, ?
at the end of ‘relationship’ signifies that the the regulation
is non-essential (non-essential) or the essentiality is unknown, respectively.
Together, this gives the following options: ->, ->?, -|, -|?, -*, -*?, -?, -??
.
Fields§
§regulator: VarId
§target: VarId
§essential: Essentiality
§regulation_sign: Monotonicity
Implementations§
source§impl Regulation
impl Regulation
Methods for safely generating new Regulations
.
sourcepub fn new(
regulator: VarId,
target: VarId,
essential: Essentiality,
regulation_sign: Monotonicity,
) -> Regulation
pub fn new( regulator: VarId, target: VarId, essential: Essentiality, regulation_sign: Monotonicity, ) -> Regulation
Create new Regulation
given all the components.
sourcepub fn try_from_string(regulation_str: &str) -> Result<Regulation, String>
pub fn try_from_string(regulation_str: &str) -> Result<Regulation, String>
Try to read the regulation from a given string in the standard format. Returns error if the string is invalid.
sourcepub fn try_components_from_string(
regulation_str: &str,
) -> Result<(String, Monotonicity, Essentiality, String), String>
pub fn try_components_from_string( regulation_str: &str, ) -> Result<(String, Monotonicity, Essentiality, String), String>
Try to read all available information about a regulation from a given string in the standard format.
The returned data correspond to the items as they appear in the string, i.e. regulator
,
regulation_sign
, essentiality
and target
. If the string is not valid, returns None
.
source§impl Regulation
impl Regulation
Basic getters and other non-modifying methods.
sourcepub fn is_essential(&self) -> bool
pub fn is_essential(&self) -> bool
Check if the regulation is marked as essential.
Note that both negative or unknown essentiality results in false
.
sourcepub fn get_essentiality(&self) -> &Essentiality
pub fn get_essentiality(&self) -> &Essentiality
Get the essentiality of the regulation.
sourcepub fn get_sign(&self) -> &Monotonicity
pub fn get_sign(&self) -> &Monotonicity
Get the sign of the regulation.
sourcepub fn get_regulator(&self) -> &VarId
pub fn get_regulator(&self) -> &VarId
Get the VarId
of the regulator.
sourcepub fn get_target(&self) -> &VarId
pub fn get_target(&self) -> &VarId
Get the VarId
of the target.
source§impl Regulation
impl Regulation
Methods for editing Regulations
.
sourcepub fn swap_regulator(&mut self, new_regulator: VarId)
pub fn swap_regulator(&mut self, new_regulator: VarId)
Directly swap original regulator with a given one.
sourcepub fn swap_target(&mut self, new_target: VarId)
pub fn swap_target(&mut self, new_target: VarId)
Directly swap original target with a given one.
sourcepub fn swap_sign(&mut self, new_sign: Monotonicity)
pub fn swap_sign(&mut self, new_sign: Monotonicity)
Directly swap original sign with a given one.
sourcepub fn swap_essentiality(&mut self, new_essentiality: Essentiality)
pub fn swap_essentiality(&mut self, new_essentiality: Essentiality)
Directly swap original essentiality with a given one.
Trait Implementations§
source§impl Clone for Regulation
impl Clone for Regulation
source§fn clone(&self) -> Regulation
fn clone(&self) -> Regulation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Regulation
impl Debug for Regulation
source§impl<'de> Deserialize<'de> for Regulation
impl<'de> Deserialize<'de> for Regulation
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for Regulation
impl Display for Regulation
source§impl Hash for Regulation
impl Hash for Regulation
source§impl PartialEq for Regulation
impl PartialEq for Regulation
source§impl Serialize for Regulation
impl Serialize for Regulation
impl Eq for Regulation
impl StructuralPartialEq for Regulation
Auto Trait Implementations§
impl Freeze for Regulation
impl RefUnwindSafe for Regulation
impl Send for Regulation
impl Sync for Regulation
impl Unpin for Regulation
impl UnwindSafe for Regulation
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.