public static boolean isNegative(Interaction interaction) { Collection<Annotation> annotations = fetchAnnotations(interaction); for (Annotation annotation : annotations) { if (annotation.getCvTopic() != null && annotation.getCvTopic().getShortLabel().equals(CvTopic.NEGATIVE)) { return true; } } return false; }
public static boolean isNegative(Interaction interaction) { Collection<Annotation> annotations = fetchAnnotations(interaction); for (Annotation annotation : annotations) { if (annotation.getCvTopic() != null && annotation.getCvTopic().getShortLabel().equals(CvTopic.NEGATIVE)) { 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; } }
public static boolean isCvTopicPublic(CvTopic cvTopic) { for (Annotation annotation : IntactCore.ensureInitializedAnnotations(cvTopic)) { if(annotation.getCvTopic() != null){ if (annotation.getCvTopic().getShortLabel().equals(CvTopic.HIDDEN) || annotation.getCvTopic().getShortLabel().equals(CvTopic.NO_EXPORT)) { return false; } } else { return false; } } return true; }
public static boolean isCvTopicPublic(CvTopic cvTopic) { for (Annotation annotation : IntactCore.ensureInitializedAnnotations(cvTopic)) { if(annotation.getCvTopic() != null){ if (annotation.getCvTopic().getShortLabel().equals(CvTopic.HIDDEN) || annotation.getCvTopic().getShortLabel().equals(CvTopic.NO_EXPORT)) { return false; } } else { return false; } } return true; }
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; } }
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; }
public static Collection<Annotation> getPublicAnnotations(final AnnotatedObject<?, ?> annotatedObject) { final Collection<Annotation> publicAnnotations = new ArrayList<Annotation>(annotatedObject.getAnnotations().size()); final Iterator<Annotation> i = IntactCore.ensureInitializedAnnotations(annotatedObject).iterator(); while (i.hasNext()) { Annotation annotation = i.next(); if (isCvTopicPublic(annotation.getCvTopic())) { publicAnnotations.add(annotation); } } return publicAnnotations; }
private boolean hasNoUniprotUpdateAnnotation( AnnotatedObject ao ) { for ( Annotation annot : ao.getAnnotations() ) { if( annot.getCvTopic().getShortLabel().equals( CvTopic.NON_UNIPROT ) ) { return true; } } return false; }
private boolean hasUniprotDrExportAnnotation(CvObject cvObject ) { Collection<Annotation> annotations = cvObject.getAnnotations(); for(Annotation annotation : annotations){ if(CvTopic.UNIPROT_DR_EXPORT.equals(annotation.getCvTopic().getShortLabel())){ return true; } } return false; } }
public static boolean isNoUniprotUpdate(Protein protein){ Collection<Annotation> annotations = protein.getAnnotations(); for(Annotation annotation : annotations){ if(CvTopic.NON_UNIPROT.equals(annotation.getCvTopic().getShortLabel())){ return true ; } } return false; } }
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; }
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 void populateAttributes( AnnotatedObject<?, ?> annotatedObject, AttributeContainer attributeContainer ) { AnnotationConverter annotationConverter = new AnnotationConverter( annotatedObject.getOwner() ); AnnotationConverterConfig configAnnotation = ConverterContext.getInstance().getAnnotationConfig(); for ( Annotation annotation : IntactCore.ensureInitializedAnnotations(annotatedObject) ) { if (!configAnnotation.isExcluded(annotation.getCvTopic())) { Attribute attribute = annotationConverter.intactToPsi( annotation ); if (!attributeContainer.getAttributes().contains( attribute )) { attributeContainer.getAttributes().add( attribute ); } } } }
protected void traverseAnnotation(Annotation annotation, IntactVisitor... visitors) { if (annotation == null) return; for (IntactVisitor visitor : visitors) { visitor.visitAnnotation(annotation); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(annotation)) { return; } traverse(annotation.getCvTopic(), visitors); traverse(annotation.getOwner(), visitors); }
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; }