Skip to content

Commit

Permalink
Direct access to interaction_elements from the pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
earmingol committed Mar 22, 2023
1 parent d20b7d2 commit 4a18169
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cell2cell/analysis/cell2cell_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,14 @@ def compute_pairwise_communication_scores(self, communication_score=None, use_pp
cci_type=cci_type,
verbose=verbose)

@property
def interaction_elements(self):
'''Returns the interaction elements within an interaction space.'''
if hasattr(self.interaction_space, 'interaction_elements'):
return self.interaction_space.interaction_elements
else:
return None


class SingleCellInteractions:
'''Interaction class with all necessary methods to run the cell2cell pipeline
Expand Down Expand Up @@ -614,6 +622,7 @@ class SingleCellInteractions:
'''
compute_pairwise_cci_scores = BulkInteractions.compute_pairwise_cci_scores
compute_pairwise_communication_scores = BulkInteractions.compute_pairwise_communication_scores
interaction_elements = BulkInteractions.interaction_elements

def __init__(self, rnaseq_data, ppi_data, metadata, interaction_columns=('A', 'B'),
communication_score='expression_thresholding', cci_score='bray_curtis', cci_type='undirected',
Expand Down

0 comments on commit 4a18169

Please sign in to comment.