Name |
Type |
Description |
Make_query_for_searching_against_DDBJ_by_human_gene_name |
beanshell |
ScriptString baseUrl = "http://xml.nig.ac.jp/rest/Invoke";
String service = "ARSA";
String method = "searchByXMLPath";
String count = "100";
String offset = "1";
String encode = "UTF8";
String queryPath = "/ENTRY/DDBJ/division=='HUM' AND (/ENTRY/DDBJ/length>=300 AND /ENTRY/DDBJ/length<=1000) "
+ "AND (/ENTRY/DDBJ/feature-table/feature{/f_key = 'CDS' AND "
+ "/f_quals/qualifier{/q_name = 'gene' AND /q_value=='"
+ geneName
+ "'}})";
String returnPath = "/ENTRY/DDBJ/primary-accession";
//make url
String url = baseUrl + "?" + "queryPath=" + URLEncoder.encode(queryPath, encode)
+ "&returnPath=" + URLEncoder.encode(returnPath, encode)
+ "&service=" + URLEncoder.encode(service, encode)
+ "&method=" + URLEncoder.encode(method, encode)
+ "&count=" + URLEncoder.encode(count, encode)
+ "&offset="+ URLEncoder.encode(offset, encode);
|
Get_DDBJ_list_by_ARSA_searchByXMLPath |
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();
|
Split_string_DDBJ_list_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 |
Get_representative_accession |
beanshell |
ScriptString repAccession = (String)arsaResultLines.get(2);
|
Make_query_for_retrieving_sequence |
beanshell |
ScriptString baseUrl = "http://xml.nig.ac.jp/rest/Invoke";
String service = "GetEntry";
String method = "getFASTA_DDBJEntry";
String url = baseUrl
+"?service=" + service
+"&method=" + method
+"&accession=" + accession; |
Get_first_DNA_sequence_by_GetEntry_getFASTA_DDBJEntry |
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 |
beanshell |
ScriptString service = "Blast";
String method = "searchParam";
String program = "blastn";
String encode = "UTF8";
String query = "service=" + service
+"&method=" + method
+"&program=" + program
+"&database=" + URLEncoder.encode(database,encode)
+"&query=" + URLEncoder.encode(dnaSeq,encode)
+"¶m=" + URLEncoder.encode(param,encode);
|
Execute_BLAST |
beanshell |
ScriptURL url = new URL("http://xml.nig.ac.jp/rest/Invoke");
URLConnection urlc = url.openConnection();
urlc.setDoOutput(true);
urlc.setAllowUserInteraction(false);
PrintStream ps = new PrintStream(urlc.getOutputStream());
ps.print(query);
ps.close();
BufferedReader br = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
StringBuffer sb = new StringBuffer();
String line = null;
while ((line = br.readLine()) != null) {
sb.append(line + "\n");
}
String contents = sb.toString();
br.close(); |
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]);
}
}
|
Get_accession_and_similarity_score_form_BLAST_result |
beanshell |
Script//extract accession number and similariy from blast result.
ArrayList parsedBlastResult = new ArrayList();
for (int i = 0; i < lines.size(); i++) {
String[] cols = lines.get(i).toString().split("\t");
String accession = (String)cols[1].substring(0, cols[1].indexOf("|"));
String[] accessionAndSimilarity = { accession, cols[2] };
parsedBlastResult.add(accessionAndSimilarity);
}
result = parsedBlastResult.toArray(); |
Make_query_for_retrieving_species_name |
beanshell |
ScriptString baseUrl = "http://xml.nig.ac.jp/rest/Invoke";
String service = "ARSA";
String method = "searchByXMLPath";
String count = "100";
String offset = "1";
String encode = "UTF8";
String queryPath = "/ENTRY/DDBJ/primary-accession=='" + blastResult.get(0) + "'";
String returnPath = "/ENTRY/DDBJ/organism";
//make url
String url = baseUrl + "?" + "queryPath=" + URLEncoder.encode(queryPath, encode)
+ "&returnPath=" + URLEncoder.encode(returnPath, encode)
+ "&service=" + URLEncoder.encode(service, encode)
+ "&method=" + URLEncoder.encode(method, encode)
+ "&count=" + URLEncoder.encode(count, encode)
+ "&offset="+ URLEncoder.encode(offset, encode);
|
Print_Result |
beanshell |
ScriptHashtable organismAccession = new Hashtable();
for (int i = 0; i < organismNameResult.size(); i++) {
String[] organismLines = organismNameResult.get(i).split("\n");
String organism = organismLines[2];
if (!organismAccession.containsKey(organism)) {
organismAccession.put(organism, accessionAndSimilarity.get(i).get(0) + "\t" + accessionAndSimilarity.get(i).get(1));
}
}
String[] keys = new String[organismAccession.size()];
Enumeration enu = organismAccession.keys();
int count = 0;
while (enu.hasMoreElements()) {
keys[count] = (String) enu.nextElement();
count++;
}
Arrays.sort(keys);
StringBuffer sb = new StringBuffer();
sb.append("DDBJ entries:\t" + arsaResultNum + "\n");
sb.append("Representative accession:\t" + representiveAccession + "\n");
sb.append("Organism name\tDDBJ accession number\tSequence similarity \n");
for (int i = 0; i < keys.length; i++) {
sb.append(keys[i] + "\t" + (String)organismAccession.get(keys[i]) + "\n");
}
result = sb.toString(); |
Get_species_name_by_ARSA_searchByXMLPath |
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();
|
database |
stringconstant |
Valueddbjpri ddbjrod ddbjmam ddbjvrt ddbjinv |
param |
stringconstant |
Value-m 8 -b 50 -v 50 -e 0.0001 |
Get_hit_count |
beanshell |
ScripthitCount = (String)arsaResultLines.get(0).replaceAll("hitscount =", "").trim();
|
Comments (0)
No comments yet
Log in to make a comment