#################################################################################
# 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
}
return res;
}
+
/*
* getting whole protein sequence from the db ProteinRow
*/
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;
}
return query;
}
+ /*
+ * query: jobs and sequence at date
+ */
+ public List<DataBase> 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<Pair<String, String>> res = db.ReadProteinData(day);
+ if (res == null)
+ return null;
+ query = new ArrayList<DataBase>();
+ for (Pair<String, String> 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<DataBase> readProteins(String protIn, String flag) {
- if (protIn == null)
- return null;
- System.out.println(protIn.length());
query = new ArrayList<DataBase>();
List<AnnotatedProteinSequenceBean> 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) {
}
return query;
}
+
/*
* query protein sequences with number of jobs