public static String joinAnnotationsCollection(List<Annotation> collection) { StringBuilder sb = new StringBuilder(); if (collection != null && !collection.isEmpty()) { Iterator<Annotation> iterator = collection.iterator(); while (iterator.hasNext()) { Annotation field = iterator.next(); String topic = field.getTopic(); if (topic != null) { topic = topic.replaceAll("\\p{Cntrl}", " "); } String text = field.getText(); if (text != null) { text = text.replaceAll("\\p{Cntrl}", " "); } sb.append(joinAttributes(topic, text, null)); if (iterator.hasNext()) { sb.append(FIELD_DELIMITER); } } } else { sb.append('-'); } return sb.toString(); }
public Annotation intactToMitab(uk.ac.ebi.intact.model.Annotation intactAnnotation){ if (intactAnnotation != null && intactAnnotation.getCvTopic() != null){ String topic = CvTopic.COMMENT; if (intactAnnotation.getCvTopic().getShortLabel() != null){ topic = intactAnnotation.getCvTopic().getShortLabel(); } if (!topicsToExclude.contains(topic)){ Annotation annot = new AnnotationImpl(topic); annot.setText(intactAnnotation.getAnnotationText()); return annot; } } return null; } }
List<Annotation> annotations = binaryInteraction.getAnnotations(); for (Annotation annotation : annotations) { String comment = annotation.getText(); if (comment != null && (comment.equals("mint") || comment.equals("homomint") || comment.equals("domino"))) { continue;
String comment = annotation.getText(); if (comment != null && (comment.equals("mint") || comment.equals("homomint") || comment.equals("domino"))) { continue;
if (!annotation.getText().contains("Stoichiometry: ")) { filterAnnotations.add(annotation);