uk.ac.ebi.intact.model.Annotation.getCvTopic()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中uk.ac.ebi.intact.model.Annotation.getCvTopic()方法的一些代码示例,展示了Annotation.getCvTopic()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation.getCvTopic()方法的具体详情如下:
包路径:uk.ac.ebi.intact.model.Annotation
类名称:Annotation
方法名:getCvTopic

Annotation.getCvTopic介绍

暂无

代码示例

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

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;
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

private boolean hasNoUniprotUpdateAnnotation( AnnotatedObject ao ) {
  for ( Annotation annot : ao.getAnnotations() ) {
    if( annot.getCvTopic().getShortLabel().equals( CvTopic.NON_UNIPROT ) ) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: uk.ac.ebi.intact.sanity/intact-sanity-rules

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;
  }
}

代码示例来源:origin: uk.ac.ebi.intact.sanity/intact-sanity-rules

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;
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

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;
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

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 );
      }
    }
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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);
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

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;
}

相关文章