package impl.Blast;
import Sight.Agents.*;
import Sight.Agents.Variants.*;
import Sight.Structures.*;
import Sight.dds.*;
import java.io.*;
import Sight.Agents.util.*;
public class blastN_ncbi extends Sight.Agents.Variants.sBlaster implements Serializable {
public class Request extends sBlaster.Request implements java.io.Serializable {
public String Query;
public String Query_from="";
public String Query_to="";
public String Database="nr";
public String Filter="F";
public String Lcase_mask="F";
public String Expect="10";
public String Word_size="11";
public String Other_advanced="";
public String Expect_low="";
public String Expect_high ="";
public Sight.Agents.Request submit() { return Sight.Agents.Request.submit(Public, this, getKey()); };
public Sight.Agents.Request submit(String key)
{ return Sight.Agents.Request.submit(Public, this, key); };
};
protected AMap getFormParameters(Object req) {
Request request = (Request) req;
AMap map = new AMap();
map.add("connect:url", "http://www.ncbi.nlm.nih.gov/blast/Blast.cgi"); map.add("connect:action", "POST"); map.add("connect:master", "http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?CMD=Web&LAYOUT=TwoWindows&AUTO_FORMAT=Semiauto&ALIGNMENTS=50&ALIGNMENT_VIEW=Pairwise&CLIENT=web&DATABASE=nr&DESCRIPTIONS=100&ENTREZ_QUERY=(none)&EXPECT=10&FILTER=L&FORMAT_OBJECT=Alignment&FORMAT_TYPE=HTML&HITLIST_SIZE=100&NCBI_GI=on&PAGE=Nucleotides&PROGRAM=blastn&SERVICE=plain&SET_DEFAULTS.x=34&SET_DEFAULTS.y=8&SHOW_OVERVIEW=on&END_OF_HTTPGET=Yes&SHOW_LINKOUT=yes"); map.add("QUERY", request.Query); map.add("QUERY_FROM", request.Query_from); map.add("QUERY_TO", request.Query_to); map.add("DATABASE", request.Database); map.add("ENTREZ_QUERY", "(none)"); map.add("FILTER", request.Filter); map.add("LCASE_MASK", request.Lcase_mask); map.add("EXPECT", request.Expect); map.add("WORD_SIZE", request.Word_size); map.add("OTHER_ADVANCED", request.Other_advanced); map.add("FORMAT_OBJECT", "Alignment"); map.add("FORMAT_TYPE", "XML"); map.add("DESCRIPTIONS", request.Descriptions); map.add("ALIGNMENTS", "0"); map.add("FORMAT_ENTREZ_QUERY", "(none)"); map.add("EXPECT_LOW", request.Expect_low); map.add("EXPECT_HIGH", request.Expect_high); map.add("PROGRAM", "blastn"); map.add("SET_DEFAULTS", "Yes"); map.add("CLIENT", "web"); map.add("SERVICE", "plain"); map.add("PAGE", "Nucleotides"); map.add("CMD", "Put"); return map; };
public static Request getDefaultRequest() {
return Public.getRequest(); }
private Request getRequest() { return new Request(); };
public dStructure getRequestDds() {
return new Sight.dds.Records(false,
new dField[] {
new dField("Query","CharSequence","Nucleotide sequence",""),
new dField("Query_from","CharSequence","Subsection, from",""),
new dField("Query_to","CharSequence","Subsection, to",""),
new dField("Database","CharSequence","database","nr",new String[] {"nr","est","est_human","est_mouse",
"est_others","gss","htgs","pat","yeast","mito","vector","ecoli","pdb","month","alu","dbsts",
"chromosome","wgs_anopheles","Drosophila genome"}),
new dField("Descriptions","CharSequence","Descriptions","100"),
new dField("Filter","CharSequence","Filtering on/off","F"),
new dField("Lcase_mask","CharSequence","ignore regions that are in lowercase","F"),
new dField("Expect","CharSequence","Expected E value","10"),
new dField("Word_size","CharSequence","Word size, do not specify other than 7,11 or 15 - other values not supported by server","11",new String[] {"7","11","15"}),
new dField("Other_advanced","CharSequence","Other advanced BLAST options",""),
new dField("Expect_low","CharSequence","Expected low E value",""),
new dField("Expect_high","CharSequence","Expected high E value","") }
);
}
public static blastN_ncbi Public = new blastN_ncbi();
public static Agent getAvailableAgent() { return Public; };
public static void main(String[] args) {
Sight.Agents.util.Pind.showConsoles();
try {
Request request = getDefaultRequest();
request. Query="GGTGACAACGTTTGGAAGGGCCAGGGCGACCGGCAGTGTGCACAGGGACTGTGTCGGGCTTGGACCTCACCTGATCCTCTCTCTTAGCGC"+
"GACCCTTCCTCTGCTCCCTGTCTCCTCTTTCTGCCACTTGTGCGCTGCTTCCGCGCACTCCCGGCTCCCTAGCGGCAGGAGGAGGAAGGCGCACAGCGGGTGGAG"+
"AGGGTGCGCCAAGGAGAGGTAACCCCTTCGGGAGCCCGGGGAATCCCGGCCGCCACCAGGGGCCGTGCCACCGCCCTCGCGGGACCAAAGCTTCCGGCGTGTCCCC"+
"AACTTTGTGGCGCCCTCAGGCCGCGG";
Sight.Agents.Request submission = request.submit();
Result response = (Result) submission.getResult();
System.out.println(response.getReport(2));
} catch (Exception exc)
{ if (exc!=null) System.out.println(exc.getMessage());
exc.printStackTrace();
};
}
;
}