BLAST-ClustalW workflow
Created: 2010-05-13 02:11:12
Last updated: 2010-05-13 02:12:28
Execute blastn against DDBJ database with a given DNA sequence and compare the alignment regions of high similar sequences by using ClustalW.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (2)
Titles (2)
REST access of xml.nig.ac.jp |
Blast-ClustalW workflow |
Descriptions (2)
|
See http://xml.nig.ac.jp/tutorial/rest/index.html and http://xml.nig.ac.jp/index.html#services
This workflow has a beanshell script for composing the REST URL for the service at xml.nig.ac.jp.
The example invokes the getDDBJEntry(accession) method of the getEntry service at http://xml.nig.ac.jp/wabi/Method?serviceName=GetEntry&mode=methodList&lang=en - but the workflow can be modified to invoke any other service from http://xml.nig.ac.jp/index.html#services by modifying the "service" and "method" parameters to compose_URL.
Any other input parameters to compose_URL are added to the URL as well, so if instead you want to invoke the method "analyzeParamAsync(query, param)" from the "ClustalW" service, first modify the "service" and "method" default parameters to "ClustalW" and "analyzeParamAsync", and then edit the beanshell script's input ports: Remove the "accession" port from compose_URL, then add "query" and "param". You don't need to modify the actual beanshell script as it picks up any declared input parameters.
This pattern could probably be used for many REST services that work like xml.nig.ac.jp - but the disadvantage is that one has to manually read the documentations to figure out what the parameters are to be. |
Dependencies (0)
Inputs (1)
Name |
Description |
16S_rRNA |
|
Processors (11)
Name |
Type |
Description |
Get_BLAST_result_by_Blast_searchParam |
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();
|
Make_query_for_BLAST_against_DDBJ_bacteria_division |
beanshell |
ScriptString baseUrl = "http://xml.nig.ac.jp/rest/Invoke";
String service = "Blast";
String method = "searchParam";
String program = "blastn";
String encode = "UTF8";
String url = baseUrl +"?service=" + service
+"&method=" + method
+"&program=" + program
+"&database=" + URLEncoder.encode(database,encode)
+"&query=" + URLEncoder.encode(query,encode)
+"¶m=" + URLEncoder.encode(param,encode);
|
Split_string_BLAST_result_by_enter |
localworker |
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]);
}
}
|
Split_string_enter |
stringconstant |
Value\n |
database |
stringconstant |
Valueddbjbct |
Parse_BLAST_result |
beanshell |
ScriptList accessionlist = new ArrayList();
List startList = new ArrayList();
List endList = new ArrayList();
int count=0;
for(Iterator i = blastresult.iterator(); i.hasNext();) {
String[] line=((String)i.next()).split("\t");
String accession = line[1].substring(0,line[1].indexOf('|'));
if(accessionlist.contains(accession)){
continue;
}
accessionlist.add(accession);
startList.add(line[8]);
endList.add(line[9]);
count++;
if(count>=10) {
break;
}
}
|
Make_query_for_retrieving_flatfile |
beanshell |
ScriptList url = new ArrayList();
String service = "GetEntry";
String method = "getDDBJEntry";
String baseUrl = "http://xml.ddbj.nig.ac.jp/rest/Invoke?";
baseUrl += "service=" + service
+"&method=" + method
+"&accession=";
for(Iterator i = accession.iterator(); i.hasNext();) {
url.add(baseUrl+(String)i.next());
}
|
Get_aligned_sequences_of_subject_entries_by_GetEntry_getDDBJEntry |
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();
|
Extract_aligned_dna_sequences_from_previous_entry |
beanshell |
ScriptString entry = "";
for(int i=0; i end){
dna = dnaBuf.subSequence(end, start);
}else{
dna = dnaBuf.subSequence(start, end);
}
entry += ">" + accession + "|" + org + "\n" + dna + "\n";
} |
Execute_ClustalW |
beanshell |
ScriptString output = "";
String encode = "UTF8";
String tmpQuery = URLEncoder.encode(query+"\n"+entry,encode);
String baseQuery = "service=ClustalW&method=analyzeSimple&query=" + tmpQuery;
String baseUrl = "http://xml.nig.ac.jp/rest/Invoke";
URL url = new URL(baseUrl);
URLConnection urlc = url.openConnection();
urlc.setDoOutput(true);
urlc.setAllowUserInteraction(false);
PrintStream ps = new PrintStream(urlc.getOutputStream());
ps.print(baseQuery);
ps.close();
br = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
StringBuffer sb = new StringBuffer();
String line = null;
while ((line = br.readLine()) != null) {
sb.append(line + "\n");
}
output = sb.toString().trim();
br.close(); |
param |
stringconstant |
Value-F F -e 0.001 -m 8 |
Beanshells (5)
Name |
Description |
Inputs |
Outputs |
Make_query_for_BLAST_against_DDBJ_bacteria_division |
|
database
query
param
|
url
|
Parse_BLAST_result |
|
blastresult
|
accessionlist
startList
endList
|
Make_query_for_retrieving_flatfile |
|
accession
|
url
|
Extract_aligned_dna_sequences_from_previous_entry |
|
entryList
startList
endList
|
entry
|
Execute_ClustalW |
|
entry
query
|
output
|
Datalinks (15)
Source |
Sink |
Make_query_for_BLAST_against_DDBJ_bacteria_division:url |
Get_BLAST_result_by_Blast_searchParam:url |
database:value |
Make_query_for_BLAST_against_DDBJ_bacteria_division:database |
param:value |
Make_query_for_BLAST_against_DDBJ_bacteria_division:param |
16S_rRNA |
Make_query_for_BLAST_against_DDBJ_bacteria_division:query |
Split_string_enter:value |
Split_string_BLAST_result_by_enter:regex |
Get_BLAST_result_by_Blast_searchParam:contents |
Split_string_BLAST_result_by_enter:string |
Split_string_BLAST_result_by_enter:split |
Parse_BLAST_result:blastresult |
Parse_BLAST_result:accessionlist |
Make_query_for_retrieving_flatfile:accession |
Make_query_for_retrieving_flatfile:url |
Get_aligned_sequences_of_subject_entries_by_GetEntry_getDDBJEntry:url |
Get_aligned_sequences_of_subject_entries_by_GetEntry_getDDBJEntry:contents |
Extract_aligned_dna_sequences_from_previous_entry:entryList |
Parse_BLAST_result:endList |
Extract_aligned_dna_sequences_from_previous_entry:endList |
Parse_BLAST_result:startList |
Extract_aligned_dna_sequences_from_previous_entry:startList |
Extract_aligned_dna_sequences_from_previous_entry:entry |
Execute_ClustalW:entry |
16S_rRNA |
Execute_ClustalW:query |
Execute_ClustalW:output |
Result |
Coordinations (2)
Controller |
Target |
Get_aligned_sequences_of_subject_entries_by_GetEntry_getDDBJEntry |
Extract_aligned_dna_sequences_from_previous_entry |
Extract_aligned_dna_sequences_from_previous_entry |
Execute_ClustalW |
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