public static boolean isComplex(Interaction interaction) { for (Annotation annot : interaction.getAnnotations()) { if (annot.getCvTopic() != null && annot.getCvTopic().getShortLabel().equalsIgnoreCase(CvTopic.CURATED_COMPLEX)) { return true; } } return false; } }
public static boolean isComplex(Interaction interaction) { for (Annotation annot : interaction.getAnnotations()) { if (annot.getCvTopic() != null && annot.getCvTopic().getShortLabel().equalsIgnoreCase(CvTopic.CURATED_COMPLEX)) { return true; } } return false; } }
@PrePersist @PreUpdate protected void correctCategory() { if (this.interaction != null){ if (Hibernate.isInitialized(this.interaction.getAnnotations())){ if (ComplexUtils.isComplex(this.interaction)){ if (this.category == null || !this.category.endsWith("_pool")){ this.category = "modelled_participant"; } else { this.category = "modelled_participant_pool"; } } else if (this.category == null || !this.category.endsWith("_pool")){ this.category = "participant_evidence"; } else { this.category = "participant_evidence_pool"; } } else if (this.category == null){ this.category = "participant_evidence"; } } else if (this.category == null){ this.category = "participant_evidence"; } }
@PrePersist @PreUpdate protected void correctCategory() { if (this.interaction != null){ if (Hibernate.isInitialized(this.interaction.getAnnotations())){ if (ComplexUtils.isComplex(this.interaction)){ if (this.category == null || !this.category.endsWith("_pool")){ this.category = "modelled_participant"; } else { this.category = "modelled_participant_pool"; } } else if (this.category == null || !this.category.endsWith("_pool")){ this.category = "participant_evidence"; } else { this.category = "participant_evidence_pool"; } } else if (this.category == null){ this.category = "participant_evidence"; } } else if (this.category == null){ this.category = "participant_evidence"; } }
private static Collection<Annotation> fetchAnnotations(Interaction interaction) { Collection<Annotation> annotations; if (IntactCore.isInitialized(interaction.getAnnotations())) { annotations = interaction.getAnnotations(); } else { annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(InteractionImpl.class, interaction.getAc()); } return annotations; }
private static Collection<Annotation> fetchAnnotations(Interaction interaction) { Collection<Annotation> annotations; if (IntactCore.isInitialized(interaction.getAnnotations())) { annotations = interaction.getAnnotations(); } else { annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(InteractionImpl.class, interaction.getAc()); } return annotations; }
Collection annotations = interaction.getAnnotations(); for ( Iterator iterator = annotations.iterator(); iterator.hasNext() && false == isNegative; ) { Annotation annotation = (Annotation) iterator.next();
Collection annotations = interaction.getAnnotations(); for ( Iterator iterator = annotations.iterator(); iterator.hasNext() && false == isNegative; ) { Annotation annotation = (Annotation) iterator.next();
/** * @param interaction * * @return */ protected Collection<String> getCCnote(Interaction interaction) { Collection<String> notes = null; final CvTopic ccNote = (CvTopic) getCvObject( CvTopic.class, null, CvTopic.CC_NOTE ); for (Annotation annotation : interaction.getAnnotations()) { if (ccNote.equals(annotation.getCvTopic())) { if (notes == null) { notes = new ArrayList<String>(2); // should rarely have more than 2 } notes.add(annotation.getAnnotationText()); } } return notes; }
Collection annotations = interaction.getAnnotations(); for ( Iterator iterator = annotations.iterator(); iterator.hasNext() && false == isNegative; ) { Annotation annotation = (Annotation) iterator.next();
/** * @param interaction * * @return */ protected Collection<String> getCCnote(Interaction interaction) { Collection<String> notes = null; for (Annotation annotation : interaction.getAnnotations()) { if (getCvContext().getByLabel(CvTopic.class, CvTopic.CC_NOTE).equals(annotation.getCvTopic())) { if (notes == null) { notes = new ArrayList<String>(2); // should rarely have more than 2 } notes.add(annotation.getAnnotationText()); } } return notes; }
@PrePersist @PreUpdate protected void correctCategory() { if (this.component != null){ if (this.component.getInteraction() != null){ if (Hibernate.isInitialized(this.component.getInteraction().getAnnotations())){ if (ComplexUtils.isComplex(this.component.getInteraction())){ this.category = "modelled"; } else { this.category = "evidence"; } } else if (this.category == null){ this.category = "evidence"; } } else if (this.category == null){ this.category = "evidence"; } } else if (this.category == null){ this.category = "evidence"; } }
@PrePersist @PreUpdate protected void correctCategory() { if (this.component != null){ if (this.component.getInteraction() != null){ if (Hibernate.isInitialized(this.component.getInteraction().getAnnotations())){ if (ComplexUtils.isComplex(this.component.getInteraction())){ this.category = "modelled"; } else { this.category = "evidence"; } } else if (this.category == null){ this.category = "evidence"; } } else if (this.category == null){ this.category = "evidence"; } } else if (this.category == null){ this.category = "evidence"; } }
Collection annotations = interaction.getAnnotations(); boolean found = false;
Collection annotations = interaction.getAnnotations(); boolean annotationFound = false;
/** * This creates a stable (non-random) interaction */ public Interaction createDeterministicInteraction() { Interaction interaction = createInteraction("fooprey-barbait", createDeterministicProtein("A2", "barbait"), createDeterministicProtein("A1", "fooprey"), createDeterministicExperiment()); interaction.getAnnotations().add(createAnnotation("This is an annotation", CvTopic.COMMENT_MI_REF, CvTopic.COMMENT)); CvFeatureType featureType = createCvObject(CvFeatureType.class, CvFeatureType.EXPERIMENTAL_FEATURE_MI_REF, CvFeatureType.EXPERIMENTAL_FEATURE); Feature feature = createFeature("feature1", featureType); feature.setComponent(null); Range range = createRange(1, 1, 5, 5); feature.addRange(range); interaction.getComponents().iterator().next().addBindingDomain(feature); // interaction.getComponents().iterator().next().addComponentParameter(createDeterministicComponentParameter()); // interaction.addXref(createPrimaryReferenceXref( interaction , "testreference")); interaction.addConfidence( createDeterministicConfidence()); interaction.addParameter( createDeterministicInteractionParameter() ); return interaction; }
/** * This creates a stable (non-random) interaction */ public Interaction createDeterministicInteraction() { Interaction interaction = createInteraction("fooprey-barbait", createDeterministicProtein("A2", "barbait"), createDeterministicProtein("A1", "fooprey"), createDeterministicExperiment()); interaction.getAnnotations().add(createAnnotation("This is an annotation", CvTopic.COMMENT_MI_REF, CvTopic.COMMENT)); CvFeatureType featureType = createCvObject(CvFeatureType.class, CvFeatureType.EXPERIMENTAL_FEATURE_MI_REF, CvFeatureType.EXPERIMENTAL_FEATURE); Feature feature = createFeature("feature1", featureType); feature.setComponent(null); Range range = createRange(1, 1, 5, 5); feature.addRange(range); interaction.getComponents().iterator().next().addBindingDomain(feature); // interaction.getComponents().iterator().next().addComponentParameter(createDeterministicComponentParameter()); // interaction.addXref(createPrimaryReferenceXref( interaction , "testreference")); interaction.addConfidence( createDeterministicConfidence()); interaction.addParameter( createDeterministicInteractionParameter() ); return interaction; }
annotations.addAll(interaction.getAnnotations());
annotations.addAll(interaction.getAnnotations());
confidences = intactObject.getConfidences(); parameters = intactObject.getParameters(); annotations = intactObject.getAnnotations();