pub struct GeneSets {
pub names: FxHashMap<Box<str>, Box<str>>,
pub term_genes: FxHashMap<Box<str>, FxHashSet<Box<str>>>,
pub gene_aliases: FxHashMap<Box<str>, FxHashSet<Box<str>>>,
}Expand description
A collection of gene-sets keyed by term id — the common form all sources (GAF/GMT/markers) reduce to before scoring.
Fields§
§names: FxHashMap<Box<str>, Box<str>>term id → display name (absent ⇒ display the id itself).
term_genes: FxHashMap<Box<str>, FxHashSet<Box<str>>>term id → member gene keys (upper-cased primary identifier).
gene_aliases: FxHashMap<Box<str>, FxHashSet<Box<str>>>gene key → all identifier aliases for that gene (including the key), used to reconcile against an expression dictionary (HGNC / ENSG / UniProt).
Implementations§
Source§impl GeneSets
impl GeneSets
Sourcepub fn reconcile(
&self,
index: &GeneIndex,
min_members: usize,
max_members: Option<usize>,
) -> Reconciled
pub fn reconcile( &self, index: &GeneIndex, min_members: usize, max_members: Option<usize>, ) -> Reconciled
Reconcile each member gene against index (built over the expression
dictionary), trying every identifier alias and taking the first hit, then
keep only terms whose matched-member count is in
[min_members, max_members]. The upper bound matters: GSEA es_std is
ill-behaved for near-universal sets (their restandardization SD collapses
→ spurious huge z), so giant root-level terms must be excluded — the
standard GSEA size window. max_members = None disables the cap. Handles
HGNC / ENSG / ENSG_HGNC conventions via GeneIndex.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GeneSets
impl RefUnwindSafe for GeneSets
impl Send for GeneSets
impl Sync for GeneSets
impl Unpin for GeneSets
impl UnsafeUnpin for GeneSets
impl UnwindSafe for GeneSets
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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
impl<T> Read<Exclusive, BecauseExclusive> 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.