private Collection<String> convertAnnotToString(Collection<Annotation> annot){ Collection<String> annotations = new ArrayList<String>(annot.size()); for (Annotation a : annot){ if (a.getCvTopic() == null){ annotations.add(a.getAnnotationText() != null ? a.getAnnotationText() : ""); } else { annotations.add(a.getCvTopic().getShortLabel() + (a.getAnnotationText() != null ? a.getAnnotationText() : "")); } } return annotations; }
private Collection<String> convertAnnotToString(Collection<Annotation> annot){ Collection<String> annotations = new ArrayList<String>(annot.size()); for (Annotation a : annot){ if (a.getCvTopic() == null){ annotations.add(a.getAnnotationText() != null ? a.getAnnotationText() : ""); } else { annotations.add(a.getCvTopic().getShortLabel() + (a.getAnnotationText() != null ? a.getAnnotationText() : "")); } } return annotations; }
@Transient @Deprecated /** * @deprecated now it is always stored as a simple annotation */ public String getUrl() { Annotation annot = AnnotatedObjectUtils.findAnnotationByTopicMiOrLabel(this, CvTopic.URL_MI_REF); return annot != null ? annot.getAnnotationText() : null; }
@Transient @Deprecated /** * @deprecated now it is always stored as a simple annotation */ public String getPostalAddress() { Annotation annot = AnnotatedObjectUtils.findAnnotationByTopicMiOrLabel(this, "postaladdress"); return annot != null ? annot.getAnnotationText() : null; }
public String extractStandardInchiKeyFrom(SmallMolecule interactor) { // find INCHI key final Annotation annotation = AnnotatedObjectUtils.findAnnotationByTopicMiOrLabel(interactor, INCHI_MI_REF);// INCHI_MI_REF if (annotation != null){ return annotation.getAnnotationText(); } return null; } }
@Transient @Deprecated /** * @deprecated now it is always stored as a simple annotation */ public String getUrl() { Annotation annot = AnnotatedObjectUtils.findAnnotationByTopicMiOrLabel(this, CvTopic.URL_MI_REF); return annot != null ? annot.getAnnotationText() : null; }
@Transient @Deprecated /** * @deprecated now it is always stored as a simple annotation */ public String getPostalAddress() { Annotation annot = AnnotatedObjectUtils.findAnnotationByTopicMiOrLabel(this, "postaladdress"); return annot != null ? annot.getAnnotationText() : null; }
private static String getAnnotationValue(Experiment experiment, CvTopic topic) { for (Annotation annotation : experiment.getAnnotations()) { if (topic.equals(annotation.getCvTopic())) { return annotation.getAnnotationText(); } } return null; }
public UpdatedAnnotation(Annotation annotation, UpdateStatus status){ super(); if (annotation != null){ topic = annotation.getCvTopic() != null ? annotation.getCvTopic().getAc() : null; this.text = annotation.getAnnotationText(); } else { this.topic = null; this.text = null; } this.status = status != null ? status : UpdateStatus.none; this.parent = null; }
@Override public void visitAnnotation(Annotation annotation) { currentNode.setUserObject("Annotation: "+annotation.getAnnotationText()+" / Topic="+ DebugUtil.cvObjectToSimpleString(annotation.getCvTopic())); }
@Override public void visitAnnotation(Annotation annotation) { currentNode.setUserObject("Annotation: "+annotation.getAnnotationText()+" / Topic="+ DebugUtil.cvObjectToSimpleString(annotation.getCvTopic())); }
public static boolean sameAnnotation( Annotation a1, Annotation a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getAnnotationText(), a2.getAnnotationText() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvTopic(), a2.getCvTopic() ) ) { return false; } return true; }
public static boolean sameAnnotation( Annotation a1, Annotation a2 ) { if (a1.getAc() != null && a2.getAc() != null) { return a1.getAc().equals(a2.getAc()); } if ( !same( a1.getAnnotationText(), a2.getAnnotationText() ) ) { return false; } if ( !CvObjectUtils.areEqual( a1.getCvTopic(), a2.getCvTopic() ) ) { return false; } return true; }
private static String getAnnotationById(InteractionImpl complex, String id) { for (Annotation annotation : complex.getAnnotations()) { if (annotation.getCvTopic() != null && annotation.getCvTopic().getIdentifier() != null && annotation.getCvTopic().getIdentifier().equalsIgnoreCase(id)) { return annotation.getAnnotationText(); } } return null; }
public Key keyForAnnotation(Annotation annotation, AnnotatedObject parent) { return new Key(keyFor(parent).getUniqueString() + "::" + annotation.getCvTopic() + "_" + annotation.getAnnotationText()); }
private static String getAnnotationById(InteractionImpl complex, String id) { for (Annotation annotation : complex.getAnnotations()) { if (annotation.getCvTopic() != null && annotation.getCvTopic().getIdentifier() != null && annotation.getCvTopic().getIdentifier().equalsIgnoreCase(id)) { return annotation.getAnnotationText(); } } return null; }
private static String getAnnotationByShortLabel(InteractionImpl complex, String shortLabel) { for (Annotation annotation : complex.getAnnotations()) { if (annotation.getCvTopic() != null && annotation.getCvTopic().getShortLabel() != null && annotation.getCvTopic().getShortLabel().equalsIgnoreCase(shortLabel)) { return annotation.getAnnotationText(); } } return null; }
private static String getAnnotationByShortLabel(InteractionImpl complex, String shortLabel) { for (Annotation annotation : complex.getAnnotations()) { if (annotation.getCvTopic() != null && annotation.getCvTopic().getShortLabel() != null && annotation.getCvTopic().getShortLabel().equalsIgnoreCase(shortLabel)) { return annotation.getAnnotationText(); } } return null; }
protected Annotation cloneAnnotation(Annotation annotation) throws IntactClonerException { if (annotation == null) return null; Annotation clone = new Annotation(); clonerManager.addClone(annotation, clone); clone.setCvTopic(clone(annotation.getCvTopic())); clone.setAnnotationText(annotation.getAnnotationText()); return clone; }
protected Annotation cloneAnnotation(Annotation annotation) throws IntactClonerException { if (annotation == null) return null; Annotation clone = new Annotation(); clonerManager.addClone(annotation, clone); clone.setCvTopic(clone(annotation.getCvTopic())); clone.setAnnotationText(annotation.getAnnotationText()); return clone; }