NCAOptions

Struct NCAOptions 

pub struct NCAOptions {
    pub auc_method: AUCMethod,
    pub blq_rule: BLQRule,
    pub lambda_z: LambdaZOptions,
    pub tau: Option<f64>,
    pub auc_interval: Option<(f64, f64)>,
    pub c0_methods: Vec<C0Method>,
    pub max_auc_extrap_pct: f64,
    pub concentration_threshold: Option<f64>,
    pub route_override: Option<Route>,
    pub outeq: usize,
    pub dose_times: Option<Vec<f64>>,
}
Expand description

Complete NCA configuration

Dose and route information are automatically detected from the data. Use these options to control calculation methods and quality thresholds.

Fields§

§auc_method: AUCMethod

AUC calculation method (default: LinUpLogDown)

§blq_rule: BLQRule

BLQ handling rule (default: Exclude)

When an observation is censored (Censor::BLOQ or Censor::ALOQ), its value represents the quantification limit (lower or upper). This rule determines how such observations are handled in the analysis.

Note: ALOQ (Above LOQ) values are currently kept unchanged in the analysis. This follows PKNCA behavior which also does not explicitly handle ALOQ.

§lambda_z: LambdaZOptions

Terminal phase (λz) estimation options

§tau: Option<f64>

Dosing interval for steady-state analysis (None = single-dose)

§auc_interval: Option<(f64, f64)>

Time interval for partial AUC calculation (start, end)

If specified, auc_partial in the result will contain the AUC over this interval. Useful for regulatory submissions requiring AUC over specific time windows (e.g., AUC0-4h).

§c0_methods: Vec<C0Method>

C0 estimation methods for IV bolus (tried in order)

Default: [Observed, LogSlope, FirstConc]

§max_auc_extrap_pct: f64

Maximum acceptable AUC extrapolation percentage (default: 20.0)

§concentration_threshold: Option<f64>

Target concentration for time-above-concentration calculation (None = skip)

When specified, the result will contain time_above_mic — the total time the concentration profile is above this threshold. Uses linear interpolation at crossing points. Commonly set to MIC for antibiotics.

§route_override: Option<Route>

Override the auto-detected route

By default, the administration route is inferred from dose events (compartment number). Set this to override the heuristic when the auto-detection gives wrong results (e.g., models where compartment 1 is a depot, not central).

§outeq: usize

Output equation index to analyze (default: 0)

For multi-output models, select which output equation to run NCA on.

§dose_times: Option<Vec<f64>>

Dose times for multi-dose NCA (None = single-dose)

When set, AUC/Cmax/Tmax will be computed for each dosing interval and stored in [NCAResult::multi_dose].

Implementations§

§

impl NCAOptions

pub fn bioequivalence() -> NCAOptions

FDA Bioequivalence study defaults

pub fn sparse() -> NCAOptions

Lenient settings for sparse/exploratory data

pub fn with_auc_method(self, method: AUCMethod) -> NCAOptions

Set AUC calculation method

pub fn with_blq_rule(self, rule: BLQRule) -> NCAOptions

Set BLQ handling rule

Censoring is determined by Censor markings on observations (BLOQ/ALOQ), not by a numeric threshold. This method sets how censored observations are handled in the analysis.

pub fn with_tau(self, tau: f64) -> NCAOptions

Set dosing interval for steady-state analysis

pub fn with_auc_interval(self, start: f64, end: f64) -> NCAOptions

Set time interval for partial AUC calculation

pub fn with_lambda_z(self, options: LambdaZOptions) -> NCAOptions

Set lambda-z options

pub fn with_min_r_squared(self, min_r_squared: f64) -> NCAOptions

Set minimum R² for lambda-z

pub fn with_c0_methods(self, methods: Vec<C0Method>) -> NCAOptions

Set C0 estimation methods (tried in order)

pub fn with_concentration_threshold(self, threshold: f64) -> NCAOptions

Set a target concentration threshold for time-above-concentration

When set, the result will include time_above_mic — the total time the profile is above this concentration.

pub fn with_route(self, route: Route) -> NCAOptions

Override the auto-detected route

Use this when the auto-detection from compartment numbers gives wrong results. For example, if your model uses compartment 1 as a depot (not central), the auto-detection would incorrectly classify it as IV.

pub fn with_outeq(self, outeq: usize) -> NCAOptions

Set output equation index (default: 0)

pub fn with_dose_times(self, times: Vec<f64>) -> NCAOptions

Set dose times for multi-dose NCA (interval-based AUC, Cmax, Tmax)

When set, analyze will compute AUC, Cmax, and Tmax for each dosing interval and store them in [NCAResult::multi_dose].

Trait Implementations§

§

impl Clone for NCAOptions

§

fn clone(&self) -> NCAOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for NCAOptions

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for NCAOptions

§

fn default() -> NCAOptions

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for NCAOptions

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<NCAOptions, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for NCAOptions

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Context for T
where T: Clone + Default,

§

fn vector_from_element<V>(&self, len: usize, value: <V as VectorCommon>::T) -> V
where V: Vector<C = Self>,

§

fn vector_from_vec<V>(&self, vec: Vec<<V as VectorCommon>::T>) -> V
where V: Vector<C = Self>,

§

fn vector_zeros<V>(&self, len: usize) -> V
where V: Vector<C = Self>,

§

fn dense_mat_zeros<V>( &self, rows: usize, cols: usize, ) -> <V as DefaultDenseMatrix>::M
where V: Vector<C = Self> + DefaultDenseMatrix,

§

impl<T> DistributionExt for T
where T: ?Sized,

§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

§

impl<T> SendAlias for T

§

impl<T> SyncAlias for T