List<Row> rows = results.all();
System.out.println("Query time is " + (queryTime - startTime) + " msec");
System.out.println(" rows analysed, " + rows.size());
- List<StructureProteinPrediction> res = new ArrayList<StructureProteinPrediction>();
+ List<AnnotatedProteinSequenceBean> res = new ArrayList<AnnotatedProteinSequenceBean>();
int c = 0;
for (Row r : rows) {
- StructureProteinPrediction structure = new StructureProteinPrediction(queryProtein, r.getString("JobID"), r.getMap(
+ AnnotatedProteinSequenceBean structure = new AnnotatedProteinSequenceBean(queryProtein, r.getString("JobID"), r.getMap(
"Predictions", String.class, String.class));
+ if (structure.getPrediction().containsKey("jnetpred"))
+ structure.setJnetpred(structure.getPrediction().get("jnetpred"));
+ else
+ structure.setJnetpred("");
res.add(structure);
++c;
}
* query: protein sequence
* */
public List<DataBase> readProteins(String protIn, String flag) {
+ if (protIn == null)
+ return null;
+ System.out.println(protIn.length());
query = new ArrayList<DataBase>();
- List<StructureProteinPrediction> res;
+ List<AnnotatedProteinSequenceBean> res;
if (flag.equals("whole"))
res = db.ReadWholeSequence(protIn);
else
- res = db.ReadPartOfSequence(protIn);
+ res = (protIn.length() > 0) ? db.ReadPartOfSequence(protIn) : null;
if (res == null)
return null;
- for (StructureProteinPrediction entry : res) {
- DataBase bean = new DataBase();
- bean.setProt(entry.getSequence());
- bean.setId(entry.getJobid());
- bean.setJpred(entry.getJnetpred());
- if (flag.equals("part"))
- bean.setSubProt(CreateSubprot (entry.getSequence(), protIn));
- query.add(bean);
-
+ for (AnnotatedProteinSequenceBean entry : res) {
+ DataBase db = new DataBase();
+ db.setProt(entry.getSequence());
+ db.setPredictions(entry);
+ db.setId(entry.getJobid());
+ if (flag.equals("part")) {
+ db.setSubProt(CreateSubprot (entry.getSequence(), protIn));
+ }
+ query.add(db);
}
return query;
}