public static Collection<Annotation> extractAuthorConfidencesAnnotationsFrom(Collection<Annotation> annotations){ if (annotations != null && !annotations.isEmpty()){ Collection<Annotation> attributesConf = new ArrayList<Annotation>(annotations.size()); for (Annotation att : annotations){ if (att.getCvTopic() != null){ if (AUTH_CONF_MI.equals(att.getCvTopic().getIdentifier())){ attributesConf.add(att); } } } return attributesConf; } return Collections.EMPTY_LIST; }
@Override public void visitAnnotation( Annotation annotation ) { final CvTopic topic = annotation.getCvTopic(); final String mi = topic.getIdentifier(); if ( mi != null ) { final CvTopic oboTerm = ( CvTopic ) mi2cv.get( createCvKey( topic.getClass(), mi ) ); if ( oboTerm == null ) { log.warn( "Could not find topic " + topic.getClass().getSimpleName() + "( " + topic.getShortLabel() + " ) by MI: " + mi ); } else { annotation.setCvTopic( oboTerm ); } } } }
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 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; }
/** * Finds an Annotations with a topic that has an MI or label equal to the value provided * * @param annotatedObject The annotatedObject to find the annotation * @param miOrLabel The MI (use it when possible) or the shortLabel * @return The annotation with that CvTopic. Null if no annotation for that CV is found * @since 1.8.0 */ public static Annotation findAnnotationByTopicMiOrLabel(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) { for (Annotation annotation : annotatedObject.getAnnotations()) { final CvTopic topic = annotation.getCvTopic(); if (topic != null && (miOrLabel.equals(topic.getIdentifier()) || miOrLabel.equals(topic.getShortLabel()))) { return annotation; } } return null; }
/** * Finds an Annotations with a topic that has an MI or label equal to the value provided * * @param annotatedObject The annotatedObject to find the annotation * @param miOrLabel The MI (use it when possible) or the shortLabel * @return The annotation with that CvTopic. Null if no annotation for that CV is found * @since 1.8.0 */ public static Annotation findAnnotationByTopicMiOrLabel(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) { for (Annotation annotation : annotatedObject.getAnnotations()) { final CvTopic topic = annotation.getCvTopic(); if (topic != null && (miOrLabel.equals(topic.getIdentifier()) || miOrLabel.equals(topic.getShortLabel()))) { return annotation; } } return null; }
private Annotation collectObsoleteAnnotation(Collection<Annotation> annotations){ String cautionMessage = "The sequence has been withdrawn from uniprot."; for (Annotation a : annotations){ if (a.getCvTopic() != null){ CvTopic topic = a.getCvTopic(); if (a.getAnnotationText() != null){ if (a.getAnnotationText().equalsIgnoreCase(cautionMessage)){ if (topic.getIdentifier() != null){ if (topic.getIdentifier().equals(CvTopic.CAUTION_MI_REF)){ return a; } } else if (topic.getShortLabel() != null){ if (topic.getShortLabel().equals(CvTopic.CAUTION)){ return a; } } } } } } return null; }
name = intactObject.getCvTopic().getShortLabel(); if (intactObject.getCvTopic().getIdentifier() != null) { String upperId = intactObject.getCvTopic().getIdentifier().toUpperCase(); Matcher topicMatcher = CvObjectConverter.MI_REGEXP.matcher(upperId); nameAc = intactObject.getCvTopic().getIdentifier();
if (IntactConverterUtils.AUTH_CONF_MI.equals(annotation.getCvTopic().getIdentifier())){ if (annotation.getAnnotationText() != null){ psidev.psi.mi.xml.model.Confidence confidence = new psidev.psi.mi.xml.model.Confidence();
if (o1.getCvTopic().getIdentifier().equalsIgnoreCase(o2.getCvTopic().getIdentifier())){ return o1.getCvTopic().getIdentifier().compareTo(o2.getCvTopic().getIdentifier());
/** * Creates unique strings for Annotations,Xrefs and aliases. * * @param io the object to use * @return a unique string for that object */ protected static String createUniqueString(IntactObject io) { if (io == null) throw new NullPointerException("IntactObject cannot be null to create a unique String"); if (io instanceof Annotation) { Annotation annot = (Annotation) io; String cvId = (annot.getCvTopic() != null) ? annot.getCvTopic().getIdentifier() : ""; return annot.getAnnotationText() + "__" + cvId; } else if (io instanceof Xref) { Xref xref = (Xref) io; String qualId = (xref.getCvXrefQualifier() != null) ? xref.getCvXrefQualifier().getIdentifier() : ""; return xref.getPrimaryId() + "__" + xref.getCvDatabase().getIdentifier() + "__" + qualId; } else if (io instanceof Alias) { Alias alias = (Alias) io; String typeId = (alias.getCvAliasType() != null) ? alias.getCvAliasType().getIdentifier() : ""; return alias.getName() + "__" + typeId; } return io.toString(); }
/** * Creates unique strings for Annotations,Xrefs and aliases. * * @param io the object to use * @return a unique string for that object */ protected static String createUniqueString(IntactObject io) { if (io == null) throw new NullPointerException("IntactObject cannot be null to create a unique String"); if (io instanceof Annotation) { Annotation annot = (Annotation) io; String cvId = (annot.getCvTopic() != null) ? annot.getCvTopic().getIdentifier() : ""; return annot.getAnnotationText() + "__" + cvId; } else if (io instanceof Xref) { Xref xref = (Xref) io; String qualId = (xref.getCvXrefQualifier() != null) ? xref.getCvXrefQualifier().getIdentifier() : ""; return xref.getPrimaryId() + "__" + xref.getCvDatabase().getIdentifier() + "__" + qualId; } else if (io instanceof Alias) { Alias alias = (Alias) io; String typeId = (alias.getCvAliasType() != null) ? alias.getCvAliasType().getIdentifier() : ""; return alias.getName() + "__" + typeId; } return io.toString(); }
persisterHelper.save( obsoleteTopic ); } catch ( Throwable t ) { throw new PersisterException( "An error occurred while saving CvTopic( '"+ obsoleteTopic.getShortLabel() +"', '"+ obsoleteTopic.getIdentifier() +"' )", t );
if (annot.getCvTopic() != null){ if (tagsToExport.contains(annot.getCvTopic().getIdentifier())){ psidev.psi.mi.tab.model.Annotation tag = annotationConverter.intactToMitab(annot); if (tag != null){ else if ( CvTopic.AUTHOR_LIST_MI_REF.equals(annot.getCvTopic().getIdentifier())){ author = annot.getAnnotationText(); else if ( CvTopic.PUBLICATION_YEAR_MI_REF.equals(annot.getCvTopic().getIdentifier())){ date = annot.getAnnotationText();
int topicComparator = cvTopic.getIdentifier().compareTo(currentOntologyRef.getTopicId()); else if (CvTopic.OBSOLETE_MI_REF.equalsIgnoreCase(cvTopic.getIdentifier())){ if (!hasFoundObsolete && isObsolete){ hasFoundObsolete = true; else if (CvTopic.COMMENT_MI_REF.equalsIgnoreCase(cvTopic.getIdentifier())){ comment = cvTopic; else if (CvTopic.URL_MI_REF.equalsIgnoreCase(cvTopic.getIdentifier())){ if (!hasFoundURL){ hasFoundURL = true; else if (CvTopic.OBSOLETE_MI_REF.equalsIgnoreCase(cvTopic.getIdentifier())){ if (!hasFoundObsolete && isObsolete){ hasFoundObsolete = true; else if (CvTopic.COMMENT_MI_REF.equalsIgnoreCase(cvTopic.getIdentifier())){ comment = cvTopic; else if (CvTopic.URL_MI_REF.equalsIgnoreCase(cvTopic.getIdentifier())){ if (!hasFoundURL){ hasFoundURL = true;