/** * @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()]); }
/** * @see AbstractContentDisplayPlugin.compileContent() */ @Override public String compileContent(ONDEXEntity e) { StringBuffer b = new StringBuffer(); if (taxid_an != null) { // get attribute on both concepts and relations Attribute attribute = e.getAttribute(taxid_an); if (attribute != null) { String taxid = attribute.getValue().toString(); b.append("<h2>Taxonomy</h2>"); b.append("<a href=\"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=" + taxid + "\">" + taxid + "</a>"); } } return b.toString(); }
/** * @see AbstractContentDisplayPlugin.compileContent() */ @Override public String compileContent(ONDEXEntity e) { StringBuffer b = new StringBuffer(""); if (uri_an != null) { // get attribute on concepts and relations Attribute attribute = e.getAttribute(uri_an); if (attribute != null) { String uri = attribute.getValue().toString(); b.append("<h2>URI</h2>"); b.append("<a href=\"" + uri + "\">" + uri + "</a>"); } } if (url_an != null) { // get attribute on concepts and relations Attribute attribute = e.getAttribute(url_an); if (attribute != null) { String url = attribute.getValue().toString(); b.append("<h2>URL</h2>"); b.append("<a href=\"" + url + "\">" + url + "</a>"); } } return b.toString(); }
/** * @see net.sourceforge.ondex.ovtk2.ui.contentsdisplay.AbstractContentDisplayPlugin#compileContent(net.sourceforge.ondex.core.AbstractONDEXEntity) */ @Override public String compileContent(ONDEXEntity e) { StringBuffer b = new StringBuffer(); // check for attribute name AttributeName confAN = aog.getMetaData().getAttributeName("CONF"); if (confAN != null) { // get attribute of either concept or relation Attribute g = e.getAttribute(confAN); if (g != null) { double conf = (Double) g.getValue(); NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(4); b.append("<h2>Confidence information</h2>"); b.append("<i>c</i> = " + nf.format(conf) + "<br/>"); } } return b.toString(); }
/** * @see net.sourceforge.ondex.ovtk2.ui.contentsdisplay.AbstractContentDisplayPlugin#compileContent(net.sourceforge.ondex.core.AbstractONDEXEntity) */ @Override public String compileContent(ONDEXEntity e) { StringBuffer b = new StringBuffer(); // get attribute from concept and relation Attribute g = e.getAttribute(att); if (g != null && g.getValue() instanceof Boolean) { String name = att.getFullname(); if (name == null || name.trim().length() == 0) name = att.getId(); b.append("<h2>" + name + "?</h2>"); b.append(g.getValue().toString() + "<br/>"); } return b.toString(); }
/** * @see net.sourceforge.ondex.ovtk2.ui.contentsdisplay.AbstractContentDisplayPlugin#compileContent(net.sourceforge.ondex.core.AbstractONDEXEntity) */ @Override public String compileContent(ONDEXEntity e) { StringBuffer b = new StringBuffer(); // get attribute from concept and relation Attribute g = e.getAttribute(att); if (g != null && g.getValue() instanceof String) { String string = (String) g.getValue(); // make hyper-links explicit for PLUGINS-52 if (string.startsWith("http://") || string.startsWith("https://")) { string = "<a href=\"" + string + "\">" + string + "</a>"; } String name = att.getFullname(); if (name == null || name.trim().length() == 0) name = att.getId(); b.append("<h2>" + name + "</h2>"); b.append(string + "<br/>"); } return b.toString(); }
/** * @see net.sourceforge.ondex.ovtk2.ui.contentsdisplay.AbstractContentDisplayPlugin#compileContent(net.sourceforge.ondex.core.AbstractONDEXEntity) */ @Override public String compileContent(ONDEXEntity e) { StringBuffer b = new StringBuffer(); // get attribute from concept and relation Attribute g = e.getAttribute(att); if (g != null && g.getValue() instanceof Number) { Number number = (Number) g.getValue(); String name = att.getFullname(); if (name == null || name.trim().length() == 0) name = att.getId(); b.append("<h2>" + name + "</h2>"); b.append(number.toString() + "<br/>"); } return b.toString(); }
@Override public String compileContent(ONDEXEntity e) { StringBuffer b = new StringBuffer(); // check for attribute on both concepts and relations AttributeName confAN = aog.getMetaData().getAttributeName("evidence"); if (confAN != null) { Attribute g = e.getAttribute(confAN); if (g != null) { b.append("<h2>Evidence</h2>"); b.append(compileSplit(g)); // add additional possible evidence for (int i = 1; i < count; i++) { confAN = aog.getMetaData().getAttributeName("evidence_" + i); if (confAN != null) { g = e.getAttribute(confAN); if (g != null) b.append(compileSplit(g)); } } } } return b.toString(); }
@SuppressWarnings("rawtypes") public String getValue(ONDEXEntity cOrr) throws NullValueException, AccessDeniedException, InvalidOndexEntityException { Attribute attribute = cOrr.getAttribute(an); if (attribute != null) { List<String> values = new ArrayList<String>();
@Override public String compileContent(ONDEXEntity e) { StringBuffer b = new StringBuffer(); // check for attribute only on concepts if (e instanceof ONDEXConcept) { AttributeName attrName = aog.getMetaData().getAttributeName("ChemicalStructure"); if (attrName != null) { Attribute g = e.getAttribute(attrName); if (g != null) { ChemicalStructure cs = (ChemicalStructure) g.getValue(); // extract SMILES from chemical structure if (cs.getSMILES() != null && cs.getSMILES().length() > 0) { b.append("<h2>SMILES</h2>"); b.append(cs.getSMILES()); } // In the future maybe include JChemPaint here } } } return b.toString(); }