/*
* getting whole protein sequence from the db ProteinRow
*/
- public List<AnnotatedProteinSequenceBean> ReadWholeSequence(String queryProtein) {
+ public List<ProteinBean> ReadWholeSequence(String queryProtein) {
final long startTime = System.currentTimeMillis();
String com = "SELECT JobID, Predictions FROM ProteinRow WHERE Protein = '" + queryProtein + "';";
System.out.println("Command: " + com);
return null;
final long queryTime = System.currentTimeMillis();
List<Row> rows = results.all();
+ System.out.println("first size : " + rows.size());
System.out.println("Query time is " + (queryTime - startTime) + " msec");
System.out.println(" rows analysed, " + rows.size());
- List<AnnotatedProteinSequenceBean> res = new ArrayList<AnnotatedProteinSequenceBean>();
+ List<ProteinBean> res = new ArrayList<ProteinBean>();
+ ProteinBean structure = new ProteinBean(queryProtein, rows.get(0).getMap(
+ "Predictions", String.class, String.class));
+ System.out.println("second size : " + rows.size());
int c = 0;
for (Row r : rows) {
- AnnotatedProteinSequenceBean structure = new AnnotatedProteinSequenceBean(queryProtein, r.getString("JobID"), r.getMap(
- "Predictions", String.class, String.class));
- res.add(structure);
+ structure.setJobid(r.getString("JobID"));
++c;
}
+ res.add(structure);
final long endTime = System.currentTimeMillis();
System.out.println(c + " rows analysed, execution time is " + (endTime - startTime) + " msec");
return res;
/*
* getting part of protein sequence from the db ProteinRow
*/
- public List<AnnotatedProteinSequenceBean> ReadPartOfSequence(String queryProtein) {
+ public List<ProteinBean> ReadPartOfSequence(String queryProtein) {
final long startTime = System.currentTimeMillis();
String com = "SELECT * FROM ProteinRow;";
System.out.println("Command: " + com);
List<Row> rows = results.all();
System.out.println("Query time is " + (queryTime - startTime) + " msec");
System.out.println(" rows analysed, " + rows.size());
- List<AnnotatedProteinSequenceBean> res = new ArrayList<AnnotatedProteinSequenceBean>();
+ List<ProteinBean> res = new ArrayList<ProteinBean>();
int c = 0;
for (Row r : rows) {
String prot = r.getString("Protein");
if (prot.matches("(.*)" + queryProtein + "(.*)")) {
- AnnotatedProteinSequenceBean structure = new AnnotatedProteinSequenceBean(prot, r.getString("JobID"), r.getMap("Predictions",
- String.class, String.class));
+ ProteinBean structure = new ProteinBean(prot, r.getMap("Predictions", String.class, String.class));
+ structure.setJobid(r.getString("JobID"));
res.add(structure);
++c;
}