Render gene via BioGPS
Created: 2012-04-05 16:53:22
Last updated: 2012-05-23 11:34:35
This workflow uses the REST API of BioGPS to
list the plugins and then allow the user to select which
plugin to use to display the input gene id
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Descriptions (1)
This workflow uses the REST API of BioGPS to
list the plugins and then allow the user to select which
plugin to use to display the input gene id |
Dependencies (0)
Inputs (1)
Name |
Description |
gene_id |
The gene id. The required format of the id depends upon the plugin chosen.
|
Processors (10)
Name |
Type |
Description |
list_biogps_plugins |
rest |
|
extract_plugins |
xpath |
Xpath Expression//item[@key='_type'][.='plugin']/.. |
extract_id_of_plugin |
xpath |
Xpath Expression/item/item/item[@key='id'] |
choose_plugin_by_name |
localworker |
Scriptimport javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import java.util.TreeMap;
import java.awt.Dimension;
if ((selectionValues == void) || (selectionValues == null) || (selectionValues.isEmpty())) {
throw new RuntimeException("selectionValues must be specified and non-empty");
}
ButtonGroup group = new ButtonGroup();
JPanel messagePanel = new JPanel();
messagePanel.setLayout(new BoxLayout(messagePanel,BoxLayout.Y_AXIS));
messagePanel.add(new JLabel((message == void ? null : message)));
TreeMap map = new TreeMap();
for (int i = 0; i < selectionValues.size(); i++) {
map.put(selectionValues.get(i), Integer.valueOf(i));
}
JRadioButton[] buttonArray = new JRadioButton[selectionValues.size()];
int i = 0;
for (String s : map.keySet()) {
buttonArray[i] = new JRadioButton(s);
if (i==0) buttonArray[i].setSelected(true);
group.add(buttonArray[i]);
messagePanel.add(buttonArray[i]);
i++;
}
int arraySize = i;
JScrollPane scrollPane = new JScrollPane(messagePanel);
scrollPane.setPreferredSize(new Dimension(200,300));
JOptionPane.showOptionDialog(null, scrollPane, (title == void ? null : title),
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"OK"}, null);
String answer="";
for (int i = 0; i < arraySize; i++) {
JRadioButton button = buttonArray[i];
if (button.isSelected()) {
answer=map.get(button.getText()).toString();
break;
}
}
|
flatten_name_list |
localworker |
Scriptflatten(inputs, outputs, depth) {
for (i = inputs.iterator(); i.hasNext();) {
element = i.next();
if (element instanceof Collection && depth > 0) {
flatten(element, outputs, depth - 1);
} else {
outputs.add(element);
}
}
}
outputlist = new ArrayList();
flatten(inputlist, outputlist, 1); |
extract_name_of_plugin |
xpath |
Xpath Expression/item/item/item[@key='name'] |
flatten_id_list |
localworker |
Scriptflatten(inputs, outputs, depth) {
for (i = inputs.iterator(); i.hasNext();) {
element = i.next();
if (element instanceof Collection && depth > 0) {
flatten(element, outputs, depth - 1);
} else {
outputs.add(element);
}
}
}
outputlist = new ArrayList();
flatten(inputlist, outputlist, 1); |
find_corresponding_id |
beanshell |
ScriptObject the_element = the_list.get(Integer.valueOf(the_index)); |
create_render_url |
beanshell |
ScriptString url="http://biogps.org/plugin_v1/" + plugin_id +
"/renderurl/?geneid=" + gene_id + "&redirect"; |
Open_web_browser_at_a_URL |
localworker |
Scriptimport java.awt.Desktop;
import java.net.URI;
if ((url == void) || (url == null)) {
throw new RuntimeException("Url must be specified");
}
URI uri = null;
uri = new URI(url);
Desktop.getDesktop().browse(uri); |
Beanshells (2)
Name |
Description |
Inputs |
Outputs |
find_corresponding_id |
|
the_list
the_index
|
the_element
|
create_render_url |
|
plugin_id
gene_id
|
url
|
Datalinks (11)
Source |
Sink |
list_biogps_plugins:responseBody |
extract_plugins:xml_text |
extract_plugins:nodelistAsXML |
extract_id_of_plugin:xml_text |
flatten_name_list:outputlist |
choose_plugin_by_name:selectionValues |
extract_name_of_plugin:nodelist |
flatten_name_list:inputlist |
extract_plugins:nodelistAsXML |
extract_name_of_plugin:xml_text |
extract_id_of_plugin:nodelist |
flatten_id_list:inputlist |
choose_plugin_by_name:answer |
find_corresponding_id:the_index |
flatten_id_list:outputlist |
find_corresponding_id:the_list |
gene_id |
create_render_url:gene_id |
find_corresponding_id:the_element |
create_render_url:plugin_id |
create_render_url:url |
Open_web_browser_at_a_URL:url |
Uploader
License
All versions of this Workflow are
licensed under:
Version 3 (latest)
(of 3)
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