@Override public String getAnnotation() { return parent.getAnnotation(); }
public String getValue(ONDEXEntity cOrr) throws InvalidOndexEntityException { if(AbstractConcept.class.isAssignableFrom(cOrr.getClass())){ return ((ONDEXConcept)cOrr).getAnnotation(); } throw new InvalidOndexEntityException(cOrr.getClass()+": is not an Ondex class for which annotation is known"); }
public String assembleLine(ONDEXConcept c1, Set<ONDEXConcept> additional, ONDEXConcept c2, RelationType rt, Set<ONDEXConcept> other) { StringBuffer buf = new StringBuffer(); buf.append(c1.getPID()); buf.append("\t"); buf.append(additional); buf.append("\t"); if (c1.getAnnotation().contains("irreversible")) { buf.append("irreversible"); } else if (c1.getAnnotation().contains("reversible")) { buf.append("reversible"); } else { buf.append("unknown"); } buf.append("\t"); buf.append(c2.getPID()); buf.append("\t"); buf.append(rt.getId()); buf.append("\t"); buf.append(other); buf.append("\n"); return buf.toString(); }
public String getName(ONDEXConcept ac) { String label = ""; // get first preferred name as label for (ConceptName cn : ac.getConceptNames()) { if (cn.isPreferred()) { label = cn.getName(); break; } } // next try annotation if (label == null || label.trim().length() == 0) { label = ac.getAnnotation(); } // next try description if (label == null || label.trim().length() == 0) { label = ac.getDescription(); } // next try pid if (label == null || label.trim().length() == 0) { label = ac.getPID(); } // last resort to concept id if (label == null || label.trim().length() == 0) { label = String.valueOf(ac.getId()); } return label; }
else if (c.getAnnotation().length() > 0) name = c.getAnnotation().trim(); else if (c.getDescription().length() > 0) name = c.getDescription().trim();
else if (c.getAnnotation().length() > 0) name = c.getAnnotation().trim(); else if (c.getDescription().length() > 0) name = c.getDescription().trim();
for (ONDEXConcept c : concepts.get(key)) { String anno = ""; if (c.getAnnotation() != null) anno = c.getAnnotation(); String desc = ""; if (c.getDescription() != null)
defaultName = concept.getAnnotation();
else if (concept.getAnnotation() != null) name = concept.getAnnotation(); else if (concept.getDescription() != null) name = concept.getDescription();
/** * Clone concept with having a new DataSource. * * @param oldC * old ONDEXConcept * @param newDataSource * new DataSource to use * @return new ONDEXConcept */ public ONDEXConcept clone(ONDEXConcept oldC, DataSource newDataSource) { // first clone concept with new DataSource ONDEXConcept newC = graph.createConcept(oldC.getPID(), oldC.getAnnotation(), oldC.getDescription(), newDataSource, oldC.getOfType(), oldC.getEvidence()); // copies everything else copyEverythingElse(oldC, newC); return newC; }
/** * Clone concept with having a new PID. * * @param oldC * old ONDEXConcept * @param newPID * new PID to use * @return new ONDEXConcept */ public ONDEXConcept clone(ONDEXConcept oldC, String newPID) { // first clone concept with new PID ONDEXConcept newC = graph.createConcept(newPID, oldC.getAnnotation(), oldC.getDescription(), oldC.getElementOf(), oldC.getOfType(), oldC.getEvidence()); // copies everything else copyEverythingElse(oldC, newC); return newC; }
/** * Clone concept with having a new ConceptClass. * * @param oldC * old ONDEXConcept * @param newCC * new ConceptClass to use * @return new ONDEXConcept */ public ONDEXConcept clone(ONDEXConcept oldC, ConceptClass newCC) { // first clone concept with new ConceptClass ONDEXConcept newC = graph.createConcept(oldC.getPID(), oldC.getAnnotation(), oldC.getDescription(), oldC.getElementOf(), newCC, oldC.getEvidence()); // copies everything else copyEverythingElse(oldC, newC); return newC; }
concept.setAnnotation(concept.getAnnotation() + " URL:" + dbLink.getAccession()); continue;
/** * Initialises table data with the given ONDEXGraph. * * @param graph * ONDEXGraph to extract concepts from */ public ConceptPanel(ONDEXGraph graph) { Object[][] data = new Object[graph.getConcepts().size()][]; int i = 0; for (ONDEXConcept concept : graph.getConcepts()) { // first entry in table row is concept itself Object[] row = { concept, concept.getPID(), concept.getAnnotation(), concept.getDescription(), concept.getElementOf(), concept.getOfType(), concept.getEvidence() }; data[i] = row; i++; } // initialise table model and populate table DefaultTableModel model = new DefaultTableModel(); model.setDataVector(data, header); table = new ConceptTable(model, graph); // add table to panel this.setLayout(new GridLayout(1, 1)); this.add(new JScrollPane(table)); Util.calcColumnWidths(table, 150); }
String anno = ac.getAnnotation(); if (isMatching(p, search, anno)) found = true;
String anno = ac.getAnnotation(); if (isMatching(p, anno)) found = true;
/** * Copies all of the attributes from one concept to another (only if they do * not already exist at target) * * @param from * - concept to copy from * @param to * - concept to copy to * @throws AccessDeniedException * @throws NullValueException * @throws EmptyStringException */ public static void copyConceptAttributes(ONDEXConcept from, ONDEXConcept to) throws NullValueException, AccessDeniedException, EmptyStringException { for (EvidenceType et : from.getEvidence()) addNewEvidence(to, et); for (ConceptAccession ca : from.getConceptAccessions()) addNewAccession(to, ca); for (ConceptName cn : from.getConceptNames()) addNewName(to, cn); for (Attribute attribute : from.getAttributes()) addNewAttribute(to, attribute); if (from.getAnnotation() != null && to.getDescription() == null) to.setAnnotation(from.getAnnotation()); if (from.getDescription() != null && to.getDescription() == null) to.setDescription(from.getDescription()); }
if (copySourceConcept.getAnnotation() != null) copyTargetConcept.setAnnotation(copySourceConcept.getAnnotation());
String anno = conceptToClone.getAnnotation();
Resource cR = model.createResource(ONDEXRdf.conceptToUri(graphURI, c)); cRap(cR, model.createProperty(ONDEXRdf.annotationUri), c.getAnnotation()); for(ConceptAccession ca : c.getConceptAccessions()) { cR.addProperty(model.createProperty(ONDEXRdf.conceptAccessionUri), ca.getAccession());