package impl.protein_analysers;
import Sight.Agents.*;
import Sight.Agents.Redirectors.*;
import Sight.Structures.*;
import Sight.dds.*;
import Sight.tools.xSignature.*;
import java.io.*;
import Sight.Agents.util.*;
public class Myristoylation extends Sight.Agents.Prototypes.signatureBasedAgent implements Serializable {
public class Request extends Sight.Request implements java.io.Serializable {
public String Lset="1";
public String Cleavage="3"; public String Sequence;
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://mendel.imp.univie.ac.at/myristate/cgi-bin/myr_pred.cgi"); map.add("connect:action", "POST"); map.add("connect:master", "http://mendel.imp.univie.ac.at/myristate/SUPLpredictor.htm"); map.add("LSet", request.Lset); map.add("Cleavage", request.Cleavage); map.add("Sequence", request.Sequence); 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("Lset","CharSequence","1 - Eukaryota, 2 - Fungi","1"),
new dField("Cleavage","CharSequence","3 - internal Gly, 4 - only terminal Gly","3"),
new dField("Sequence","CharSequence",null,"") }
);
}
public static class Record extends Sight.Record implements Serializable {
public CharSequence Prediction;
};
public static class Result extends Sight.Result implements Serializable {
public Record[] a;
public CharSequence getReportForRecord(Object ro, int level)
{ Record r = (Record) ro;
switch (level) {
case 0: return ""+r.Prediction+" ";
case 1: return ""+r.Prediction+" ";
default: return ""+" : "+r.Prediction+" ";
}
};
}
public dStructure getResultDds() {
return new Sight.dds.Records(true,
new dField[] {
new dField("Prediction","CharSequence",null,"") }
);
}
public Sight.Record createRecord(String[] row) throws Exception
{ return fillRecord(row); };
public Class getRecordClass() { return Record.class; };
Record fillRecord(String[] fields) throws Exception {
Record r = new Record();
r.Prediction=fields[0].toLowerCase();
return r;
};
public Sight.Result resultFromString(String html) throws Exception {
Result r = new Result();
r.a = (Record[]) createResultArray(html);
return r;
};
public Myristoylation() { signatures = new multiSignatures();
signatures.far_start="Your query";
signatures.top="<FONT FACE=\"ARIAL\">";
signatures.bottom=null;
signatures.signatures =
new Signature[] {
new Signature(">\'","\'<")
};
setDescription("Prediction of N-terminal N-myristoylation");
setFormURL("http://mendel.imp.univie.ac.at/myristate/cgi-bin/myr_pred.cgi");
setMasterURL("http://mendel.imp.univie.ac.at/myristate/SUPLpredictor.htm");
preScan = new preScan();
};
public static Myristoylation Public = new Myristoylation();
public static Agent getAvailableAgent() { return Public; };
public static void main(String[] args) {
Sight.Agents.util.Pind.showConsoles();
try {
Request request = getDefaultRequest();
request. Sequence="MGNIFSSMFD KLWGSNKELR ILILGLDGAG KTTILYRLQI GEVVTTKPTI GFNVETLSYK"+
" NLKLNVWDLG GQTSIRPYWR CYYADTAAVI FVVDSTDKDR MSTASKELHL MLQEEELQDA"+
" ALLVFANKQD QPGALSASEV SKELNLVELK DRSWSIVASS AIKGEGITEG LDWLIDVIKE"+
" EQL";
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();
};
}
;
}