@Override protected Set<ONDEXRelation> retrieveRelationAllAttributeName( AttributeName attributeName) { return parent.getRelationsOfAttributeName(attributeName); }
/** * @param an * @return * @see net.sourceforge.ondex.core.ONDEXGraph#getRelationsOfAttributeName(net.sourceforge.ondex.core.AttributeName) */ public Set<ONDEXRelation> getRelationsOfAttributeName(AttributeName an) { return og.getRelationsOfAttributeName(an); }
int counting(AttributeName an) { return graph.getConceptsOfAttributeName(an).size() + graph.getRelationsOfAttributeName(an).size(); } }.count();
public void start() { ONDEXGraphMetaData metadata = graph.getMetaData(); for (ConceptClass cc : metadata.getConceptClasses()) { System.out.println("ConceptClass " + cc.getId() + " " + cc.getFullname()); System.out.println("\tConcepts = " + graph.getConceptsOfConceptClass(cc).size()); } for (DataSource dataSource : metadata.getDataSources()) { System.out.println("DataSource " + dataSource.getId() + " " + dataSource.getFullname()); System.out.println("\tConcepts = " + graph.getConceptsOfDataSource(dataSource).size()); } for (AttributeName att : metadata.getAttributeNames()) { System.out.println("AttributeName " + att.getId() + " " + att.getFullname()); System.out.println("\tConcepts = " + graph.getConceptsOfAttributeName(att).size()); System.out.println("\tRelations = " + graph.getRelationsOfAttributeName(att).size()); } for (RelationType rt : metadata.getRelationTypes()) { System.out.println("RelationType " + rt.getId() + " " + rt.getFullname()); System.out.println("\tRelations = " + graph.getRelationsOfRelationType(rt).size()); } }
public static void exportToCFinder(ONDEXGraph graph, String file, String nodeCV, String attribute) { AttributeName an = graph.getMetaData().getAttributeName(attribute); Set<ONDEXRelation> relations = graph.getRelationsOfAttributeName(an); DataSource dataSource = graph.getMetaData().getDataSource(nodeCV); try { DataOutputStream out = new DataOutputStream(new FileOutputStream(file)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(out)); for (ONDEXRelation r : relations) { String[] line = new String[3]; ONDEXConcept to = r.getToConcept(); for (ConceptAccession ac : to.getConceptAccessions()) { if (ac.getElementOf().equals(dataSource)) line[0] = ac.getAccession(); } ONDEXConcept from = r.getFromConcept(); for (ConceptAccession ac : from.getConceptAccessions()) { if (ac.getElementOf().equals(dataSource)) line[1] = ac.getAccession(); } line[2] = r.getAttribute(an).getValue().toString(); bw.write(line[0] + "\t" + line[1] + "\t" + line[2] + "\n"); bw.flush(); } out.close(); } catch (Exception e) { e.printStackTrace(); } }
if (aog.getConceptsOfAttributeName(an).size() > 0 || aog.getRelationsOfAttributeName(an).size() > 0) anListModel.addAttributeName(an);
/** * Retrieve edge size from stored Attribute values. * * @param graph * ONDEXGraph * @param edgeStrokes * ONDEXEdgeStrokes */ public static void loadEdgeSize(ONDEXGraph graph, ONDEXEdgeStrokes edgeStrokes) { ONDEXGraphMetaData meta = graph.getMetaData(); // load edge size AttributeName anSize = meta.getAttributeName(SIZE); if (anSize != null) { // used in size transformer final Map<ONDEXRelation, Integer> sizes = new HashMap<ONDEXRelation, Integer>(); // get sizes from graph for (ONDEXRelation r : graph.getRelationsOfAttributeName(anSize)) { sizes.put(r, (Integer) r.getAttribute(anSize).getValue()); } // set new edge size function edgeStrokes.setEdgeSizes(new Transformer<ONDEXRelation, Integer>() { @Override public Integer transform(ONDEXRelation input) { if (sizes.containsKey(input)) return sizes.get(input); return Config.defaultEdgeSize; } }); } }
for (ONDEXRelation r : graph.getRelationsOfAttributeName(an)) { ONDEXRelation edge = jung.getRelation(r.getId());
c.deleteAttribute(clustAtt); for (ONDEXRelation r: graph.getRelationsOfAttributeName(clustAtt)) r.deleteAttribute(clustAtt); for (ONDEXRelation r : graph.getRelationsOfAttributeName(an)) { bw.write(r.getFromConcept().getId() + " " + r.getToConcept().getId() + " " + r.getAttribute(an).getValue() + "\n"); bw.flush();
vr = graph.getRelations(); } else { vr = graph.getRelationsOfAttributeName(an);
/** * Retrieve edge color from stored Attribute values. * * @param graph * ONDEXGraph * @param edgePaint * ONDEXEdgeColors */ public static void loadEdgeColor(ONDEXGraph graph, ONDEXEdgeColors edgePaint) { ONDEXGraphMetaData meta = graph.getMetaData(); // load colour AttributeName anColor = meta.getAttributeName(COLOR); if (anColor != null) { edgePaint.setEdgeColorSelection(EdgeColorSelection.MANUAL); for (ONDEXRelation r : graph.getRelationsOfAttributeName(anColor)) { edgePaint.updateColor(r, (Color) r.getAttribute(anColor).getValue()); } } }
for (ONDEXRelation relation : graph.getRelationsOfAttributeName(att)) { Object value = relation.getAttribute(att).getValue(); Integer count = objectsToValues.get(value);
.getRelationsOfAttributeName(attributeName); Set<ONDEXRelation> noAttributeRelations = null;
Set<ONDEXRelation> itr = graph.getRelationsOfAttributeName(an); itr = BitSetFunctions.and(relations, itr); for (ONDEXRelation r : itr) {