Struct Subject
pub struct Subject { /* private fields */ }Expand description
A subject in a pharmacometric dataset
A Subject represents a single individual with one or more occasions of data, each containing events (doses, observations) and covariates.
Implementations§
§impl Subject
impl Subject
pub fn occasions(&self) -> &[Occasion]
pub fn occasions(&self) -> &[Occasion]
Get a vector of references to all occasions for this subject
§Returns
A slice of all occasions for this subject
pub fn from_occasions(id: String, occasions: Vec<Occasion>) -> Subject
pub fn from_occasions(id: String, occasions: Vec<Occasion>) -> Subject
Create a new subject from one or more occasions
This is useful when you want to create a subject from specific occasions rather than building it completely from scratch.
§Arguments
id- The subject identifieroccasions- Vector of occasions to include in this subject
§Returns
A new subject containing the specified occasions
pub fn occasions_mut(&mut self) -> &mut Vec<Occasion>
pub fn occasions_mut(&mut self) -> &mut Vec<Occasion>
Iterate over a mutable reference to the occasions
pub fn occasions_iter_mut(&mut self) -> IterMut<'_, Occasion>
pub fn occasions_iter_mut(&mut self) -> IterMut<'_, Occasion>
Get a mutable iterator to the occasions
pub fn get_output_equations(&self) -> Vec<usize>
pub fn get_occasion_mut(&mut self, index: usize) -> Option<&mut Occasion>
pub fn get_occasion_mut(&mut self, index: usize) -> Option<&mut Occasion>
pub fn iter_mut(&mut self) -> IterMut<'_, Occasion>
pub fn iter_mut(&mut self) -> IterMut<'_, Occasion>
Get a mutable iterator over all occasions
§Returns
A mutable iterator yielding references to occasions
§impl Subject
impl Subject
pub fn nca_with_dose(
&self,
dose_amount: f64,
route: Route,
infusion_duration: Option<f64>,
options: &NCAOptions,
) -> Result<NCAResult, NCAError>
pub fn nca_with_dose( &self, dose_amount: f64, route: Route, infusion_duration: Option<f64>, options: &NCAOptions, ) -> Result<NCAResult, NCAError>
Run NCA with an explicit dose on the first occasion, overriding what is embedded in the subject’s events.
Use this when you want to supply or override dose amount, route, or infusion duration without modifying the underlying data.
Trait Implementations§
§impl<'de> Deserialize<'de> for Subject
impl<'de> Deserialize<'de> for Subject
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Subject, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Subject, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<'a> IntoIterator for &'a Subject
impl<'a> IntoIterator for &'a Subject
§impl<'a> IntoIterator for &'a mut Subject
impl<'a> IntoIterator for &'a mut Subject
§impl IntoIterator for Subject
impl IntoIterator for Subject
§impl NCA for Subject
impl NCA for Subject
§fn nca(&self, options: &NCAOptions) -> Result<NCAResult, NCAError>
fn nca(&self, options: &NCAOptions) -> Result<NCAResult, NCAError>
§fn nca_all(&self, options: &NCAOptions) -> Vec<Result<NCAResult, NCAError>>
fn nca_all(&self, options: &NCAOptions) -> Vec<Result<NCAResult, NCAError>>
§impl ObservationMetrics for Subject
impl ObservationMetrics for Subject
§fn auc_blq(
&self,
outeq: usize,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn auc_blq( &self, outeq: usize, method: &AUCMethod, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
§fn auc_interval_blq(
&self,
outeq: usize,
start: f64,
end: f64,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn auc_interval_blq( &self, outeq: usize, start: f64, end: f64, method: &AUCMethod, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
§fn cmax_blq(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn cmax_blq( &self, outeq: usize, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
§fn tmax_blq(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn tmax_blq( &self, outeq: usize, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
§fn clast_blq(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn clast_blq( &self, outeq: usize, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
§fn tlast_blq(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn tlast_blq( &self, outeq: usize, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
§fn aumc_blq(
&self,
outeq: usize,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn aumc_blq( &self, outeq: usize, method: &AUCMethod, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
§fn auc(
&self,
outeq: usize,
method: &AUCMethod,
) -> Vec<Result<f64, MetricsError>>
fn auc( &self, outeq: usize, method: &AUCMethod, ) -> Vec<Result<f64, MetricsError>>
§fn auc_interval(
&self,
outeq: usize,
start: f64,
end: f64,
method: &AUCMethod,
) -> Vec<Result<f64, MetricsError>>
fn auc_interval( &self, outeq: usize, start: f64, end: f64, method: &AUCMethod, ) -> Vec<Result<f64, MetricsError>>
§fn aumc(
&self,
outeq: usize,
method: &AUCMethod,
) -> Vec<Result<f64, MetricsError>>
fn aumc( &self, outeq: usize, method: &AUCMethod, ) -> Vec<Result<f64, MetricsError>>
§fn auc_first(
&self,
outeq: usize,
method: &AUCMethod,
) -> Result<f64, MetricsError>
fn auc_first( &self, outeq: usize, method: &AUCMethod, ) -> Result<f64, MetricsError>
§fn cmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn cmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
§fn tmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn tmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
§fn clast_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn clast_first(&self, outeq: usize) -> Result<f64, MetricsError>
§fn tlast_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn tlast_first(&self, outeq: usize) -> Result<f64, MetricsError>
§fn aumc_first(
&self,
outeq: usize,
method: &AUCMethod,
) -> Result<f64, MetricsError>
fn aumc_first( &self, outeq: usize, method: &AUCMethod, ) -> Result<f64, MetricsError>
§fn auc_interval_first(
&self,
outeq: usize,
start: f64,
end: f64,
method: &AUCMethod,
) -> Result<f64, MetricsError>
fn auc_interval_first( &self, outeq: usize, start: f64, end: f64, method: &AUCMethod, ) -> Result<f64, MetricsError>
§fn auc_blq_first(
&self,
outeq: usize,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Result<f64, MetricsError>
fn auc_blq_first( &self, outeq: usize, method: &AUCMethod, blq_rule: &BLQRule, ) -> Result<f64, MetricsError>
§fn cmax_blq_first(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Result<f64, MetricsError>
fn cmax_blq_first( &self, outeq: usize, blq_rule: &BLQRule, ) -> Result<f64, MetricsError>
§fn auc_interval_blq_first(
&self,
outeq: usize,
start: f64,
end: f64,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Result<f64, MetricsError>
fn auc_interval_blq_first( &self, outeq: usize, start: f64, end: f64, method: &AUCMethod, blq_rule: &BLQRule, ) -> Result<f64, MetricsError>
§impl Serialize for Subject
impl Serialize for Subject
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl SubjectBuilderExt for Subject
impl SubjectBuilderExt for Subject
§impl Superposition for Subject
impl Superposition for Subject
§fn superposition(
&self,
tau: f64,
options: &NCAOptions,
n_eval_points: Option<usize>,
) -> Result<SuperpositionResult, NCAError>
fn superposition( &self, tau: f64, options: &NCAOptions, n_eval_points: Option<usize>, ) -> Result<SuperpositionResult, NCAError>
Auto Trait Implementations§
impl Freeze for Subject
impl RefUnwindSafe for Subject
impl Send for Subject
impl Sync for Subject
impl Unpin for Subject
impl UnwindSafe for Subject
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,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.