@@ -256,7 +256,7 @@ def parent_enrichment(self):
256256 self .ancestor_enrichment (1 )
257257
258258 def synonym_lookup (self ) -> pd .DataFrame :
259- """
259+ """Return labels plus synonym rows for every seed term.
260260
261261 Returns:
262262 A DataFrame containing labels and synonyms of the terms from the seed list.
@@ -284,7 +284,7 @@ def synonym_lookup(self) -> pd.DataFrame:
284284 return result_df
285285
286286 def get_most_specific_objects (self , predicate : str , ontology : str ):
287- """
287+ """Return the most specific objects associated with the given predicate.
288288
289289 Args:
290290 predicate: Relationship that wanted to be explored
@@ -296,6 +296,7 @@ def get_most_specific_objects(self, predicate: str, ontology: str):
296296 - http://purl.obolibrary.org/obo/uberon.owl
297297
298298 Returns:
299+ DataFrame capturing subject, predicate, and object labels.
299300
300301 """
301302 subject_list = [term .get_iri () for term in self ._term_list ]
@@ -310,7 +311,7 @@ def get_most_specific_objects(self, predicate: str, ontology: str):
310311 )
311312
312313 def get_most_specific_subjects (self , predicate : str , ontology : str ):
313- """
314+ """Return the most specific subjects associated with the given predicate.
314315
315316 Args:
316317 predicate: Relationship that wanted to be explored
@@ -322,6 +323,7 @@ def get_most_specific_subjects(self, predicate: str, ontology: str):
322323 - http://purl.obolibrary.org/obo/uberon.owl
323324
324325 Returns:
326+ DataFrame capturing subject, predicate, and object labels.
325327
326328 """
327329 object_list = [term .get_iri () for term in self ._term_list ]
@@ -354,7 +356,8 @@ def update_obsoleted_terms(self):
354356 """Replaces all obsoleted terms in the term list with the new term that obsoletes them."""
355357 [getattr (term , "update_obsoleted_term" )() for term in self ._term_list ]
356358
357- def mirror_enrichment_for_graph_generation (self , term_list : List [str ]):
359+ def mirror_enrichment_for_graph_generation (self , term_list : List [str ]) -> None :
360+ """Populate `graph_df` with all pairwise enrichment edges for graph output."""
358361 # TODO definitely need a refactoring later on
359362 s_result = []
360363 for s_chunk in chunks (term_list , 45 ):
@@ -373,7 +376,8 @@ def mirror_enrichment_for_graph_generation(self, term_list: List[str]):
373376 .reset_index (drop = True )
374377 )
375378
376- def _generate_enrichment_graph (self , object_list ):
379+ def _generate_enrichment_graph (self , object_list : List [str ]) -> None :
380+ """Build the Graph representation backing the enrichment results."""
377381 self .mirror_enrichment_for_graph_generation (object_list )
378382 self .graph = GraphGenerator .generate_enrichment_graph (self .graph_df )
379383 self .graph = GraphGenerator .apply_transitive_reduction (self .graph , self .enriched_df ["p" ].unique ().tolist ())
0 commit comments