pub struct IMAnnData { /* private fields */ }Implementations§
Source§impl IMAnnData
impl IMAnnData
Sourcepub fn new(
x: IMArrayElement,
obs: IMDataFrameElement,
var: IMDataFrameElement,
) -> Result<Self>
pub fn new( x: IMArrayElement, obs: IMDataFrameElement, var: IMDataFrameElement, ) -> Result<Self>
Sourcepub fn new_basic(
matrix: ArrayData,
obs_names: Vec<String>,
var_names: Vec<String>,
) -> Result<Self>
pub fn new_basic( matrix: ArrayData, obs_names: Vec<String>, var_names: Vec<String>, ) -> Result<Self>
Creates a new basic IMAnnData instance from a sparse matrix and index names.
§Arguments
matrix- A sparse matrix (CsrArray) containing the main data.obs_names- Names for the observations (rows).var_names- Names for the variables (columns).
§Returns
Returns Result<IMAnnData> if successful, otherwise returns an Err.
§Errors
Returns an error if there’s a mismatch in dimensions or if DataFrame creation fails.
pub fn new_extended( matrix: ArrayData, obs_names: Vec<String>, var_names: Vec<String>, obs_df: DataFrame, var_df: DataFrame, ) -> Result<Self>
pub fn obs_names(&self) -> Vec<String>
pub fn var_names(&self) -> Vec<String>
Sourcepub fn x(&self) -> IMArrayElement
pub fn x(&self) -> IMArrayElement
Returns a shallow clone of the main data matrix.
§Notes
This method returns a new IMArrayElement that shares the same underlying data with the original.
Modifications to the returned IMArrayElement will affect the original data.
Sourcepub fn obs(&self) -> IMDataFrameElement
pub fn obs(&self) -> IMDataFrameElement
Returns a shallow clone of the observations metadata.
§Notes
This method returns a new IMDataFrameElement that shares the same underlying data with the original.
Modifications to the returned IMDataFrameElement will affect the original data.
Sourcepub fn var(&self) -> IMDataFrameElement
pub fn var(&self) -> IMDataFrameElement
Returns a shallow clone of the variable DataFrame.
§Notes
This method returns a new IMDataFrameElement that shares the same underlying data with the original.
Modifications to the returned IMDataFrameElement will affect the original data.
Sourcepub fn get_layer(&self, name: &str) -> Result<IMArrayElement>
pub fn get_layer(&self, name: &str) -> Result<IMArrayElement>
Sourcepub fn get_layer_shallow(&self, name: &str) -> Result<IMArrayElement>
pub fn get_layer_shallow(&self, name: &str) -> Result<IMArrayElement>
Sourcepub fn remove_layer(&mut self, name: &str) -> Result<IMArrayElement>
pub fn remove_layer(&mut self, name: &str) -> Result<IMArrayElement>
Sourcepub fn update_array(&mut self, name: &str, data: IMArrayElement) -> Result<()>
pub fn update_array(&mut self, name: &str, data: IMArrayElement) -> Result<()>
Sourcepub fn obsm(&self) -> IMAxisArrays
pub fn obsm(&self) -> IMAxisArrays
Returns a shallow clone of the observation multi-dimensional annotation.
§Returns
Returns an IMAxisArrays instance that shares the same underlying data with the original.
§Notes
This method performs a shallow clone, meaning the returned IMAxisArrays shares the same
Arc pointer to the RwLock containing the data. Any modifications made through this clone
will affect the original data in the IMAnnData instance.
Sourcepub fn obsp(&self) -> IMAxisArrays
pub fn obsp(&self) -> IMAxisArrays
Returns a shallow clone of the observation pairwise annotation.
§Returns
Returns an IMAxisArrays instance that shares the same underlying data with the original.
§Notes
This method performs a shallow clone, meaning the returned IMAxisArrays shares the same
Arc pointer to the RwLock containing the data. Any modifications made through this clone
will affect the original data in the IMAnnData instance.
Sourcepub fn varm(&self) -> IMAxisArrays
pub fn varm(&self) -> IMAxisArrays
Returns a shallow clone of the variable multi-dimensional annotation.
§Returns
Returns an IMAxisArrays instance that shares the same underlying data with the original.
§Notes
This method performs a shallow clone, meaning the returned IMAxisArrays shares the same
Arc pointer to the RwLock containing the data. Any modifications made through this clone
will affect the original data in the IMAnnData instance.
Sourcepub fn varp(&self) -> IMAxisArrays
pub fn varp(&self) -> IMAxisArrays
Returns a shallow clone of the variable pairwise annotation.
§Returns
Returns an IMAxisArrays instance that shares the same underlying data with the original.
§Notes
This method performs a shallow clone, meaning the returned IMAxisArrays shares the same
Arc pointer to the RwLock containing the data. Any modifications made through this clone
will affect the original data in the IMAnnData instance.
Sourcepub fn uns(&self) -> IMElementCollection
pub fn uns(&self) -> IMElementCollection
Returns a shallow clone of the unstructured annotation.
§Returns
Returns an IMElementCollection instance that shares the same underlying data with the original.
§Notes
This method performs a shallow clone, meaning the returned IMElementCollection shares the same
Arc pointer to the RwLock containing the data. Any modifications made through this clone
will affect the original data in the IMAnnData instance.
Sourcepub fn layers(&self) -> IMAxisArrays
pub fn layers(&self) -> IMAxisArrays
Returns a shallow clone of the layers of data.
§Returns
Returns an IMAxisArrays instance that shares the same underlying data with the original.
§Notes
This method performs a shallow clone, meaning the returned IMAxisArrays shares the same
Arc pointer to the RwLock containing the data. Any modifications made through this clone
will affect the original data in the IMAnnData instance.
pub fn subset_inplace(&mut self, selection: &[&SelectInfoElem]) -> Result<()>
pub fn subset(&self, selection: &[&SelectInfoElem]) -> Result<Self>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IMAnnData
impl !RefUnwindSafe for IMAnnData
impl Send for IMAnnData
impl Sync for IMAnnData
impl Unpin for IMAnnData
impl !UnwindSafe for IMAnnData
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.