extract_roc_points
Created: 2014-10-13 14:39:26
Last updated: 2014-12-04 16:19:19
Extracts the ROC points from a test result XML.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Extract ROC points from test result XML |
Descriptions (0)
Dependencies (0)
Inputs (1)
Name |
Description |
statistics_xml |
Output from a test model result.
|
Processors (4)
Name |
Type |
Description |
points_xpath |
stringconstant |
Value//*[local-name(.) = 'RocCurve']/@Points |
extract_points |
localworker |
Scriptimport org.dom4j.Document;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
SAXReader reader = new SAXReader(false);
reader.setIncludeInternalDTDDeclarations(false);
reader.setIncludeExternalDTDDeclarations(false);
Document document = reader.read(new StringReader(xmltext));
List nodelist = document.selectNodes(xpath);
// Process the elements in the nodelist
ArrayList outputList = new ArrayList();
ArrayList outputXmlList = new ArrayList();
String val = null;
String xmlVal = null;
for (Iterator iter = nodelist.iterator(); iter.hasNext();) {
Node element = (Node) iter.next();
xmlVal = element.asXML();
val = element.getStringValue();
if (val != null && !val.equals("")) {
outputList.add(val);
outputXmlList.add(xmlVal);
}
}
List nodelist=outputList;
List nodelistAsXML=outputXmlList; |
Merge_String_List_to_a_String |
localworker |
ScriptString seperatorString = "\n";
if (seperator != void) {
seperatorString = seperator;
}
StringBuffer sb = new StringBuffer();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
sb.append(item);
if (i.hasNext()) {
sb.append(seperatorString);
}
}
concatenated = sb.toString();
|
make_points_list |
beanshell |
ScriptArrayList points = new ArrayList();
String[] values = points_str.split(" ");
double x = 0;
double y = 0;
for (int i = 0; i < values.length/2; ++i) {
x = Double.parseDouble(values[2*i]);
y = Double.parseDouble(values[2*i + 1]);
double[] point = {x, y};
points.add(point);
} |
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
make_points_list |
|
points_str
|
points
|
Outputs (1)
Name |
Description |
points |
ROC points as a list of lists: [ [x1, y1], [x2, y2], [x3, y3] ]
|
Datalinks (5)
Source |
Sink |
points_xpath:value |
extract_points:xpath |
statistics_xml |
extract_points:xml-text |
extract_points:nodelist |
Merge_String_List_to_a_String:stringlist |
Merge_String_List_to_a_String:concatenated |
make_points_list:points_str |
make_points_list:points |
points |
Uploader
Component Validity
Loading
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (1)
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment