private static String getLabel(Component comp1) { String name = ProteinUtils.getGeneName(comp1.getInteractor()); if (name == null) name = "null"; name = name.toLowerCase(); return name; } }
private static String getLabel(Component comp1) { String name = ProteinUtils.getGeneName(comp1.getInteractor()); if (name == null) name = "null"; name = name.toLowerCase(); return name; } }
/** * Checks if an interaction contain other interactor types than Protein * * @param interaction * @return */ public static boolean containsNonProteinInteractors( Interaction interaction ) { for ( Component component : interaction.getComponents() ) { Interactor interactor = component.getInteractor(); if ( !( interactor instanceof ProteinImpl ) ) { return true; } } return false; }
/** * It take an interactions Collection and remove from it all the interactions having a NucleicAcid as component. * This is used in case psi version is psi1 as psi1 do not allow Nucleic Acid as Interaction's participant. * @param interactions Collection of interactions */ public static void filterInteractions(Collection interactions){ for (Iterator iterator = interactions.iterator(); iterator.hasNext();) { Interaction interaction = (Interaction) iterator.next(); Collection components = interaction.getComponents(); for (Iterator iterator1 = components.iterator(); iterator1.hasNext();) { Component component = (Component) iterator1.next(); if ( component.getInteractor() instanceof NucleicAcid ){ iterator.remove(); break; } } } }
/** * Collect a distinct set of Interactor associated to the given Interaction. * * @param interaction the interaction * @return a non null Set of Interactor. */ public static Set<Interactor> selectDistinctInteractors( Interaction interaction ) { Set<Interactor> interactors = new HashSet<Interactor>( interaction.getComponents().size() ); for ( Component component : interaction.getComponents() ) { interactors.add( component.getInteractor() ); } return interactors; }
/** * It take an interactions Collection and remove from it all the interactions having a NucleicAcid as component. * This is used in case psi version is psi1 as psi1 do not allow Nucleic Acid as Interaction's participant. * @param interactions Collection of interactions */ public static void filterInteractions(Collection interactions){ for (Iterator iterator = interactions.iterator(); iterator.hasNext();) { Interaction interaction = (Interaction) iterator.next(); Collection components = interaction.getComponents(); for (Iterator iterator1 = components.iterator(); iterator1.hasNext();) { Component component = (Component) iterator1.next(); if ( component.getInteractor() instanceof NucleicAcid ){ iterator.remove(); break; } } } }
/** * It take an interactions Collection and remove from it all the interactions having a NucleicAcid as component. * This is used in case psi version is psi1 as psi1 do not allow Nucleic Acid as Interaction's participant. * @param interactions Collection of interactions */ public static void filterInteractions(Collection interactions){ for (Iterator iterator = interactions.iterator(); iterator.hasNext();) { Interaction interaction = (Interaction) iterator.next(); Collection components = interaction.getComponents(); for (Iterator iterator1 = components.iterator(); iterator1.hasNext();) { Component component = (Component) iterator1.next(); if ( component.getInteractor() instanceof NucleicAcid ){ iterator.remove(); break; } } } }
/** * Collect a distinct set of Interactor associated to the given Interaction. * * @param interaction the interaction * @return a non null Set of Interactor. */ public static Set<Interactor> selectDistinctInteractors(Interaction interaction) { Set<Interactor> interactors = new HashSet<Interactor>(interaction.getComponents().size()); for (Component component : interaction.getComponents()) { interactors.add(component.getInteractor()); } return interactors; }
/** * Collect a distinct set of Interactor associated to the given Interaction. * * @param interaction the interaction * @return a non null Set of Interactor. */ public static Set<Interactor> selectDistinctInteractors(Interaction interaction) { Set<Interactor> interactors = new HashSet<Interactor>(interaction.getComponents().size()); for (Component component : interaction.getComponents()) { interactors.add(component.getInteractor()); } return interactors; }
/** * Convenience method to get the interactors - delegates the logic to the interactions * * @return Interactors */ public Collection<Interactor> getInteractors() { if (interactors != null) { return interactors; } interactors = new HashSet<Interactor>(); for (Interaction interaction : getInteractions()) { for (Component comp : interaction.getComponents()) { interactors.add(comp.getInteractor()); } } return interactors; }
/** * Convenience method to get the interactors - delegates the logic to the interactions * * @return Interactors */ public Collection<Interactor> getInteractors() { if (interactors != null) { return interactors.keySet(); } else if (!interactorsList.isEmpty()){ return interactorsList; } interactors = new IdentityMap(); for (Interaction interaction : getInteractions()) { for (Component comp : IntactCore.ensureInitializedParticipants(interaction)) { interactors.put(comp.getInteractor(), null); } } return interactors.keySet(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Interaction: ").append(getAc()).append(" Label: ").append(getShortLabel()).append(" [").append(NEW_LINE); if (IntactCore.isInitialized(getComponents())) { if ( null != this.getComponents() ) { for ( Object o : this.getComponents() ) { sb.append(( ( Component ) o ).getInteractor()); } } } else { sb.append("Components not initialized"); } sb.append("] Interaction").append(NEW_LINE); return sb.toString(); } } // end Interaction
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Interaction: ").append(getAc()).append(" Label: ").append(getShortLabel()).append(" [").append(NEW_LINE); if (IntactCore.isInitialized(getComponents())) { if ( null != this.getComponents() ) { for ( Object o : this.getComponents() ) { sb.append(( ( Component ) o ).getInteractor()); } } } else { sb.append("Components not initialized"); } sb.append("] Interaction").append(NEW_LINE); return sb.toString(); } } // end Interaction
@Override public String toString() { String result = "Interaction: " + getAc() + " Label: " + getShortLabel() + " [" + NEW_LINE; if ( null != this.getComponents() ) { for ( Iterator iter = this.getComponents().iterator(); iter.hasNext(); ) { result += ( ( Component ) iter.next() ).getInteractor(); } } return result + "] Interaction" + NEW_LINE; } } // end Interaction
/** * Convenience method to get the interactors - delegates the logic to the interactions * * @return Interactors */ public Collection<Interactor> getInteractors() { if (interactors != null) { return interactors.keySet(); } else if (!interactorsList.isEmpty()){ return interactorsList; } interactors = new IdentityMap(); for (Interaction interaction : getInteractions()) { for (Component comp : IntactCore.ensureInitializedParticipants(interaction)) { interactors.put(comp.getInteractor(), null); } } return interactors.keySet(); }
/** * Checks if an interaction contain other interactor types than Protein * * @param interaction * @return */ public static boolean containsNonProteinInteractors(Interaction interaction) { for (Component component : interaction.getComponents()) { Interactor interactor = component.getInteractor(); final CvInteractorType type = interactor.getCvInteractorType(); if (!CvObjectUtils.isProteinType(type)) { return true; } } return false; }
/** * Checks if an interaction contain other interactor types than Protein * * @param interaction * @return */ public static boolean containsNonProteinInteractors(Interaction interaction) { for (Component component : interaction.getComponents()) { Interactor interactor = component.getInteractor(); final CvInteractorType type = interactor.getCvInteractorType(); if (!CvObjectUtils.isProteinType(type)) { return true; } } return false; }
protected void syncComponents(Interaction intactObject) { ComponentPersister compPersister = ComponentPersister.getInstance(); List<Component> components = new ArrayList<Component>(intactObject.getComponents().size()); for (Component component : intactObject.getComponents()) { Component c = compPersister.syncIfTransient(component); c.setInteraction(intactObject); c.setInteractor( component.getInteractor() ); components.add(c); } // for (Component c : components) { // c.setInteraction(intactObject); // } intactObject.setComponents(components); }
protected void traverseComponent(Component component, IntactVisitor ... visitors) { if (component == null) return; for (IntactVisitor visitor : visitors) { visitor.visitComponent(component); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(component)) { return; } traverse(component.getInteraction(), visitors); traverse(component.getInteractor(), visitors); traverse(component.getCvBiologicalRole(), visitors); traverse(component.getExpressedIn(), visitors); traverse(component.getParameters(), visitors); traverse(component.getParticipantDetectionMethods(), visitors); traverse(component.getExperimentalPreparations(), visitors); traverse(component.getBindingDomains(), visitors); traverse(component.getExperimentalRoles(), visitors); }
protected void traverseComponent(Component component, IntactVisitor ... visitors) { if (component == null) return; for (IntactVisitor visitor : visitors) { visitor.visitComponent(component); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(component)) { return; } traverse(component.getInteraction(), visitors); traverse(component.getInteractor(), visitors); traverse(component.getCvBiologicalRole(), visitors); traverse(component.getExpressedIn(), visitors); traverse(component.getParameters(), visitors); traverse(component.getParticipantDetectionMethods(), visitors); traverse(component.getExperimentalPreparations(), visitors); traverse(component.getBindingDomains(), visitors); traverse(component.getExperimentalRoles(), visitors); }