@Override public DataSource getElementOf() { return parent.getElementOf(); }
@Override public int compare(ONDEXConcept o1, ONDEXConcept o2) { return o2.getElementOf().compareTo(o1.getElementOf()); } });
/** * Return all of the DataSources of the concepts * contained in the collection * * @param cs * @return set of DataSources */ public static Set<DataSource> getConceptDataSources(Collection<ONDEXConcept> cs) { Set<DataSource> result = new HashSet<DataSource>(); for (ONDEXConcept c : cs) { result.add(c.getElementOf()); } return result; }
/** * Return all of the DataSources of the concepts * contained in the collection * * @param cs * @return set of DataSources */ public static Set<DataSource> getConceptDataSources(Collection<ONDEXConcept> cs) { Set<DataSource> result = new HashSet<DataSource>(); for (ONDEXConcept c : cs) { result.add(c.getElementOf()); } return result; }
public String getValue(ONDEXEntity cOrr) throws InvalidOndexEntityException { if(AbstractConcept.class.isAssignableFrom(cOrr.getClass())){ return ((ONDEXConcept)cOrr).getElementOf().getId(); } throw new InvalidOndexEntityException(cOrr.getClass()+": is not an Ondex class for which cv is known"); }
private void step() { boolean match = false; next = null; List<String> ofInterest = new ArrayList<String>(); while (!match && view.hasNext()) { ONDEXConcept c = view.next(); String[] cCvs = c.getElementOf().getId().split(":"); for (String cCv : cCvs) { // System.err.println(cCv+" :: "+validArgs+" :: "+validArgs.contains(cCv.trim())); if (validArgs.contains(cCv)) { match = true; ofInterest.add(cCv); } } } if (ofInterest.size() == 0) { next = null; } else { next = ofInterest.toArray(new String[ofInterest.size()]); } } }
public boolean isValidConceptAtDepth(ONDEXConcept toConcept, int currentPosition) { if (validConceptDataSourceAtDepth != null) { ArrayList<DataSource> list = validConceptDataSourceAtDepth.get(currentPosition); if (list != null) { if (list.contains(toConcept.getElementOf())) { return true; } else { return false; } } else { return isInclusivePresumption; } } if (validConceptClassAtDepth != null) { ArrayList<ConceptClass> list = validConceptClassAtDepth.get(currentPosition); if (list != null) { if (list.contains(toConcept.getOfType())) { return true; } else { return false; } } else { return isInclusivePresumption; } } return true; }
private void step() { boolean match = false; next = null; List<String> ofInterest = new ArrayList<String>(); while (!match && view.hasNext()) { ONDEXRelation r = view.next(); String[] cCvs = arrAnd(r.getFromConcept().getElementOf().getId().split(":"), r.getToConcept().getElementOf().getId().split(":"), validArgs); if (cCvs.length > 0) { match = true; next = cCvs; } } } }
/** * Method to copy a concept * * @param graph * - graph to copy concept to * @param c * concept to copy * @return a copy of a concept created * @throws AccessDeniedException * @throws NullValueException * @throws EmptyStringException */ public static ONDEXConcept copyConcept(ONDEXGraph graph, ONDEXConcept c) throws NullValueException, AccessDeniedException, EmptyStringException { return copyConcept(graph, c, c.getOfType(), c.getElementOf()); }
/** * Create a name for concepts * * @param c * ONDEXConcept * @return normalised name */ private String getDefaultNameForConcept(ONDEXConcept c) { String name = null; // this is the preferred concept name ConceptName cn = c.getConceptName(); // use accessions as alternatives Set<ConceptAccession> accs = c.getConceptAccessions(); if (cn != null && cn.getName().trim().length() > 0) name = cn.getName().trim(); else if (accs.size() > 0) for (ConceptAccession acc : accs) { if (acc.getAccession().trim().length() > 0) { if (acc.getElementOf().equals(c.getElementOf())) { // prefer native accession name = acc.getAccession().trim(); break; } name = acc.getAccession().trim(); } } else name = "null"; return name; }
@Override protected void doAction() { for (ONDEXConcept node : entities) { ONDEXConcept c = node; DataSource dataSource = c.getElementOf(); for (ONDEXConcept oc : viewer.getONDEXJUNGGraph().getConceptsOfDataSource(dataSource)) { viewer.getONDEXJUNGGraph().setVisibility(oc, false); } } }
private void copyCVToRelation(ONDEXConcept to, ONDEXRelation relation, AttributeName att) { DataSource dataSource = to.getElementOf(); String[] typeIds = dataSource.getId().split(":"); for (String typeId : typeIds) { Attribute attribute = relation.getAttribute(att); if (attribute == null) { relation.createAttribute(att, typeId, false); } else if (attribute.getValue() instanceof Collection) { Collection collection = (Collection) attribute.getValue(); if (!collection.contains(typeId)) { collection.add(typeId); attribute.setValue(collection); } } else if (!attribute.getValue().equals(typeId)) { List<String> cvs = new ArrayList<String>(2); cvs.add(typeId); cvs.add((String) attribute.getValue()); attribute.setValue(cvs); } } }
for (ConceptAccession acc : accs) { if (acc.getAccession().trim().length() > 0) { if (acc.getElementOf().equals(c.getElementOf())) {
for (ConceptAccession acc : accs) { if (acc.getAccession().trim().length() > 0) { if (acc.getElementOf().equals(c.getElementOf())) {
switch (strategy) { case DATASOURCE: paint = Config.getColorForDataSource(node.getElementOf()); break; case EVIDENCETYPE:
/** * 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; }
for (ONDEXRelation rel : graph.getRelationsOfConcept(prot)) { if(rel.getOfType().equals(rtSimSeq) && (!rel.getFromConcept().getElementOf().equals(dataSourceUniProtSP) || !rel.getFromConcept().getElementOf().equals(dataSourceUniProtTR))){ hasHits = true; break;
/** * 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); }
Set<ONDEXRelation> relSet = graph.getRelationsOfConcept(prot); for (ONDEXRelation rel : relSet) { if (rel.getOfType().equals(rtSimSeq) && !rel.getFromConcept().getElementOf().equals(dataSourceUniProt)) { hasHits = true; break;