+ public void ArchiveData(long starttime, int exectime, String ip, String jobid, String statusEx, String statusFinal,
+ String protein, List<FastaSequence> predictions, List<FastaSequence> seqs, String LogFile) {
+
+ String check1 = "SELECT * FROM ProteinKeyspace.JpredArchive WHERE JobID = '" + jobid + "';";
+ ResultSet results1 = session.execute(check1);
+ if (results1.isExhausted()) {
+ String allpredictions = "";
+ for (FastaSequence pred : predictions) {
+ String predictionname = pred.getId();
+ String prediction = pred.getSequence().replaceAll("\n", "");
+ allpredictions += "'" + predictionname + "':'" + prediction + "',";
+ }
+ String final_allpredictions = "";
+ if (null != allpredictions) {
+ final_allpredictions = allpredictions.substring(0, allpredictions.length() - 1);
+ }
+ String alignment = "";
+ for (FastaSequence seq : seqs) {
+ String predictionname = seq.getId();
+ String prediction = seq.getSequence().replaceAll("\n", "");
+ alignment += "'" + predictionname + "':'" + prediction + "',";
+ }
+ String final_alignment = "";
+ if (null != allpredictions) {
+ final_alignment = alignment.substring(0, allpredictions.length() - 1);
+ }
+
+ String com1 = "INSERT INTO ProteinKeyspace.JpredArchive "
+ + "(JobID, Protein, IP, StartTime, ExecTime, alignment, predictions, LOG))"
+ + " VALUES ('"
+ + jobid + "','" + protein + "','" + ip + "'," + starttime + "," + exectime
+ + "',[" + final_allpredictions + "],[" + final_alignment + "],'" + LogFile + "]);";
+ session.execute(com1);
+ }
+ }
+
+
+