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; } }
/** * Checks if the protein has been annotated with the no-uniprot-update CvTopic, if so, return false, otherwise true. * That flag is added to a protein when created via the editor. As some protein may have a UniProt ID as identity we * don't want those to be overwitten. * * @param protein the protein to check * @return true if uniprot */ public static boolean isFromUniprot(Protein protein) { boolean isFromUniprot = true; for (Annotation annotation : protein.getAnnotations()) { String topicLabel = annotation.getCvTopic().getShortLabel(); if (topicLabel.equals(CvTopic.NON_UNIPROT)) { isFromUniprot = false; } } return isFromUniprot; }
/** * Checks if the protein has been annotated with the no-uniprot-update CvTopic, if so, return false, otherwise true. * That flag is added to a protein when created via the editor. As some protein may have a UniProt ID as identity we * don't want those to be overwitten. * * @param protein the protein to check * @return true if uniprot */ public static boolean isFromUniprot(Protein protein) { boolean isFromUniprot = true; for (Annotation annotation : protein.getAnnotations()) { String topicLabel = annotation.getCvTopic().getShortLabel(); if (topicLabel.equals(CvTopic.NON_UNIPROT)) { isFromUniprot = false; } } return isFromUniprot; }
/** * Checks if the protein has been annotated with the no-uniprot-update CvTopic, if so, return false, otherwise true. * That flag is added to a protein when created via the editor. As some protein may have a UniProt ID as identity we * don't want those to be overwitten. * * @param protein the protein to check * * @return true if uniprot */ public static boolean isFromUniprot( Protein protein ) { boolean isFromUniprot = true; for (Annotation annotation : protein.getAnnotations()) { String topicLabel = annotation.getCvTopic().getShortLabel(); if (topicLabel.equals(CvTopic.NON_UNIPROT)) { isFromUniprot = false; } } return isFromUniprot; }
/** * Checks if the protein has been annotated with the no-uniprot-update CvTopic, if so, return false, otherwise true. * That flag is added to a protein when created via the editor. As some protein may have a UniProt ID as identity we * don't want those to be overwitten. * * @param protein the protein to check * * @return false if no Annotation having CvTopic( no-uniprot-update ), otherwise true. */ protected boolean needsUniprotUpdate(final Protein protein) { boolean needsUpdate = true; final CvTopic noUniprotUpdate = getNoUniprotUpdate(); if (null == noUniprotUpdate) { // in case the term hasn't been created, assume there are no proteins created via editor. return true; } for (Iterator<Annotation> iterator = protein.getAnnotations().iterator(); iterator.hasNext() && true == needsUpdate;) { Annotation annotation = iterator.next(); if (noUniprotUpdate.equals(annotation.getCvTopic())) { needsUpdate = false; } } return needsUpdate; }
/** * Checks if the protein has been annotated with the no-uniprot-update CvTopic, if so, return false, otherwise true. * That flag is added to a protein when created via the editor. As some protein may have a UniProt ID as identity we * don't want those to be overwitten. * * @param protein the protein to check * * @return false if no Annotation having CvTopic( no-uniprot-update ), otherwise true. */ protected boolean needsUniprotUpdate(final Protein protein) { boolean needsUpdate = true; CvTopic noUniprotUpdate = getCvContext().getByLabel(CvTopic.class, CvTopic.NON_UNIPROT); if (null == noUniprotUpdate) { // in case the term hasn't been created, assume there are no proteins created via editor. return true; } for (Iterator<Annotation> iterator = protein.getAnnotations().iterator(); iterator.hasNext() && true == needsUpdate;) { Annotation annotation = iterator.next(); if (noUniprotUpdate.equals(annotation.getCvTopic())) { needsUpdate = false; } } return needsUpdate; }
boolean hasNoUniprotUpdate = false; for (Annotation a : protein.getAnnotations()){ if (CvTopic.NON_UNIPROT.equalsIgnoreCase(a.getCvTopic().getShortLabel())){ hasNoUniprotUpdate = true;