/** * Constructor sets Attribute. * * @param attribute * Attribute */ public GDSTableModel(Attribute attribute) { this.attribute = attribute; this.o = attribute.getValue(); if (this.o instanceof Protein3dStructure) this.structure = (Protein3dStructure) o; }
public Object getValueAt(int row, int col) { return attribute.getValue(); }
public Object getValueAt(int row, int col) { return attribute.getValue(); }
public Object getValueAt(int row, int col) { return attribute.getValue(); }
public Object getValueAt(int row, int col) { return attribute.getValue(); }
private void displayStructure(StringBuffer b, Attribute attribute) { if (attribute != null) { String string = attribute.getValue().toString(); b.append("<h2>Glycostructure</h2>"); b.append("<pre>"); b.append(string); b.append("</pre>"); } }
private final boolean isInTargetPlain(ONDEXConcept possibleTarget, AttributeName an, Object id) { Attribute attribute = possibleTarget.getAttribute(an); if (attribute == null) return false; if (!attribute.getValue().equals(id)) return false; return true; } }
private static double getNumber(AttributeName an, ONDEXRelation r) { Attribute attribute = r.getAttribute(an); if (attribute == null) return 0d; else return (Double) attribute.getValue(); }
private static final void getGDSValues(Collection<ONDEXConcept> cs, AttributeName att, Set set) { for (ONDEXConcept c : cs) { Attribute attribute = c.getAttribute(att); if (attribute != null) { set.add(attribute.getValue()); } } }
/** * @param entities relations to extract the given attribute values on (where they exist) * @param att * @return an array of the attribute values where they exist (can be null if the path is unrankable) */ public static Double[] valuesToArray(Set<ONDEXEntity> entities, AttributeName att) { List<Double> values1 = new ArrayList<Double>(); for (ONDEXEntity entity : entities) { Attribute value = entity.getAttribute(att); if (value != null) values1.add(((Number) value.getValue()).doubleValue()); } return values1.toArray(new Double[values1.size()]); }
@Override public boolean accepts() { boolean found = false; for (ONDEXConcept c : entities) { // at least one concept flagged if (c.getAttribute(anFlag) != null && c.getAttribute(anFlag).getValue().equals(Boolean.TRUE)) { found = true; break; } } return found; }
@Override public boolean equals(Object o) { if (o == null) return false; if (o == this) return true; if (!(o instanceof Attribute)) return false; Attribute attribute = (Attribute) o; return getOfType().equals(attribute.getOfType()) && getValue().equals(attribute.getValue()); }
public Object getValueAt(int row, int col) { if (attribute != null) return Marshaller.getMarshaller().toXML(attribute.getValue()); return ""; }
@Override public Font transform(ONDEXConcept n) { ONDEXConcept c = graph.getConcept(n.getId()); Attribute attribute = c.getAttribute(an); if (attribute != null) { Float size = (float) (((Double) attribute.getValue() / (Double) gdsMax) * (maxSize - minSize) + minSize); return newFont.deriveFont(size); } return newFont; } });
/** * Sets attribute name to extract values from. * * @param an * AttributeName */ public Histogram(AttributeName an) { for (ONDEXConcept c : graph.getConceptsOfAttributeName(an)) { Attribute attribute = c.getAttribute(an); values.put(c, (Number) attribute.getValue()); } doBins(); }
public static void assignBlastWeight(ONDEXGraph graph) { AttributeName an = graph.getMetaData().getFactory().createAttributeName("BLAST_WEIGHT", Double.class); for (ONDEXRelation r : graph.getRelations()) { Attribute attribute = r.getAttribute(graph.getMetaData().getAttributeName("BLEV")); if (attribute == null) continue; Float score = (float) (double) (Double) attribute.getValue(); Double value = (double) 1f / (1f + (float) Math.exp(((((float) Math.log10(score) + 3f) * 6.66667f) + 10f))); r.createAttribute(an, value, false); } }
/** * Cast a given Attribute into a BerkeleyRelationAttribute. * * @param old * Attribute * @return BerkeleyRelationAttribute */ protected static BerkeleyRelationAttribute convert(Attribute old) { BerkeleyRelationAttribute nu = new BerkeleyRelationAttribute( old.getSID(), old.getOwnerId(), old.getOfType(), old.getValue(), old.isDoIndex()); return nu; }
/** * Cast a given Attribute into a BerkeleyConceptAttribute. * * @param old * Attribute * @return BerkeleyConceptAttribute */ protected static BerkeleyConceptAttribute convert(Attribute old) { BerkeleyConceptAttribute nu = new BerkeleyConceptAttribute( old.getSID(), old.getOwnerId(), old.getOfType(), old.getValue(), old.isDoIndex()); return nu; }
private static void assignCoexWeight(ONDEXGraph graph) { AttributeName an = graph.getMetaData().getFactory().createAttributeName("COEX_WEIGHT", Double.class); for (ONDEXRelation r : graph.getRelations()) { Attribute attribute = r.getAttribute(graph.getMetaData().getAttributeName("Correlation")); if (attribute == null) continue; Double score = (Double) attribute.getValue(); r.createAttribute(an, (Math.abs(score) - 0.6) / 0.4, false); } }