From: Sasha Sherstnev Date: Mon, 25 Nov 2013 11:04:31 +0000 (+0000) Subject: Merge branch 'servlets' X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=92420f700bca908529b5dc0e0e998dd2a7f98bc2;p=proteocache.git Merge branch 'servlets' Conflicts: datadb/compbio/cassandra/StructureProteinPrediction.java server/compbio/statistic/CassandraRequester.java --- 92420f700bca908529b5dc0e0e998dd2a7f98bc2 diff --cc datadb/compbio/cassandra/CassandraReader.java index 28641db,b527738..6e3587b --- a/datadb/compbio/cassandra/CassandraReader.java +++ b/datadb/compbio/cassandra/CassandraReader.java @@@ -84,11 -108,15 +108,15 @@@ public class CassandraReader List rows = results.all(); System.out.println("Query time is " + (queryTime - startTime) + " msec"); System.out.println(" rows analysed, " + rows.size()); - List res = new ArrayList(); + List res = new ArrayList(); 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; } diff --cc server/compbio/statistic/CassandraRequester.java index 214bf6f,afba67b..410a722 --- a/server/compbio/statistic/CassandraRequester.java +++ b/server/compbio/statistic/CassandraRequester.java @@@ -161,23 -194,26 +163,26 @@@ public class CassandraRequester * query: protein sequence * */ public List readProteins(String protIn, String flag) { + if (protIn == null) + return null; + System.out.println(protIn.length()); query = new ArrayList(); - List res; + List 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; }