@Override public String toString() { return "Annotation[type: " + ( cvTopic != null ? cvTopic.getShortLabel() : "" ) + ", text: " + annotationText + "]"; } }
CvTopic cvTopic = (CvTopic) iterator.next(); if ( CvTopic.OBSOLETE.equals( cvTopic.getShortLabel() ) ) { obsolete = cvTopic; CvTopic cvTopic = (CvTopic) iterator.next(); for ( Iterator iterator1 = cvTopic.getAnnotations().iterator(); iterator1.hasNext(); ) { Annotation annotation = (Annotation) iterator1.next(); if ( obsolete.equals( annotation.getCvTopic() ) ) { System.out.println( cvTopic.getShortLabel() + " was flagged obsolete, filter it out." ); if ( annotationFilters == null ) { annotationFilters = new HashSet();
@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 Annotation getUsedInClassAnnotation(CvTopic cvTopic){ Collection<Annotation> annotations = cvTopic.getAnnotations(); for(Annotation annotation : annotations){ if(CvTopic.USED_IN_CLASS.equals(annotation.getCvTopic().getShortLabel())){ if(annotation.getAnnotationText() == null){ return null; } CACHE.put(cvTopic.getShortLabel(),annotation); return annotation; } } return null; } }
final Annotation annotation = (Annotation) iterator3.next(); if (authorConfidenceTopic.equals(annotation.getCvTopic())) { String text = annotation.getAnnotationText(); getOut().println("\t\t\t Interaction has " + authorConfidenceTopic.getShortLabel() + ": '" + text + "'");
stats.addUpdatedCv( existingCv ); if (obsoleteTopic.getAc() == null) { try { persisterHelper.save( obsoleteTopic ); } catch ( Throwable t ) { throw new PersisterException( "An error occurred while saving CvTopic( '"+ obsoleteTopic.getShortLabel() +"', '"+ obsoleteTopic.getIdentifier() +"' )", t );
if ( !cvTopic.equals( annotation.cvTopic ) ) { return false;
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; }
public AnnotationConverterConfig() { // always exclude negative, Intra-molecular and modelled addExcludeAnnotationTopic(new CvTopic(InteractionConverter.NEGATIVE)); addExcludeAnnotationTopic(new CvTopic(InteractionConverter.INTRA_MOLECULAR)); addExcludeAnnotationTopic(new CvTopic(InteractionConverter.MODELLED)); }
public Annotation psiToIntact(Attribute psiObject) { psiStartConversion(psiObject); CvTopic cvTopic = new CvTopic(getInstitution(), psiObject.getName()); // all name Acs should be from psi mi controlled vocabularies if (psiObject.getNameAc() != null) { cvTopic.setIdentifier(psiObject.getNameAc()); psiMiPopulator.populateWithPsiMi(cvTopic, psiObject.getNameAc()); } Annotation annotation = new Annotation(getInstitution(), cvTopic, psiObject.getValue()); psiEndConversion(psiObject); return annotation; }
private CvTopic createCvTopicObsolete() { final DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory(); if ( obsoleteTopic != null ) { if (daoFactory.getBaseDao().isTransient(obsoleteTopic) && obsoleteTopic.getAc() != null) { obsoleteTopic = daoFactory.getCvObjectDao( CvTopic.class ).getByAc( obsoleteTopic.getAc() ); } } else { obsoleteTopic = daoFactory.getCvObjectDao( CvTopic.class ).getByPsiMiRef( CvTopic.OBSOLETE_MI_REF ); } if ( obsoleteTopic == null ) { // create the obsolete term (which is obsolete too!) obsoleteTopic = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(), CvTopic.class, CvTopic.OBSOLETE_MI_REF, CvTopic.OBSOLETE ); obsoleteTopic.setFullName( "obsolete term" ); addObsoleteAnnotation( obsoleteTopic, "Deprecated CV term that should not be used to annotate entries" ); } return obsoleteTopic; }
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; }
final Annotation annotation = (Annotation) iterator3.next(); if (authorConfidenceTopic.equals(annotation.getCvTopic())) { String text = annotation.getAnnotationText(); getOut().println("\t\t\t Interaction has " + authorConfidenceTopic.getShortLabel() + ": '" + text + "'");
public boolean isExcluded( CvTopic topic ) { if (topic != null && !topic.getAnnotations().isEmpty() && excludeHiddenTopics){ for (uk.ac.ebi.intact.model.Annotation ann : topic.getAnnotations()){ if (ann.getCvTopic() != null && (ann.getCvTopic().getShortLabel().equalsIgnoreCase(CvTopic.HIDDEN) || ann.getCvTopic().getShortLabel().equalsIgnoreCase(CvTopic.NO_EXPORT))){ return true; } } } return excludeAnnotationTopic.contains( topic ); }
/** * Selects from the given Annotation collection all items having the given CvTopic. * * @param annotations a collection we have to filter * @param topic the filter * * @return a new collection containing all matching annotations */ private static Collection<Annotation> select( Collection<Annotation> annotations, CvTopic topic ) { if ( annotations == null || annotations.isEmpty() ) { return Collections.EMPTY_LIST; } ArrayList list = new ArrayList( 2 ); for ( Iterator<Annotation> iterator = annotations.iterator(); iterator.hasNext(); ) { Annotation annotation = iterator.next(); if ( annotation.getCvTopic().equals( topic ) ) { list.add( annotation ); } } return list; }
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 Collection<Field> fieldsForAnnotation(Annotation annotation) { Collection<Field> fields = new ArrayList<Field>(); if (annotation.getCvTopic() != null) { Field topicField = new Field(); topicField.setName("CvTopic AC"); topicField.setValue(annotation.getCvTopic().getAc()); fields.add(topicField); } Field annotTextField = new Field(); annotTextField.setName("Annotation text"); annotTextField.setValue(annotation.getAnnotationText()); fields.add(annotTextField); return fields; }
@Override public String toString() { return "Annotation[type: " + ( cvTopic != null ? cvTopic.getShortLabel() : "" ) + ", text: " + annotationText + "]"; } }
CvTopic cvTopic = (CvTopic) iterator.next(); if ( CvTopic.OBSOLETE.equals( cvTopic.getShortLabel() ) ) { obsolete = cvTopic; CvTopic cvTopic = (CvTopic) iterator.next(); for ( Iterator iterator1 = cvTopic.getAnnotations().iterator(); iterator1.hasNext(); ) { Annotation annotation = (Annotation) iterator1.next(); if ( obsolete.equals( annotation.getCvTopic() ) ) { System.out.println( cvTopic.getShortLabel() + " was flagged obsolete, filter it out." ); if ( annotationFilters == null ) { annotationFilters = new HashSet();