From: Sasha Sherstnev Date: Mon, 25 Nov 2013 11:35:01 +0000 (+0000) Subject: Make all necessary changes for combining old and new servlets X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4458e44cf92e699159ee1257b1bea6300a9abebe;p=proteocache.git Make all necessary changes for combining old and new servlets --- diff --git a/conf/Proteocache.properties b/conf/Proteocache.properties index 5ab8858..b1730f4 100644 --- a/conf/Proteocache.properties +++ b/conf/Proteocache.properties @@ -1,9 +1,8 @@ ################################################################################# # Cassandra host or IP # test server is 10.0.115.190 -#cassandra.host=localhost -#cassandra.host=10.31.0.97 cassandra.host=localhost +#cassandra.host=gjb-www-1.cluster.lifesci.dundee.ac.uk cassandra.newtables.update=false diff --git a/datadb/compbio/cassandra/CassandraReader.java b/datadb/compbio/cassandra/CassandraReader.java index 6e3587b..cb2492e 100644 --- a/datadb/compbio/cassandra/CassandraReader.java +++ b/datadb/compbio/cassandra/CassandraReader.java @@ -94,6 +94,7 @@ public class CassandraReader { } return res; } + /* * getting whole protein sequence from the db ProteinRow */ @@ -113,10 +114,6 @@ public class CassandraReader { for (Row r : rows) { 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 --git a/server/compbio/statistic/CassandraRequester.java b/server/compbio/statistic/CassandraRequester.java index 410a722..72ec074 100755 --- a/server/compbio/statistic/CassandraRequester.java +++ b/server/compbio/statistic/CassandraRequester.java @@ -159,19 +159,49 @@ public class CassandraRequester { return query; } + /* + * query: jobs and sequence at date + */ + public List readJobByDay (String date) { + System.out.println(date); + if (null == date) { + return null; + } + if (!isThisDateValid(date, formatDDMMYY)) { + System.out.println("Wrong date: point 3"); + return null; + } + SetDateRange(); + long day = DateParsing(date, formatDDMMYY); + System.out.println(day); + if (day < earlestDate || day > currentDate) + return null; + List> res = db.ReadProteinData(day); + if (res == null) + return null; + query = new ArrayList(); + for (Pair entry : res) { + DataBase bean = new DataBase(); + bean.setDate(date); + bean.setId(entry.getElement0()); + bean.setProt(entry.getElement1()); + query.add(bean); + } + System.out.println("StatisticsProt.readLength: total number of dates = " + query.size()); + return query; + } + + /* * 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; if (flag.equals("whole")) res = db.ReadWholeSequence(protIn); else - res = (protIn.length() > 0) ? db.ReadPartOfSequence(protIn) : null; + res = db.ReadPartOfSequence(protIn); if (res == null) return null; for (AnnotatedProteinSequenceBean entry : res) { @@ -186,6 +216,7 @@ public class CassandraRequester { } return query; } + /* * query protein sequences with number of jobs