/** * Checks if the interaction involves a single component. That a single component with a stoichiometry of at most 1. * * @param interaction * @return * @since 1.5 */ public static boolean isUnaryInteraction(Interaction interaction) { int componentCount = interaction.getComponents().size(); if (componentCount == 1) { Component c = interaction.getComponents().iterator().next(); if (c.getStoichiometry() <= 1f) { return true; } } return false; }
/** * Checks if the interaction involves a single component. That a single component with a stoichiometry of at most 1. * * @param interaction * @return * @since 1.5 */ public static boolean isUnaryInteraction( Interaction interaction ) { int componentCount = interaction.getComponents().size(); if ( componentCount == 1 ) { Component c = interaction.getComponents().iterator().next(); if ( c.getStoichiometry() <= 1f ) { return true; } } return false; }
/** * Checks if the interaction involves a single component. That a single component with a stoichiometry of at most 1. * * @param interaction * @return * @since 1.5 */ public static boolean isUnaryInteraction(Interaction interaction) { int componentCount = interaction.getComponents().size(); if (componentCount == 1) { Component c = interaction.getComponents().iterator().next(); if (c.getStoichiometry() <= 1f) { return true; } } return false; }
public boolean getSTC() { if ( STC_flag == 0 ) { STC = component.getStoichiometry() != 0.0f ; if ( hasSons() ){ for ( TreeComponents tree : sons ) { STC |= tree.getSTC() ; } } STC_flag = 1 ; } return STC; }
if ( component1.getStoichiometry() == 2 ) { log.debug( "Binary interaction " + interaction.getAc() + ". Stoichiometry 2, each component with stoichiometry 1" ); return true; float stochio1 = component1.getStoichiometry(); if ( stochio1 == 1 ) { Component component2 = iterator1.next(); if ( component2.getStoichiometry() == 1 ) { log.debug( "Binary interaction " + interaction.getAc() + ". Stoichiometry 2, each component with stoichiometry 1" ); return true; if ( component2.getStoichiometry() == 0 ) { log.debug( "Binary interaction " + interaction.getAc() + ". Stoichiometry 0, components 2" ); return true;
Component component1 = components.iterator().next(); if (component1.getStoichiometry() >= 2) { log.debug("Binary interaction " + interaction.getAc() + ". Stoichiometry >= 2, each component with stoichiometry 1"); return true; float stochio1 = component1.getStoichiometry(); if (stochio1 == 1) { Component component2 = iterator1.next(); if (component2.getStoichiometry() == 1) { log.debug("Binary interaction " + interaction.getAc() + ". Stoichiometry 2, each component with stoichiometry 1"); return true; if (component2.getStoichiometry() == 0) { log.debug("Binary interaction " + interaction.getAc() + ". Stoichiometry 0, components 2"); return true;
Component component1 = components.iterator().next(); if (component1.getStoichiometry() >= 2) { log.debug("Binary interaction " + interaction.getAc() + ". Stoichiometry >= 2, each component with stoichiometry 1"); return true; float stochio1 = component1.getStoichiometry(); if (stochio1 == 1) { Component component2 = iterator1.next(); if (component2.getStoichiometry() == 1) { log.debug("Binary interaction " + interaction.getAc() + ". Stoichiometry 2, each component with stoichiometry 1"); return true; if (component2.getStoichiometry() == 0) { log.debug("Binary interaction " + interaction.getAc() + ". Stoichiometry 0, components 2"); return true;
/** * Checks if the interaction is a binary self interaction * * @param interaction * @return */ public static boolean isSelfBinaryInteraction(Interaction interaction) { Collection<Component> components = interaction.getComponents(); int componentCount = components.size(); if (componentCount == 1) { Component comp = components.iterator().next(); if (comp.getStoichiometry() == 2) { return true; } } else if (componentCount == 2) { Iterator<Component> iter = components.iterator(); Component comp1 = iter.next(); Component comp2 = iter.next(); return (comp1.getInteractorAc().equals(comp2.getInteractorAc())); } return false; }
/** * Checks if the interaction is a binary self interaction * * @param interaction * @return */ public static boolean isSelfBinaryInteraction( Interaction interaction ) { Collection<Component> components = interaction.getComponents(); int componentCount = components.size(); if ( componentCount == 1 ) { Component comp = components.iterator().next(); if ( comp.getStoichiometry() == 2 ) { return true; } } else if ( componentCount == 2 ) { Iterator<Component> iter = components.iterator(); Component comp1 = iter.next(); Component comp2 = iter.next(); return ( comp1.getInteractorAc().equals( comp2.getInteractorAc() ) ); } return false; }
/** * Checks if the interaction is a binary self interaction * * @param interaction * @return */ public static boolean isSelfBinaryInteraction(Interaction interaction) { Collection<Component> components = interaction.getComponents(); int componentCount = components.size(); if (componentCount == 1) { Component comp = components.iterator().next(); if (comp.getStoichiometry() == 2) { return true; } } else if (componentCount == 2) { Iterator<Component> iter = components.iterator(); Component comp1 = iter.next(); Component comp2 = iter.next(); return (comp1.getInteractorAc().equals(comp2.getInteractorAc())); } return false; }
public int getNumberOfParticipants() { if ( numberOfParticipants == null ) { numberOfParticipants = 0; int stoichiometry = (int) component.getStoichiometry() ; int number = stoichiometry == 0 ? 1 : stoichiometry ; if ( hasSons() ) { for ( TreeComponents tree : sons ) { numberOfParticipants += number * tree.getNumberOfParticipants(); } } else{ numberOfParticipants = number; } } return numberOfParticipants; }
@Override public InteractionCategory findInteractionCategory(Interaction interaction) { if (interaction.getComponents().size() == 1) { Component c = interaction.getComponents().iterator().next(); // we have a self interaction but inter molecular if (c.getStoichiometry() >= 2 || (c.getStoichiometry() == 0 && !containsRole(c.getExperimentalRoles(), new String[]{CvExperimentalRole.SELF_PSI_REF, PUTATIVE_SELF_PSI_REF}))){ return InteractionCategory.self_inter_molecular; } else { return InteractionCategory.self_intra_molecular; } } else if (interaction.getComponents().size() == 2){ return InteractionCategory.binary; } else if (interaction.getComponents().size() > 2){ return InteractionCategory.n_ary; } return null; } }
/** * Checks if the interaction is a self interaction * * @param interaction * @return */ public static boolean isSelfInteraction(Interaction interaction) { if (isSelfBinaryInteraction(interaction)) { return true; } Collection<Component> components = interaction.getComponents(); int componentCount = components.size(); if (componentCount == 1) { Component comp = components.iterator().next(); if (comp.getStoichiometry() >= 2) { return true; } } else if (componentCount > 1) { String interactorAc = null; for (Component comp : components) { if (interactorAc == null) { interactorAc = comp.getInteractorAc(); } if (!interactorAc.equals(comp.getInteractorAc())) { return false; } } } return false; }
/** * Checks if the interaction is a self interaction * * @param interaction * @return */ public static boolean isSelfInteraction( Interaction interaction ) { if ( isSelfBinaryInteraction( interaction ) ) { return true; } Collection<Component> components = interaction.getComponents(); int componentCount = components.size(); if ( componentCount == 1 ) { Component comp = components.iterator().next(); if ( comp.getStoichiometry() >= 2 ) { return true; } } else if ( componentCount > 1 ) { String interactorAc = null; for ( Component comp : components ) { if ( interactorAc == null ) { interactorAc = comp.getInteractorAc(); } if ( !interactorAc.equals( comp.getInteractorAc() ) ) { return false; } } } return false; }
/** * Checks if the interaction is a self interaction * * @param interaction * @return */ public static boolean isSelfInteraction(Interaction interaction) { if (isSelfBinaryInteraction(interaction)) { return true; } Collection<Component> components = interaction.getComponents(); int componentCount = components.size(); if (componentCount == 1) { Component comp = components.iterator().next(); if (comp.getStoichiometry() >= 2) { return true; } } else if (componentCount > 1) { String interactorAc = null; for (Component comp : components) { if (interactorAc == null) { interactorAc = comp.getInteractorAc(); } if (!interactorAc.equals(comp.getInteractorAc())) { return false; } } } return false; }
stoichiometrySum += component.getStoichiometry(); float stoichiometry = component.getStoichiometry();
sb.append(component.getStoichiometry());
sb.append(component.getStoichiometry());
clone.setCvBiologicalRole(clone(component.getCvBiologicalRole())); clone.setStoichiometry(component.getStoichiometry()); clone.setExpressedIn(clone(component.getExpressedIn()));
clone.setCvBiologicalRole(clone(component.getCvBiologicalRole())); clone.setStoichiometry(component.getStoichiometry()); clone.setExpressedIn(clone(component.getExpressedIn()));