Compile Protein FASTA from Target to Drug file
Created: 2011-03-30 10:34:37
Last updated: 2011-03-30 10:34:40
Uses a tab-delimited file with protein target and drug information (created in Ondex) to compile a protein FASTA file including each target.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Morgan Taschuk
Andrew Smeaton |
Titles (1)
Compile Protein FASTA from Target to Drug file |
Descriptions (1)
Uses a tab-delimited file with protein target and drug information (created in Ondex) to compile a protein FASTA file including each target. |
Dependencies (0)
Inputs (2)
Name |
Description |
protein_to_drug_file |
The tab-delimited file with a header that shows UniProt identiifers in the first column and DrugBank identifiers in the second.
|
protein_fasta_file |
The location where the FASTA file should be saved on disk.
|
Processors (5)
Name |
Type |
Description |
Uniprot_Splitter |
beanshell |
ScriptString input = protein_to_drug_file;
String [] lines = input.split("\n");
HashSet set = new HashSet();
for (int i = 1; i |
Get_Protein_FASTA |
localworker |
Scriptif ((id == void) || (id == null) || id.equals("")) {
throw new RunTimeException("port id must have a non-empty value");
}
URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&db=protein&retmode=text&id=" + id);
BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
StringWriter writer = new StringWriter();
char[] buffer = new char[1024];
while (true) {
int r = reader.read(buffer);
if (r <= 0) {
break;
}
writer.write(buffer, 0, r);
}
outputText = writer.toString();
|
Append_To_Text_File |
localworker |
ScriptBufferedWriter out = new BufferedWriter(new FileWriter(outputFile,true));
out.write(filecontents);
out.close();
outputFile = filecontents;
|
Read_Text_File |
localworker |
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);
}
StringBuffer sb = new StringBuffer(4000);
BufferedReader in = getReader(fileurl);
String str;
String lineEnding = System.getProperty("line.separator");
while ((str = in.readLine()) != null) {
sb.append(str);
sb.append(lineEnding);
}
in.close();
filecontents = sb.toString();
|
Read_Text_File_2 |
localworker |
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);
}
StringBuffer sb = new StringBuffer(4000);
BufferedReader in = getReader(fileurl);
String str;
String lineEnding = System.getProperty("line.separator");
while ((str = in.readLine()) != null) {
sb.append(str);
sb.append(lineEnding);
}
in.close();
filecontents = sb.toString();
|
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
Uniprot_Splitter |
|
protein_to_drug_file
|
targets
|
Outputs (1)
Name |
Description |
fasta |
The resulting FASTA file with all protein targets
|
Datalinks (7)
Source |
Sink |
Read_Text_File_2:filecontents |
Uniprot_Splitter:protein_to_drug_file |
Uniprot_Splitter:targets |
Get_Protein_FASTA:id |
protein_fasta_file |
Append_To_Text_File:outputFile |
Get_Protein_FASTA:outputText |
Append_To_Text_File:filecontents |
protein_fasta_file |
Read_Text_File:fileurl |
protein_to_drug_file |
Read_Text_File_2:fileurl |
Read_Text_File:filecontents |
fasta |
Coordinations (1)
Controller |
Target |
Append_To_Text_File |
Read_Text_File |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (2)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (1)
(Workflows/Files)
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