KEGG:Pathway Scheme
Created: 2012-08-14 14:25:06
Last updated: 2013-08-27 07:47:51
The purpose of the workflow is to determine all the genes operating in the pathways that the input metabolite participates in. The overall idea is to generate a set of genes that potentially influence the levels of a metabolite due to the common pathways that they share.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
|  |
Titles (1)
|  |
Descriptions (1)
|  |
The purpose of the workflow is to determine all the genes operating in the pathways that the input metabolite participates in. The overall idea is to generate a set of genes that potentially influence the levels of a metabolite due to the common pathways that they share. |
Dependencies (0)
|  |
Inputs (2)
|  |
Name |
Description |
compound_id |
The input for the workflow is a Kegg compound ID.
|
output_file |
This takes the input of the local directory where the user wants to store the output result of the workflow.
|
Processors (11)
|  |
Name |
Type |
Description |
get_compound |
rest |
|
extract_pathway_from_compounds_file |
beanshell |
Scriptimport java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.ArrayList;
import java.util.Iterator;
String PATHWAY_Line;
List out1 = new ArrayList();
//First grab the line that contains the word "PATHWAY"
String p = "PATHWAY\\s+(.+?)\\b[A-Z]+?\\b\\s+";
Pattern pattern = Pattern.compile(p,Pattern.DOTALL);
Matcher matcher = pattern.matcher(in1);
while (matcher.find()){
PATHWAY_Line = matcher.group(1);
}
//Now get all the pathway ids from the "PATHWAY" line
String p1 = "(ko[0-9]{5})";
Pattern pattern1 = Pattern.compile(p1,Pattern.MULTILINE);
Matcher matcher1 = pattern1.matcher(PATHWAY_Line);
while (matcher1.find()){
out1.add(matcher1.group(1));
}
|
query_for_pathways |
beanshell |
Scriptout1="path:" + in1; |
get_genes_by_pathway |
rest |
|
extract_genes_from_pathway_file |
beanshell |
Scriptimport java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.ArrayList;
import java.util.Iterator;
String Gene_Matcher;
List out1 = new ArrayList();
List tmp = new ArrayList();
//String p = "GENE\\s+(.+?)\\b[A-Z]+?\\b";
String p = "GENE\\s+(.+?)\\bCOMPOUND\\b";
Pattern pattern = Pattern.compile(p,Pattern.DOTALL);
Matcher matcher = pattern.matcher(in1);
while (matcher.find()){
Gene_Matcher = matcher.group(1);
}
if (Gene_Matcher != null) {
String [] line = Gene_Matcher.split("\\s\\s\\s+");
//Extract the gene id, remove the gene name from consideration
for (int i=0; i < line.length; i++) {
String [] line1 = line[i].split(";");
out1.add(line1[0]);
}
}
else {
out1.add("");
}
|
Flatten_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); |
Remove_String_Duplicates |
localworker |
ScriptList strippedlist = new ArrayList();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
if (strippedlist.contains(item) == false) {
strippedlist.add(item);
}
}
|
Create_and_populate_temporary_file |
beanshell |
This service creates a temporary file in a local tmp directory. ScriptFile f = File.createTempFile("taverna", ".tmp");
BufferedWriter writer = new BufferedWriter(new FileWriter(f));
writer.write(content);
writer.close();
filepath = f.getCanonicalPath(); |
Concatenate_Files |
localworker |
This service examines the files whose paths or URLs are specified in the filelist. The content of those files is concatenated. ScriptBufferedReader getReader (String fileUrl) throws IOException {
InputStreamReader reader;
try {
reader = new FileReader(fileUrl);
}
catch (FileNotFoundException e) {
// try a real URL instead
URL url = new URL(fileUrl);
reader = new InputStreamReader (url.openStream());
}
return new BufferedReader(reader);
}
String NEWLINE = System.getProperty("line.separator");
boolean displayResults = false;
if (displayresults != void) {
displayResults = Boolean.valueOf(displayresults).booleanValue();
}
StringBuffer sb = new StringBuffer(2000);
if (outputfile == void) {
throw new RuntimeException("The 'outputfile' parameter cannot be null");
}
if (filelist == null) {
throw new RuntimeException("The 'filelist' parameter cannot be null");
}
String str = null;
Writer writer = new FileWriter(outputfile);
for (int i = 0; i < filelist.size(); i++) {
BufferedReader reader = getReader(filelist.get(i));
while ((str = reader.readLine()) != null) {
writer.write(str);
writer.write(NEWLINE);
if (displayResults) {
sb.append(str);
sb.append(NEWLINE);
}
}
reader.close();
}
writer.flush();
writer.close();
if (displayResults) {
results= sb.toString();
}
|
Select_only_metabolic_pwy |
beanshell |
This is to insure that we select only metabolic pathways. Scriptimport java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.List;
import java.util.ArrayList;
List tmp = new ArrayList();
for(int i=0; i < in1.size(); i++) {
if( in1.get(i).toString().equals("ko00010") || in1.get(i).toString().equals("ko00020") || in1.get(i).toString().equals("ko00030") || in1.get(i).toString().equals("ko00040") || in1.get(i).toString().equals("ko00051") || in1.get(i).toString().equals("ko00052") || in1.get(i).toString().equals("ko00053") || in1.get(i).toString().equals("ko00500") || in1.get(i).toString().equals("ko00520") || in1.get(i).toString().equals("ko00620") || in1.get(i).toString().equals("ko00630") || in1.get(i).toString().equals("ko00640") || in1.get(i).toString().equals("ko00650") || in1.get(i).toString().equals("ko00660") || in1.get(i).toString().equals("ko00562") || in1.get(i).toString().equals("ko00190") || in1.get(i).toString().equals("ko00195") || in1.get(i).toString().equals("ko00196") || in1.get(i).toString().equals("ko00710") || in1.get(i).toString().equals("ko00720") || in1.get(i).toString().equals("ko00920") || in1.get(i).toString().equals("ko00061") || in1.get(i).toString().equals("ko00062") || in1.get(i).toString().equals("ko00071") || in1.get(i).toString().equals("ko00072") ||in1.get(i).toString().equals("ko00100") || in1.get(i).toString().equals("ko00120") || in1.get(i).toString().equals("ko00121") || in1.get(i).toString().equals("ko00140") || in1.get(i).toString().equals("ko00561") || in1.get(i).toString().equals("ko00564") || in1.get(i).toString().equals("ko00565") || in1.get(i).toString().equals("ko00600") || in1.get(i).toString().equals("ko00590") || in1.get(i).toString().equals("ko00591") || in1.get(i).toString().equals("ko00592") || in1.get(i).toString().equals("ko01040") ||
in1.get(i).toString().equals("ko00250") || in1.get(i).toString().equals("ko00260") || in1.get(i).toString().equals("ko00270") || in1.get(i).toString().equals("ko00280") || in1.get(i).toString().equals("ko00290") || in1.get(i).toString().equals("ko00300") || in1.get(i).toString().equals("ko00310") || in1.get(i).toString().equals("ko00330") || in1.get(i).toString().equals("ko00340") || in1.get(i).toString().equals("ko00350") || in1.get(i).toString().equals("ko00360") || in1.get(i).toString().equals("ko00380") || in1.get(i).toString().equals("ko00400") || in1.get(i).toString().equals("ko00410") || in1.get(i).toString().equals("ko00430") || in1.get(i).toString().equals("ko00440") || in1.get(i).toString().equals("ko00450") || in1.get(i).toString().equals("ko00460") || in1.get(i).toString().equals("ko00471") || in1.get(i).toString().equals("ko00472") || in1.get(i).toString().equals("ko00473") || in1.get(i).toString().equals("ko00480") || in1.get(i).toString().equals("ko00510") || in1.get(i).toString().equals("ko00513") || in1.get(i).toString().equals("ko00512") || in1.get(i).toString().equals("ko00514") || in1.get(i).toString().equals("ko00532") || in1.get(i).toString().equals("ko00534") || in1.get(i).toString().equals("ko00533") || in1.get(i).toString().equals("ko00531") || in1.get(i).toString().equals("ko00563") || in1.get(i).toString().equals("ko00601") || in1.get(i).toString().equals("ko00603") || in1.get(i).toString().equals("ko00604") || in1.get(i).toString().equals("ko00540") || in1.get(i).toString().equals("ko00550") || in1.get(i).toString().equals("ko00511") || in1.get(i).toString().equals("ko00730") || in1.get(i).toString().equals("ko00740") || in1.get(i).toString().equals("ko00750") || in1.get(i).toString().equals("ko00760") || in1.get(i).toString().equals("ko00770") ||
in1.get(i).toString().equals("ko00780") || in1.get(i).toString().equals("ko00785") || in1.get(i).toString().equals("ko00790") || in1.get(i).toString().equals("ko00670") || in1.get(i).toString().equals("ko00830") || in1.get(i).toString().equals("ko00130") || in1.get(i).toString().equals("ko04723"))
{
tmp.add(in1.get(i).toString().replace("ko","hsa"));
}
}
out1 = tmp;
|
Flatten_List_2 |
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); |
Beanshells (5)
|  |
Name |
Description |
Inputs |
Outputs |
extract_pathway_from_compounds_file |
|
in1
|
out1
|
query_for_pathways |
|
in1
|
out1
|
extract_genes_from_pathway_file |
|
in1
|
out1
|
Create_and_populate_temporary_file |
This service creates a temporary file in a local tmp directory. |
content
|
filepath
|
Select_only_metabolic_pwy |
This is to insure that we select only metabolic pathways. |
in1
|
out1
|
Outputs (0)
|  |
Datalinks (12)
|  |
Source |
Sink |
compound_id |
get_compound:query |
get_compound:responseBody |
extract_pathway_from_compounds_file:in1 |
Flatten_List_2:outputlist |
query_for_pathways:in1 |
query_for_pathways:out1 |
get_genes_by_pathway:query |
get_genes_by_pathway:responseBody |
extract_genes_from_pathway_file:in1 |
extract_genes_from_pathway_file:out1 |
Flatten_List:inputlist |
Flatten_List:outputlist |
Remove_String_Duplicates:stringlist |
Remove_String_Duplicates:strippedlist |
Create_and_populate_temporary_file:content |
Create_and_populate_temporary_file:filepath |
Concatenate_Files:filelist |
output_file |
Concatenate_Files:outputfile |
extract_pathway_from_compounds_file:out1 |
Select_only_metabolic_pwy:in1 |
Select_only_metabolic_pwy:out1 |
Flatten_List_2:inputlist |
Coordinations (0)
|  |
Uploader
License
All versions of this Workflow are
licensed under:
Version 2 (latest)
(of 2)
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 (1)
(Workflows/Files)
Favourited By (0)
No one
Statistics
Citations (0)Version History
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
No comments yet
Log in to make a comment