Class InteractionUtils


  • public class InteractionUtils
    extends Object
    Factory for experimental interactions
    Since:
    11/02/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • InteractionUtils

        public InteractionUtils()
    • Method Detail

      • createEmptyBasicExperimentalInteraction

        public static InteractionEvidence createEmptyBasicExperimentalInteraction()

        createEmptyBasicExperimentalInteraction

        Returns:
        a InteractionEvidence object.
      • findInteractionCategoryOf

        public static ComplexType findInteractionCategoryOf​(Interaction interaction,
                                                            boolean checkExperimentalRoleIfInteractionEvidence)
        The method will find the interactionCategory (binary, self, etc.)
        Parameters:
        interaction - a Interaction object.
        checkExperimentalRoleIfInteractionEvidence - a boolean.
        Returns:
        the ComplexType, null if the given interaction is null
      • findInteractionEvidenceCategoryOf

        public static ComplexType findInteractionEvidenceCategoryOf​(InteractionEvidence interaction)
        The method will find the interactionCategory (binary, self, etc.)
        Parameters:
        interaction - a InteractionEvidence object.
        Returns:
        the ComplexType, null if the given interaction is null
      • findModelledInteractionCategoryOf

        public static ComplexType findModelledInteractionCategoryOf​(ModelledInteraction interaction)
        The method will find the interactionCategory (binary, self, etc.)
        Parameters:
        interaction - a ModelledInteraction object.
        Returns:
        the ComplexType, null if the given interaction is null
      • createBinaryInteractionFrom

        public static BinaryInteraction createBinaryInteractionFrom​(Interaction interaction)
        Create a BinaryInteractionWrapper from the given interaction which should contain not more than two participants.
        Parameters:
        interaction - a Interaction object.
        Returns:
        the new BinaryInteractionWrapper for this interaction
        Throws:
        IllegalArgumentException - if the interaction contains more than two participants or interaction is null
      • createBinaryInteractionEvidenceFrom

        public static BinaryInteractionEvidence createBinaryInteractionEvidenceFrom​(InteractionEvidence interaction)
        Create a BinaryInteractionEvidenceWrapper from the given interaction evidence which should contain not more than two participants
        Parameters:
        interaction - a InteractionEvidence object.
        Returns:
        the new BinaryInteractionWrapper for this interaction
        Throws:
        IllegalArgumentException - if the interaction contains more than two participants or interaction is null
      • createModelledBinaryInteractionFrom

        public static ModelledBinaryInteraction createModelledBinaryInteractionFrom​(ModelledInteraction interaction)
        Create a ModelledBinaryInteractionWrapper from the given modelled interaction which should contain not more than two participants
        Parameters:
        interaction - a ModelledInteraction object.
        Returns:
        the new BinaryInteractionWrapper for this interaction
        Throws:
        IllegalArgumentException - if the interaction contains more than two participants
      • createNewSelfBinaryInteractionFrom

        public static BinaryInteraction createNewSelfBinaryInteractionFrom​(Interaction interaction)
        Creates a new BinaryInteraction from the given interaction which should only contain one participant with a stoichiometry >= 2 or participant stoichiometry null and participant is not self/putative self. The new Binary interaction will have a participantB which is a copy of participantA with stoichiometry 0
        Parameters:
        interaction - a Interaction object.
        Returns:
        a BinaryInteraction object.
      • createAndAddNewSelfBinaryInteractionEvidence

        public static BinaryInteractionEvidence createAndAddNewSelfBinaryInteractionEvidence​(InteractionEvidence interaction)
        Creates a new BinaryInteractionEvidence from the given interactionEvidence which should only contain one participant with a stoichiometry >= 2 or participant stoichiometry null and participant is not self/putative self. The new Binary interaction evidence will have a participantB which is a copy of participantA with stoichiometry 0
        Parameters:
        interaction - a InteractionEvidence object.
        Returns:
        a BinaryInteractionEvidence object.
      • createAndAddNewSelfModelledBinaryInteraction

        public static ModelledBinaryInteraction createAndAddNewSelfModelledBinaryInteraction​(ModelledInteraction interaction)
        Creates a new ModelledBinaryInteraction from the given interaction which should only contain one participant with a stoichiometry >= 2 or participant stoichiometry null and participant is not self/putative self. The new Binary interaction evidence will have a participantB which is a copy of participantA with stoichiometry 0
        Parameters:
        interaction - a ModelledInteraction object.
        Returns:
        a ModelledBinaryInteraction object.
      • collectComplexExpansionMethodFromAnnotations

        public static Annotation collectComplexExpansionMethodFromAnnotations​(Collection<? extends Annotation> annotations)

        collectComplexExpansionMethodFromAnnotations

        Parameters:
        annotations - a Collection object.
        Returns:
        a Annotation object.
      • extractParticipantWithCausalRelationships

        public static Collection<Participant> extractParticipantWithCausalRelationships​(Interaction interaction)
        This method can return all participants having causal relationships in an interaction
        Parameters:
        interaction - a Interaction object.
        Returns:
        the collection of participants having causal relationships, empty collection if no participants with causal relationships