This workflow combines the blat and blast workflows. It takes as input a database name (Danio_rerio_Genome for Zebra Fish for example) and and a set of Fasta sequences. It first tries to perform a blat (at www.bioinformatics.nl). When this service returns nothing, a blast is done (also at www.bioinformatics.nl). The resulting reports are combined.
outputList = new ArrayList();
outputList.addAll(list1);
outputList.addAll(list2);
list1
list2
outputList
isEmpty = new Boolean(string.length() == 0).toString();
string
isEmpty
org.embl.ebi.escience.scuflworkers.java.FailIfTrue
list = new ArrayList();
list
org.embl.ebi.escience.scuflworkers.java.FailIfFalse
StringBuffer buffer = new StringBuffer();
for(String blatLine : blatResult){
buffer.append(blatLine);
}
blatReport = buffer.toString();
// create reader for sequence list
BufferedReader reader = new BufferedReader(new StringReader(sequences));
StringBuffer blastSequences = new StringBuffer();
// filter sequences
ArrayList sequences = new ArrayList();
String line;
while((line = reader.readLine()) != null){
if(line.startsWith(">")){
String sequenceId = line.substring(1).trim();
// if sequenceId is not in blat report, than it should be blasted
if(blatReport.indexOf(sequenceId) < 0){
blastSequences.append(line).append("\n").append(reader.readLine()).append("\n");
}
}
}
sequencesForBlast = blastSequences.toString();
sequences
blatResult
sequencesForBlast
This workflow invokes the blast service provided at www.bioinformatics.nl, written by Pieter Neerincx. The workflow takes as input a database name (Danio_rerio_Genome for Zebra Fish for example) and a set of sequences in fasta format.
The blast service is invoked (using polling) and the result is a tab separated blast report.
This workflow invokes the blast service provided at www.bioinformatics.nl, written by Pieter Neerincx. The workflow takes as input a database name (Danio_rerio_Genome for Zebra Fish for example) and a set of sequences in fasta format.
The blast service is invoked (using polling) and the result is a tab separated blast report.
This Beanshell downloads a file to disk. The standard download local Java widgets don't handle URLs with HTTP(S) Basic Authentication, but this Beanshell can. When a webserver uses BasicAuth, a login and password can be coded as part of the URL using the following syntax: http(s)://login:password@www.some.website/my/great/tool/result.xml. This beanshel extracts the login and password from the URL and supplies them automatically to the webserver. This prevents Taverna from showing popup dialogs requesting the login and password from the user as this will be problematic for large workflows.
Please note that the path where the downloaded file will be stored must be an absolute path to a folder ended with a slash. (Slash backward on Windows or a slash forward on Linux/Unix/Mac OS X.) The filename for the result is automatically extracted from the URL.
//
// Import modules;
//
import java.io.*;
import java.net.*;
import java.util.regex.*;
// Connect to URL.
URL oURL = new URL(theURL);
URLConnection oURLConnection = oURL.openConnection();
// Check if we are are dealing with a site
// that uses basic http(s) authentication.
oPattern = Pattern.compile("(\\w+://)??([^:]+):([^:@]+)@.*");
oMatcher = oPattern.matcher(oURL.toString());
vHit = oMatcher.matches();
if (vHit) {
//String vProtocol = oMatcher.group(1);
String vUser = oMatcher.group(2);
String vPass = oMatcher.group(3);
String vAuth = vUser + ":" + vPass;
String vEncodedUserPassword = new sun.misc.BASE64Encoder().encode(vAuth.getBytes());
oURLConnection.setRequestProperty ("Authorization", "Basic " + vEncodedUserPassword);
}
InputStream inputStream = oURLConnection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
blastResults = new ArrayList();
String line;
while((line = reader.readLine()) != null){
blastResults.add("!BLAST!" + line);
}
reader.close();
theURL
blastResults
org.embl.ebi.escience.scuflworkers.java.StringListMerge
Submit a BLAST Job and retrieve a Job ID. Use this Job ID with the MobyBlast_poll service from the same service provider to check the status of your job.Use this Job ID with the MobyBlast_retrieve service from the same service provider to fetch the results.
http://moby.ucalgary.ca/moby/MOBY-Central.pl
MobyBlast_submit
www.bioinformatics.nl
0
T
F
T
0
500
0.00015
0
1
-3
250
F
0
0
F
T
0
1
1
BLOSUM62
0
0
0
F
0
0
8
0
0
0
0
3
A generic user object.
www.bioinformatics.nl
client
user
http://moby.ucalgary.ca/moby/MOBY-Central.pl
User
A BLAST job.
http://moby.ucalgary.ca/moby/MOBY-Central.pl
BlastJob
a string
fasta
http://moby.ucalgary.ca/moby/MOBY-Central.pl
String
A generic password object.
www.bioinformatics.nl
testing
password
http://moby.ucalgary.ca/moby/MOBY-Central.pl
Password
An e-mail address object.
www.bioinformatics.nl
some.user@domain.nl
email
http://moby.ucalgary.ca/moby/MOBY-Central.pl
Email
A generic program object.
blast
blastn
program
http://moby.ucalgary.ca/moby/MOBY-Central.pl
Program
A database object.
blast
database
http://moby.ucalgary.ca/moby/MOBY-Central.pl
DataBase
FASTA formatted sequence
1
http://moby.ucalgary.ca/moby/MOBY-Central.pl
FASTA
Processor to parse the datatype URL
http://moby.ucalgary.ca/moby/MOBY-Central.pl
URL
result
Processor to parse the datatype URL
org.embl.ebi.escience.scuflworkers.java.StringListMerge
org.embl.ebi.escience.scuflworkers.java.FailIfTrue
outputXML = inputXML.replace("<Object articleName=\"\"", "<Object articleName=\"job_id\"");
inputXML
outputXML
//moby:Simple/*/@id
net.sourceforge.taverna.scuflworkers.xml.XPathTextWorker
// if status is "r", than is running, "f" is finished
isRunning = new Boolean(status.equals("r")).toString();
status
isRunning
Processor to parse the datatype Object
http://moby.ucalgary.ca/moby/MOBY-Central.pl
Object
status
Processor to parse the datatype Object
Submit the result of the MobyBlast_submit service and obtain status info for the job.
http://moby.ucalgary.ca/moby/MOBY-Central.pl
MobyBlast_poll
www.bioinformatics.nl
an object
www.bioinformatics.nl
job_id
http://moby.ucalgary.ca/moby/MOBY-Central.pl
Object
Sequences in fasta format
Database name (Danio_rerio_Genome for Zebra Fish)
Completed
Poll_Job
DownloadURLWithBasicAuth
Scheduled
Running
The blat workflow invokes the blat services provided at www.bioinformatics.nl (author Pieter Neerincx).
As input, it takes a database name (for example, Danio_rerio_Genome for Zebra Fish) and one or more sequences in Fasta format. The output will be a tab separated output of the blat. An eValue string constant is added to filter on the e-Value.
Note, the e-Value is not exactly the same as the blast e-Value.
The blat workflow invokes the blat services provided at www.bioinformatics.nl (author Pieter Neerincx).
As input, it takes a database name (for example, Danio_rerio_Genome for Zebra Fish) and one or more sequences in Fasta format. The output will be a tab separated output of the blat. An eValue string constant is added to filter on the e-Value.
Note, the e-Value is not exactly the same as the blast e-Value.
0.00015
org.embl.ebi.escience.scuflworkers.java.StringListMerge
This Beanshell downloads a file to disk. The standard download local Java widgets don't handle URLs with HTTP(S) Basic Authentication, but this Beanshell can. When a webserver uses BasicAuth, a login and password can be coded as part of the URL using the following syntax: http(s)://login:password@www.some.website/my/great/tool/result.xml. This beanshel extracts the login and password from the URL and supplies them automatically to the webserver. This prevents Taverna from showing popup dialogs requesting the login and password from the user as this will be problematic for large workflows.
Please note that the path where the downloaded file will be stored must be an absolute path to a folder ended with a slash. (Slash backward on Windows or a slash forward on Linux/Unix/Mac OS X.) The filename for the result is automatically extracted from the URL.
//
// Import modules;
//
import java.io.*;
import java.net.*;
import java.util.regex.*;
// Connect to URL.
URL oURL = new URL(URL);
URLConnection oURLConnection = oURL.openConnection();
// Check if we are are dealing with a site
// that uses basic http(s) authentication.
oPattern = Pattern.compile("(\\w+://)??([^:]+):([^:@]+)@.*");
oMatcher = oPattern.matcher(URL);
vHit = oMatcher.matches();
if (vHit) {
//String vProtocol = oMatcher.group(1);
String vUser = oMatcher.group(2);
String vPass = oMatcher.group(3);
String vAuth = vUser + ":" + vPass;
String vEncodedUserPassword = new sun.misc.BASE64Encoder().encode(vAuth.getBytes());
oURLConnection.setRequestProperty ("Authorization", "Basic " + vEncodedUserPassword);
}
// get input stream
InputStream inputStream = oURLConnection.getInputStream();
// download all results and filter
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
List blatResults = new ArrayList();
double ev = Double.parseDouble(eValue);
String line;
while((line = reader.readLine()) != null){
String[] values = line.split("\t");
double currentEValue = Double.parseDouble(values[values.length-2]);
if(currentEValue < ev){
blatResults.add(line);
}
}
reader.close();
URL
eValue
blatResults
BioMOBY web service wrapper for the command line query tool 'BLAT'.
http://moby.ucalgary.ca/moby/MOBY-Central.pl
MobyBlat
www.bioinformatics.nl
blast8
dna
0
0
1000000
Processor to parse the datatype URL
http://moby.ucalgary.ca/moby/MOBY-Central.pl
URL
result
Processor to parse the datatype URL
An e-mail address object.
www.bioinformatics.nl
some.user@domain.nl
email
http://moby.ucalgary.ca/moby/MOBY-Central.pl
Email
A BLAT job.
http://moby.ucalgary.ca/moby/MOBY-Central.pl
BlatJob
A generic user object.
www.bioinformatics.nl
client
user
http://moby.ucalgary.ca/moby/MOBY-Central.pl
User
A generic password object.
www.bioinformatics.nl
testing
password
http://moby.ucalgary.ca/moby/MOBY-Central.pl
Password
a string
fasta
http://moby.ucalgary.ca/moby/MOBY-Central.pl
String
A database object.
blat
dataBase
http://moby.ucalgary.ca/moby/MOBY-Central.pl
DataBase
FASTA formatted sequence
1
http://moby.ucalgary.ca/moby/MOBY-Central.pl
FASTA
Database name (Danio_rerio_Genome for Zebra Fish)
Sequences in fasta format
The name of the database (Danio_rerio_Genome for Zebra Fish)
Fasta sequences
Completed
Fail_if_true
Blast
Scheduled
Running
Completed
Fail_if_false
EmptyList
Scheduled
Running