Skip to contents

Build a permeability value object for create_compound()'s permeability argument (or the writable Compound$permeability field). Produces one default Permeability alternative with parameter "Permeability".

Usage

permeability(value, unit = "cm/min", name = "User defined", default = FALSE)

Arguments

value

Numeric scalar. Permeability value.

unit

Character. Unit for the parameter, validated against dimension "Velocity". Defaults to "cm/min".

name

Character. Name of the created alternative. Defaults to "User defined".

default

Logical. Whether this alternative is the group's default when it appears in a list of alternatives passed to the matching create_compound() argument or Compound field. Defaults to FALSE. Ignored for a single (non-list) value object, which is always the default. When a list has no element marked default = TRUE, the first element is the default (unchanged behaviour); marking two or more elements default = TRUE in the same list is an error.

Value

A permeability_spec object to pass to create_compound().

Examples

permeability(0.0069)
#> $value
#> [1] 0.0069
#> 
#> $unit
#> [1] "cm/min"
#> 
#> $name
#> [1] "User defined"
#> 
#> $default
#> [1] FALSE
#> 
#> attr(,"class")
#> [1] "permeability_spec" "osp_value_spec"   
create_compound(name = "Drug X", permeability = permeability(0.0069))
#> 
#> ── Compound: Drug X ────────────────────────────────────────────────────────────
#> 
#> ── Basic Properties ──
#> 
#> ── Physicochemical Properties ──
#> 
#> • Permeability:
#>   • 0.0069 cm/min [Unknown]

# Several alternatives, the second marked as the default
create_compound(
  name = "Drug X",
  permeability = list(
    permeability(0.0069, name = "Measured"),
    permeability(0.008, name = "Predicted", default = TRUE)
  )
)
#> 
#> ── Compound: Drug X ────────────────────────────────────────────────────────────
#> 
#> ── Basic Properties ──
#> 
#> ── Physicochemical Properties ──
#> 
#> • Permeability:
#>   • Measured: 0.0069 cm/min [Unknown]
#>   • Predicted (Default): 0.008 cm/min [Unknown]