Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/reorder ontology #59

Merged
merged 3 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,5 @@ harness = false
name = "ancestors"
harness = false

[[bench]]
name = "parser"
harness = false

[profile.release]
lto = true
15 changes: 10 additions & 5 deletions src/annotations/gene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ impl Gene {
&self.name
}

/// Connect another [HPO term](`crate::HpoTerm`) to the gene
pub fn add_term<I: Into<HpoTermId>>(&mut self, term_id: I) -> bool {
self.hpos.insert(term_id)
}

/// The set of connected HPO terms
pub fn hpo_terms(&self) -> &HpoGroup {
&self.hpos
Expand Down Expand Up @@ -193,6 +188,16 @@ impl Gene {
pub fn to_hpo_set<'a>(&self, ontology: &'a Ontology) -> HpoSet<'a> {
HpoSet::new(ontology, self.hpos.clone())
}

/// Connect another [HPO term](`crate::HpoTerm`) to the gene
///
/// # Note
///
/// This method does **not** add the [`Gene`] to the [HPO term](`crate::HpoTerm`).
/// Clients should not use this method, unless they are creating their own Ontology.
pub fn add_term<I: Into<HpoTermId>>(&mut self, term_id: I) -> bool {
self.hpos.insert(term_id)
}
}

impl PartialEq for Gene {
Expand Down
15 changes: 10 additions & 5 deletions src/annotations/omim_disease.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ impl OmimDisease {
&self.name
}

/// Connect another [HPO term](`crate::HpoTerm`) to the disease
pub fn add_term<I: Into<HpoTermId>>(&mut self, term_id: I) -> bool {
self.hpos.insert(term_id)
}

/// The set of connected HPO terms
pub fn hpo_terms(&self) -> &HpoGroup {
&self.hpos
Expand Down Expand Up @@ -167,6 +162,16 @@ impl OmimDisease {
pub fn to_hpo_set<'a>(&self, ontology: &'a Ontology) -> HpoSet<'a> {
HpoSet::new(ontology, self.hpos.clone())
}

/// Connect another [HPO term](`crate::HpoTerm`) to the disease
///
/// # Note
///
/// This method does **not** add the [`OmimDisease`] to the [HPO term](`crate::HpoTerm`).
/// Clients should not use this method, unless they are creating their own Ontology.
pub fn add_term<I: Into<HpoTermId>>(&mut self, term_id: I) -> bool {
self.hpos.insert(term_id)
}
}

impl PartialEq for OmimDisease {
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub mod utils;
pub use ontology::comparison;
pub use ontology::Ontology;
pub use set::HpoSet;
#[doc(inline)]
pub use term::{HpoTerm, HpoTermId};

const DEFAULT_NUM_PARENTS: usize = 10;
Expand Down
Loading
Loading