Name |
Type |
Description |
Make_query_for_retrieving_hitcount_of_virus_genome_entry_from_DDBJ |
beanshell |
ScriptString baseUrl = "http://xml.nig.ac.jp/rest/Invoke";
String service = "ARSA";
String method = "searchByXMLPath";
String count = "1";
String offset = "1";
String queryPath = "((/ENTRY/DDBJ/division=='PHG' OR /ENTRY/DDBJ/division=='VRL') AND "
+ "(((/ENTRY/DDBJ/definition='segment' AND /ENTRY/DDBJ/definition='complete sequence') OR "
+ "/ENTRY/DDBJ/definition='complete genome')) AND (/ENTRY/DDBJ/definition!='nearly complete' AND "
+ "/ENTRY/DDBJ/definition!='TPA:'))";
String returnPath = "/ENTRY/DDBJ/primary-accession,/ENTRY/DDBJ/definition";
String encode = "UTF8";
String query = 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_HitCount |
beanshell |
Scriptfor (int i = 0; i < arsaResult.size(); i++) {
if (arsaResult.get(i).indexOf("hitscount") >= 0) {
arsaResultNum = arsaResult.get(i).replaceAll("hitscount =", "").trim();
break;
}
}
|
Make_Offsets |
beanshell |
ScriptList offsets = new ArrayList();
int cnt = 1000;
for (int i = 0; i < Integer.parseInt(hitCount)/cnt + 1; i++) {
offsets.add(Integer.toString(i*cnt+1));
}
|
Make_query_for_retrieving_gene_type |
beanshell |
ScriptString baseUrl = "http://xml.nig.ac.jp/rest/Invoke";
String service = "ARSA";
String method = "searchByXMLPath";
String count = "1000";
String queryPath = "((/ENTRY/DDBJ/division=='PHG' OR /ENTRY/DDBJ/division=='VRL') AND "
+ "(((/ENTRY/DDBJ/definition='segment' AND /ENTRY/DDBJ/definition='complete sequence') OR "
+ "/ENTRY/DDBJ/definition='complete genome')) AND (/ENTRY/DDBJ/definition!='nearly complete' AND "
+ "/ENTRY/DDBJ/definition!='TPA:'))";
String returnPath = "/ENTRY/DDBJ/primary-accession,/ENTRY/DDBJ/definition";
String encode= "UTF8";
String query = 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);
List queries = new ArrayList();
for (int i = 0; i < offsets.size(); i++) {
String offset = offsets.get(i);
queries.add(query + "&offset=" + URLEncoder.encode(offset, encode));
}
|
Get_gene_type_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();
|
Print_virus_genome_entries |
beanshell |
ScriptStringBuffer sb = new StringBuffer();
sb.append(arsaResultNum + " entries found\n");
sb.append("accession number\tDefinition\tgenome/segment\n");
for (int i = 0; i < ARSA_results.size(); i++){
String[] split = ARSA_results.get(i).split("\n");
for (int j = 2; j < split.length; j++) {
sb.append(split[j] + "\t");
if (split[j].indexOf("complete genome") != -1) {
sb.append("genome");
}else if (split[j].indexOf("segment") != -1) {
sb.append("segment");
}
sb.append("\n");
}
}
retrieving_virus_entry = sb.toString(); |
Comments (0)
No comments yet
Log in to make a comment