Comparing Quantities using HyperLEDA
Created: 2011-10-03 16:58:09
This workflow receives the name of the property to compare, a file with a list of names of galaxies, and a file with the list of original values of that property. The property name must be typed in the same way used in the HTML returned by HyperLEDA
The workflow calls to HyperLEDA using the names of the galaxies as input, and it returns a HTML file with information about the galaxy. This file is parsed by the python tool "ExtractPropertyValues", that extracts the value of the property introduced by the user. The results of this tool are written in a file, and with the file of the original values compose the input for the Make_comparing_file tool, that build a file with a comparision between the original values and the values got from LEDA.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Comparing Quantities using HyperLEDA
|
Descriptions (1)
This workflow receives the name of the property to compare, a file with a list of names of galaxies, and a file with the list of original values of that property. The property name must be typed in the same way used in the HTML returned by HyperLEDA
The workflow calls to HyperLEDA using the names of the galaxies as input, and it returns a HTML file with information about the galaxy. This file is parsed by the python tool "ExtractPropertyValues", that extracts the value of the property introduced by the user. The results of this tool are written in a file, and with the file of the original values compose the input for the Make_comparing_file tool, that build a file with a comparision between the original values and the values got from LEDA.
|
Dependencies (0)
Inputs (1)
Name |
Description |
property |
|
Processors (15)
Name |
Type |
Description |
REST_Service |
rest |
|
extractPropertyValue |
externaltool |
|
Write_Text_File |
localworker |
Script
BufferedWriter out;
if (encoding == void) {
out = new BufferedWriter(new FileWriter(outputFile));
}
else {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), encoding));
}
out.write(filecontents);
out.flush();
out.close();
outputFile = filecontents;
|
encoding_value_1 |
stringconstant |
Valueutf-8 |
outputFile_value |
stringconstant |
Valuefiletmp.txt |
readLinesFile |
workflow |
|
Names_galaxies |
stringconstant |
ValueEnter file with the name of galaxies list |
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();
|
Write_Text_File_3 |
localworker |
Script
BufferedWriter out;
if (encoding == void) {
out = new BufferedWriter(new FileWriter(outputFile));
}
else {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), encoding));
}
out.write(filecontents);
out.flush();
out.close();
outputFile = filecontents;
|
RemotesValues |
stringconstant |
ValueBMagnitude.txt |
Select_File |
localworker |
Scriptimport java.awt.CardLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.filechooser.FileFilter;
class FileExtFilter extends FileFilter {
public FileExtFilter(String ext, String label, boolean includeDir) {
this.ext = ext;
this.label = label;
this.includeDir = includeDir;
}
public String getDescription() {
return this.label;
}
public boolean accept(File file) {
if (file.isDirectory() && includeDir) {
return true;
} else {
return file.getName().endsWith(this.ext);
}
}
String ext, label;
boolean includeDir;
}
if (title == void) {
title = null;
}
if ((fileExtensions == void) || (fileExtensions == null)) {
fileExtensions = "";
}
if ((fileExtLabels == void) || (fileExtLabels == null)) {
fileExtLabels = "";
}
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle(title);
String[] fileTypeList = fileExtensions.split(",");
String[] filterLabelList = fileExtLabels.split(",");
if (fileTypeList != null && filterLabelList != null && fileTypeList.length != filterLabelList.length) {
throw new RuntimeException("The list of extensions and file filter labels must be the same length");
}
// create the file filters
for (int i = 0; i < fileTypeList.length; i++) {
FileExtFilter filter = new FileExtFilter(fileTypeList[i], filterLabelList[i], true);
chooser.setFileFilter(filter);
}
chooser.showOpenDialog(null);
File file = chooser.getSelectedFile();
selectedFile = file.getAbsolutePath();
|
extension_TXT |
stringconstant |
Valuetxt |
TXT |
stringconstant |
Valuetxt |
Local_Values |
stringconstant |
ValueEnter local file with the list of quantities |
Make_comparing_file |
externaltool |
|
Outputs (2)
Name |
Description |
remoteValues |
|
comparingFile |
|
Datalinks (18)
Source |
Sink |
readLinesFile:lines |
REST_Service:object_name |
Write_Text_File:outputFile |
extractPropertyValue:filetmp |
property |
extractPropertyValue:property |
encoding_value_1:value |
Write_Text_File:encoding |
REST_Service:responseBody |
Write_Text_File:filecontents |
outputFile_value:value |
Write_Text_File:outputFile |
Names_galaxies:value |
readLinesFile:title |
extractPropertyValue:STDOUT |
Merge_String_List_to_a_String:stringlist |
encoding_value_1:value |
Write_Text_File_3:encoding |
Merge_String_List_to_a_String:concatenated |
Write_Text_File_3:filecontents |
RemotesValues:value |
Write_Text_File_3:outputFile |
extension_TXT:value |
Select_File:fileExtensions |
TXT:value |
Select_File:fileExtLabels |
Local_Values:value |
Select_File:title |
Select_File:selectedFile |
Make_comparing_file:MBLocal |
Write_Text_File_3:outputFile |
Make_comparing_file:MBRemote |
Write_Text_File_3:outputFile |
remoteValues |
Make_comparing_file:MBComparing |
comparingFile |
Uploader
License
All versions of this Workflow are
licensed under:
BSD License
Version 1
(of 1)
Credits (0)
(People/Groups)
None
Attributions (0)
(Workflows/Files)
None
Shared with Groups (0)
None
Featured In Packs (0)
None
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