Class InteractionCloner


  • public class InteractionCloner
    extends Object
    Utility class to clone and copy interaction properties
    Since:
    13/02/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • InteractionCloner

        public InteractionCloner()
    • Method Detail

      • copyAndOverrideInteractionEvidenceProperties

        public static void copyAndOverrideInteractionEvidenceProperties​(InteractionEvidence source,
                                                                        InteractionEvidence target,
                                                                        boolean createNewParticipant,
                                                                        boolean ignoreParticipants)
        This method will copy properties of interaction source in interaction target and will override all the other properties of Target interaction. This method will set the experiment of this interaction evidence but it will not add this interaction to the list of interactionEvidences This method will add all the participant evidences of the source but will not set their interactionEvidence to the target
        Parameters:
        source - a InteractionEvidence object.
        target - a InteractionEvidence object.
        createNewParticipant - If true, this method will clone each participant from source instead of reusing the participant instances from source. It will then set the interactionEvidence of the cloned participants to target
        ignoreParticipants - If true, this method will clone the interaction properties and ignore the participants of the source
      • copyAndOverrideModelledInteractionProperties

        public static void copyAndOverrideModelledInteractionProperties​(ModelledInteraction source,
                                                                        ModelledInteraction target,
                                                                        boolean createNewParticipant,
                                                                        boolean ignoreParticipants)
        This method will copy properties of interaction source in interaction target and will override all the other properties of Target interaction. This method will add all the participant of the source but will not set their modelledInteraction to the target
        Parameters:
        source - a ModelledInteraction object.
        target - a ModelledInteraction object.
        createNewParticipant - If true, this method will clone each participant from source instead of reusing the participant instances from source. It will then set the modelledInteraction of the cloned participants to target
        ignoreParticipants - If true, this method will clone the interaction properties and ignore the participants of the source
      • copyAndOverrideBasicInteractionProperties

        public static void copyAndOverrideBasicInteractionProperties​(Interaction source,
                                                                     Interaction target,
                                                                     boolean createNewParticipant,
                                                                     boolean ignoreParticipants)
        This method will copy basic properties of interaction source in interaction target and will override all the other properties of Target interaction.
        Parameters:
        source - a Interaction object.
        target - a Interaction object.
        createNewParticipant - If true, this method will clone each participant from source instead of reusing the participant instances from source.
        ignoreParticipants - If true, this method will clone the interaction properties and ignore the participants of the source
      • copyAndOverrideParticipantsEvidencesToBinary

        public static void copyAndOverrideParticipantsEvidencesToBinary​(InteractionEvidence source,
                                                                        BinaryInteractionEvidence target,
                                                                        boolean createNewParticipant,
                                                                        boolean self)
        This method will copy participants of interaction evidence source in binary target.
        Parameters:
        source - a InteractionEvidence object.
        target - a BinaryInteractionEvidence object.
        createNewParticipant - If true, this method will clone each participant from source instead of reusing the participant instances from source. It will then set the interactionEvidence of the cloned participants to target
        self - If true, it will only look at the first participant and duplicate this participant with stoichiometry 0
        Throws:
        IllegalArgumentException - if the number of participants in source is superior to 2 or superior to 1 with self = true
      • copyAndOverrideModelledParticipantsToBinary

        public static void copyAndOverrideModelledParticipantsToBinary​(ModelledInteraction source,
                                                                       ModelledBinaryInteraction target,
                                                                       boolean createNewParticipant,
                                                                       boolean self)
        This method will copy participants of modelled interaction source in binary target.
        Parameters:
        source - a ModelledInteraction object.
        target - a ModelledBinaryInteraction object.
        createNewParticipant - If true, this method will clone each participant from source instead of reusing the participant instances from source. It will then set the modelledInteraction of the cloned participants to target
        self - if true, we only take the first participant and duplicate it in the Binary interaction. We then set the stoichiometry to 0 for the second interactor
        Throws:
        IllegalArgumentException - if the source has more than two participants or more than one participant when self is true
      • copyAndOverrideBasicParticipantsToBinary

        public static void copyAndOverrideBasicParticipantsToBinary​(Interaction source,
                                                                    BinaryInteraction target,
                                                                    boolean createNewParticipant,
                                                                    boolean self)
        This method will copy participants of interaction source in binary target.
        Parameters:
        source - a Interaction object.
        target - a BinaryInteraction object.
        createNewParticipant - If true, this method will clone each participant from source instead of reusing the participant instances from source.
        self - if true, we only take the first participant and duplicate it in the Binary interaction. We then set the stoichiometry to 0 for the second interactor
        Throws:
        IllegalArgumentException - if the source has more than two participants or more than one participant when self is true