Name |
Type |
Description |
extract_snp_id |
beanshell |
This extracts the contents (snp_ids) of the first column from the input.It is important that the first column contains SNP IDs for this reason. Scriptimport java.util.*;
String [] line = string.split("\t");
out1=line[0].trim(); |
Split_string_into_string_list_by_regular_expression |
localworker |
This service splits the string value into a string list at every occurrence of the specified regular expression. The regular expression provided in this case is a new line: "\n" ScriptList split = new ArrayList();
if (!string.equals("")) {
String regexString = ",";
if (regex != void) {
regexString = regex;
}
String[] result = string.split(regexString);
for (int i = 0; i < result.length; i++) {
split.add(result[i]);
}
}
|
regex_value |
stringconstant |
Value\n |
hsapiens_snp |
biomart |
This is a Biomart service that takes the SNP ID as the input and returns chromosome name, and the position of the SNP. |
Flatten_List |
localworker |
This service flattens the inputlist by one level. It returns the result of the flattening. 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); |
Flatten_List_2 |
localworker |
This service flattens the inputlist by one level. It returns the result of the flattening. 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); |
input_chr_position |
beanshell |
The purpose of this beanshell is to manipulate the start and end positions based on the flanking width provided by the user. Scriptimport java.util.*;
List tmp_end = new ArrayList();
List tmp_start = new ArrayList();
width =Integer.parseInt(in1.get(0));
int out_end=0;
int out_start=0;
for(int i=0; i < in2.size(); i++) {
value_pos = Integer.parseInt(in2.get(i));
out_end = value_pos + width;
out_start = value_pos - width;
tmp_end.add(out_end);
tmp_start.add(out_start);
}
end_out = tmp_end;
start_out = tmp_start;
chr_out = chr_in;
|
hsapiens_gene_ensembl |
biomart |
This is a Biomart service that takes the chromosome name and start and end positions and returns genes (entrez gene id) present in the region. |
align_snp_gene_and_extract_gene_id |
beanshell |
This beanshell aligns the input snp ids with the corresponding genes present in the vicinity. Scriptimport java.util.List;
import java.util.ArrayList;
List tmp = new ArrayList();
String in1Trim = in1.trim();
String out=in1Trim+"\t"+in2;
String [] out_array = out.split("\t");
String gene_out =out_array[out_array.length-1];
int aa = gene_out.indexOf("[");
int bb = gene_out.indexOf("]");
String S1 = gene_out.substring(aa+1,bb);
int cc = bb-aa;
j=0;
i =S1.indexOf(",");
if (i<0 && cc==1){
tmp.add(in1Trim+"\t"+"-1");
}
else if (i<0 && cc>1) {
tmp.add(in1Trim+"\t"+S1);
}
else {
String [] line = S1.split(",");
while(j < line.length) {
tmp.add(in1Trim+"\t"+line[j]);
j++;
}
}
out1=tmp; |
Convert_to_Kegg_id |
beanshell |
The input to btit (which provides gene information from the kegg database) is a Kegg gene id. To convert entrez gene ids to Kegg ids "hsa:" is concatenated to the entrez gene id. Scriptimport java.util.*;
String [] line = string.split("\t");
String gene = line[line.length-1];
String gene1=gene.trim();
if (gene1==-1){
out1="";
}
else {
out1="hsa:"+gene1;
}
|
btit |
wsdl |
The input for this service is Kegg gene id in the form of (for example) hsa:1234. It returns the gene name and definitions of the given entry id. Wsdlhttp://soap.genome.jp/KEGG.wsdlWsdl Operationbtit |
extract_gene_name |
beanshell |
The purpose of this workflow is to extract gene names from the "btit" output. Scriptimport java.util.*;
String [] line = string.split(",");
String ID_Gene = line[0];
int aa = ID_Gene.indexOf(" ");
String gene_noTrim = ID_Gene.substring(aa+1);
String gene = gene_noTrim.trim();
int bb = gene.indexOf(";");
if (bb<0){
out1=gene.trim();
}
else {
String gene1 = gene.substring(0,bb);
out1=gene1.trim();
}
|
align_snp_gene_name |
beanshell |
This beanshell aligns the input snp ids with the corresponding genes (in the form of HGNC names) present in the vicinity. Scriptimport java.util.List;
import java.util.ArrayList;
List tmp = new ArrayList();
String in1Trim = in1.trim();
String out=in1Trim+"\t"+in2;
String [] out_array = out.split("\t");
String gene_out =out_array[out_array.length-1];
int aa = gene_out.indexOf("[");
int bb = gene_out.indexOf("]");
String S1 = gene_out.substring(aa+1,bb);
int cc = bb-aa;
j=0;
i =S1.indexOf(",");
if (i<0 && cc==1){
tmp.add(in1Trim+"\t"+"-1");
}
else if (i<0 && cc>1) {
tmp.add(in1Trim+"\t"+S1);
}
else {
String [] line = S1.split(",");
while(j < line.length) {
tmp.add(in1Trim+"\t"+line[j]);
j++;
}
}
out1=tmp; |
get_pathways_by_genes |
wsdl |
Search all pathways which include all the given genes. Wsdlhttp://soap.genome.jp/KEGG.wsdlWsdl Operationget_pathways_by_genes |
regex_value_1 |
stringconstant |
Value\n |
Split_string_into_string_list_by_regular_expression_2 |
localworker |
This service splits the string value into a string list at every occurrence of the specified regular expression. The regular expression provided in this case is a new line: "\n" ScriptList split = new ArrayList();
if (!string.equals("")) {
String regexString = ",";
if (regex != void) {
regexString = regex;
}
String[] result = string.split(regexString);
for (int i = 0; i < result.length; i++) {
split.add(result[i]);
}
}
|
Flatten_List_3 |
localworker |
This service flattens the inputlist by one level. It returns the result of the flattening. 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); |
Flatten_List_6 |
localworker |
This service flattens the inputlist by one level. It returns the result of the flattening. 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); |
btit_2_2 |
wsdl |
Retrieve definitions of given pathways on the Kegg pathway database. Wsdlhttp://soap.genome.jp/KEGG.wsdlWsdl Operationbtit |
align_snp_gene_name_pwy_ids_2 |
beanshell |
This beanshell aligns the input snp ids with the corresponding genes (in the form of HGNC names) present in the vicinity and the pathways that these genes participates in. Scriptimport java.util.List;
import java.util.ArrayList;
List tmp = new ArrayList();
String in1Trim = in1.trim();
String out=in1Trim+"\t"+in2;
String [] out_array = out.split("\t");
String gene_out =out_array[out_array.length-1];
int aa = gene_out.indexOf("[");
int bb = gene_out.indexOf("]");
String S1 = gene_out.substring(aa+1,bb);
int cc = bb-aa;
j=0;
i =S1.indexOf(",");
if (i<0 && cc==1){
tmp.add(in1Trim+"\t"+"-1");
}
else if (i<0 && cc>1) {
tmp.add(in1Trim+"\t"+S1);
}
else {
String [] line = S1.split(",");
while(j < line.length) {
tmp.add(in1Trim+"\t"+line[j]);
j++;
}
}
out1=tmp; |
Flatten_List_5_2 |
localworker |
This service flattens the inputlist by one level. It returns the result of the flattening. 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); |
Create_and_populate_temporary_file_2 |
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_2 |
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();
}
|
Read_Text_File |
localworker |
This service reads the text file at the specified file path or URL and returns the file's content. ScriptBufferedReader getReader (String fileUrl, String encoding) throws IOException {
InputStreamReader reader;
try {
if (encoding == null) {
reader = new FileReader(fileUrl);
} else {
reader = new InputStreamReader(new FileInputStream(fileUrl),encoding);
}
}
catch (FileNotFoundException e) {
// try a real URL instead
URL url = new URL(fileUrl);
if (encoding == null) {
reader = new InputStreamReader (url.openStream());
} else {
reader = new InputStreamReader (url.openStream(), encoding);
}
}
return new BufferedReader(reader);
}
StringBuffer sb = new StringBuffer(4000);
if (encoding == void) {
encoding = null;
}
BufferedReader in = getReader(fileurl, encoding);
String str;
String lineEnding = System.getProperty("line.separator");
while ((str = in.readLine()) != null) {
sb.append(str);
sb.append(lineEnding);
}
in.close();
filecontents = sb.toString();
|
Comments (1)
Log in to make a comment
Beautifully annotated and runs without problems with its example inputs on Taverna 2.4 (14 september 2012).