+ * getting protein sequence from the db ProteinRow
+ */
+ public Map<String, String> ReadProtein() {
+ //final long startTime = System.currentTimeMillis();
+ String com = "SELECT * FROM ProteinRow;";
+ System.out.println("Command: " + com);
+ ResultSet results = session.execute(com);
+ if (results.isExhausted())
+ return null;
+ //final long queryTime = System.currentTimeMillis();
+ List<Row> rows = results.all();
+ Map<String, String> output = new HashMap<String, String>();
+ for (Row r : rows) {
+ String protein = r.getString("Protein");
+ String prediction = findJnetpred(r.getMap("Predictions", String.class, String.class));
+ if (protein != null && prediction != null) {
+ output.put(protein, prediction);
+ }
+ }
+ //final long endTime = System.currentTimeMillis();
+ return output;
+ }
+
+ private String findJnetpred(Map<String, String> pred) {
+ if (pred != null) {
+ if (pred.containsKey("jnetpred"))
+ return pred.get("jnetpred");
+ }
+ return null;
+ }
+
+ /*