Get the list of GeneID for all pathways of a specified taxon
Created: 2009-04-28 07:48:40
No description has been set
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (2)
Get the list of GeneID for all pathways of a specified taxon |
Get pathways genes by taxon |
Descriptions (0)
Dependencies (0)
Processors (13)
Name |
Type |
Description |
mmu |
stringconstant |
Valuemmu |
sparql_get_pathway_list_by_taxon |
beanshell |
Scriptoutput = "http://kegg.bio2rdf.org/sparql?default-graph-uri=&query=SELECT+%3FPathway+%0D%0AWHERE+{%0D%0A++%3FPathway+a+%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fkegg%23Pathway%3E+.%0D%0A++FILTER(regex(%3FPathway+%2C+%22"+string1+"%22))+.%0D%0A}&format=text%2Fhtml&debug=on"; |
Get_Web_Page_2 |
localworker |
ScriptURL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
}
else {
inputURL = new URL(url);
}
URLConnection con = inputURL.openConnection();
InputStream in = con.getInputStream();
InputStreamReader isr = new InputStreamReader(in);
Reader inReader = new BufferedReader(isr);
StringBuffer buf = new StringBuffer();
int ch;
while ((ch = inReader.read()) > -1) {
buf.append((char)ch);
}
inReader.close();
contents = buf.toString();
//String NEWLINE = System.getProperty("line.separator");
//
//URL inputURL = null;
//if (base != void) {
// inputURL = new URL(new URL(base), url);
//} else {
// inputURL = new URL(url);
//}
//StringBuffer result = new StringBuffer();
//BufferedReader reader = new BufferedReader(new InputStreamReader(inputURL.openStream()));
//String line = null;
//while ((line = reader.readLine()) != null) {
// result.append(line);
// result.append(NEWLINE);
//}
//
//contents = result.toString();
|
Get_Web_Page_3 |
localworker |
ScriptURL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
}
else {
inputURL = new URL(url);
}
URLConnection con = inputURL.openConnection();
InputStream in = con.getInputStream();
InputStreamReader isr = new InputStreamReader(in);
Reader inReader = new BufferedReader(isr);
StringBuffer buf = new StringBuffer();
int ch;
while ((ch = inReader.read()) > -1) {
buf.append((char)ch);
}
inReader.close();
contents = buf.toString();
//String NEWLINE = System.getProperty("line.separator");
//
//URL inputURL = null;
//if (base != void) {
// inputURL = new URL(new URL(base), url);
//} else {
// inputURL = new URL(url);
//}
//StringBuffer result = new StringBuffer();
//BufferedReader reader = new BufferedReader(new InputStreamReader(inputURL.openStream()));
//String line = null;
//while ((line = reader.readLine()) != null) {
// result.append(line);
// result.append(NEWLINE);
//}
//
//contents = result.toString();
|
html2uris |
beanshell |
ScriptList split = new ArrayList();
if (!html.equals("")) {
String regexString = "\n";
if (regex != void) {
regexString = regex;
}
String[] result = html.split(regexString);
for (int i = 0; i < result.length; i++) {
split.add(result[i]);
}
}
import java.util.regex.*;
uris = new ArrayList();
Pattern thePat = Pattern.compile("http://bio2rdf.org/(.*) | ");
int theGroup = 1;
for (Iterator i = split.iterator(); i.hasNext();) {
String item = (String) i.next();
Matcher matcher = thePat.matcher(item);
if (matcher.find()) {
uris.add("http://bio2rdf.org/"+matcher.group(theGroup));
}
}
|
sparql_insert_n3 |
beanshell |
Scriptimport java.net.*;
import java.io.*;
// Construct data
String data = "query=" + URLEncoder.encode("insert in graph <"+graph+"> { "+n3+" }", "UTF-8");
// Create a socket to the host
String hostname = "localhost";
int port = 8890;
InetAddress addr = InetAddress.getByName(hostname);
Socket socket = new Socket(addr, port);
// Send header
String path = "/sparql";
BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), "UTF8"));
wr.write("POST "+path+" HTTP/1.0\r\n");
wr.write("Content-Length: "+data.length()+"\r\n");
wr.write("Content-Type: application/x-www-form-urlencoded\r\n");
wr.write("\r\n");
// Send data
wr.write(data);
wr.flush();
// Get response
BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
StringBuffer buf = new StringBuffer();
String line;
while ((line = rd.readLine()) != null) {
buf.append(line);
}
wr.close();
rd.close();
html = buf.toString(); |
temp |
stringconstant |
Valuetemp |
sparql_get_geneid_by_path |
beanshell |
Scriptoutput = "http://kegg.bio2rdf.org/sparql?default-graph-uri=&query=CONSTRUCT+{%0D%0A%3FPathway+%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fbio2rdf%23xGeneID%3E+%3Fgeneid+.%0D%0A}%0D%0AWHERE+{%0D%0A++%3FPathway+%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fkegg%23xRelation%3E+%3FxRelation+.%0D%0A++FILTER(%3FPathway+%3D+%3C"+string1+"%3E)+.%0D%0A++%3FxRelation+%3Fp1+%3Fs1+.%0D%0A++FILTER(%3Fp1+%3D+%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fkegg%23xEntry1%3E+OR+%3Fp1+%3D+%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fkegg%23xEntry2%3E+)+.%0D%0A++%3Fs1+%3Chttp%3A%2F%2Fbio2rdf.org%2Fns%2Fkegg%23xRef%3E+%3FxRef+.%0D%0A++%3FxRef+%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23sameAs%3E+%3Fgeneid+.%0D%0A}&format=text%2Frdf%2Bn3&debug=on"; |
hsa |
stringconstant |
Valuehsa |
Get_Web_Page_1 |
localworker |
ScriptURL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
}
else {
inputURL = new URL(url);
}
URLConnection con = inputURL.openConnection();
InputStream in = con.getInputStream();
InputStreamReader isr = new InputStreamReader(in);
Reader inReader = new BufferedReader(isr);
StringBuffer buf = new StringBuffer();
int ch;
while ((ch = inReader.read()) > -1) {
buf.append((char)ch);
}
inReader.close();
contents = buf.toString();
//String NEWLINE = System.getProperty("line.separator");
//
//URL inputURL = null;
//if (base != void) {
// inputURL = new URL(new URL(base), url);
//} else {
// inputURL = new URL(url);
//}
//StringBuffer result = new StringBuffer();
//BufferedReader reader = new BufferedReader(new InputStreamReader(inputURL.openStream()));
//String line = null;
//while ((line = reader.readLine()) != null) {
// result.append(line);
// result.append(NEWLINE);
//}
//
//contents = result.toString();
|
sparql_delete_graph |
beanshell |
Scriptoutput = "DELETE FROM GRAPH <"+string1+"> { ?s ?p ?o } WHERE { GRAPH ?g { ?s ?p ?o }} "; |
sparql_count_geneid |
stringconstant |
Valuehttp://localhost:8890/sparql?default-graph-uri=temp&query=SELECT+count(distinct+%3Fo)+WHERE+{%3Fs+%3Fp+%3Fo}&format=text%2Fhtml&debug=on |
Get_Web_Page_4 |
localworker |
ScriptURL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
}
else {
inputURL = new URL(url);
}
URLConnection con = inputURL.openConnection();
InputStream in = con.getInputStream();
InputStreamReader isr = new InputStreamReader(in);
Reader inReader = new BufferedReader(isr);
StringBuffer buf = new StringBuffer();
int ch;
while ((ch = inReader.read()) > -1) {
buf.append((char)ch);
}
inReader.close();
contents = buf.toString();
//String NEWLINE = System.getProperty("line.separator");
//
//URL inputURL = null;
//if (base != void) {
// inputURL = new URL(new URL(base), url);
//} else {
// inputURL = new URL(url);
//}
//StringBuffer result = new StringBuffer();
//BufferedReader reader = new BufferedReader(new InputStreamReader(inputURL.openStream()));
//String line = null;
//while ((line = reader.readLine()) != null) {
// result.append(line);
// result.append(NEWLINE);
//}
//
//contents = result.toString();
|
Beanshells (5)
Name |
Description |
Inputs |
Outputs |
sparql_get_pathway_list_by_taxon |
|
string1
|
output
|
html2uris |
|
html
|
uris
|
sparql_insert_n3 |
|
n3
graph
|
html
|
sparql_get_geneid_by_path |
|
string1
|
output
|
sparql_delete_graph |
|
string1
|
output
|
Outputs (6)
Name |
Description |
o1 |
|
o2 |
|
o5 |
|
o3 |
|
o4 |
|
o6 |
|
Datalinks (16)
Source |
Sink |
hsa:value |
sparql_get_pathway_list_by_taxon:string1 |
sparql_get_pathway_list_by_taxon:output |
Get_Web_Page_2:url |
sparql_get_geneid_by_path:output |
Get_Web_Page_3:url |
Get_Web_Page_2:contents |
html2uris:html |
Get_Web_Page_3:contents |
sparql_insert_n3:n3 |
temp:value |
sparql_insert_n3:graph |
html2uris:uris |
sparql_get_geneid_by_path:string1 |
sparql_delete_graph:output |
Get_Web_Page_1:url |
temp:value |
sparql_delete_graph:string1 |
sparql_count_geneid:value |
Get_Web_Page_4:url |
Get_Web_Page_2:contents |
o1 |
html2uris:uris |
o2 |
Get_Web_Page_3:contents |
o5 |
sparql_insert_n3:html |
o3 |
Get_Web_Page_1:contents |
o4 |
Get_Web_Page_4:contents |
o6 |
Coordinations (2)
Controller |
Target |
Get_Web_Page_1 |
Get_Web_Page_2 |
sparql_insert_n3 |
Get_Web_Page_4 |
Uploader
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 (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