git://source.jalview.org
/
proteocache.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean up the code
[proteocache.git]
/
datadb
/
compbio
/
cassandra
/
JpredParserLocalFile.java
diff --git
a/datadb/compbio/cassandra/JpredParserLocalFile.java
b/datadb/compbio/cassandra/JpredParserLocalFile.java
index
281a20b
..
c89fe59
100644
(file)
--- a/
datadb/compbio/cassandra/JpredParserLocalFile.java
+++ b/
datadb/compbio/cassandra/JpredParserLocalFile.java
@@
-2,11
+2,8
@@
package compbio.cassandra;
import java.io.BufferedReader;
import java.io.File;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
import java.io.FileInputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.io.FileInputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@
-15,19
+12,21
@@
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Date;
import java.util.List;
+import compbio.data.sequence.FastaReader;
+import compbio.data.sequence.FastaSequence;
+
public class JpredParserLocalFile implements JpredParser {
public class JpredParserLocalFile implements JpredParser {
- private CassandraNativeConnector cc = new CassandraNativeConnector();
private String dirprefix;
public void setSource(String newsourceprefix) {
this.dirprefix = newsourceprefix;
}
private String dirprefix;
public void setSource(String newsourceprefix) {
this.dirprefix = newsourceprefix;
}
- JpredParserLocalFile() {
+ public JpredParserLocalFile() {
this.dirprefix = "/home/asherstnev/Projects/Java.projects/proteocache/data_stress_test/data.dat";
}
this.dirprefix = "/home/asherstnev/Projects/Java.projects/proteocache/data_stress_test/data.dat";
}
- JpredParserLocalFile(String sourceurl) {
+ public JpredParserLocalFile(String sourceurl) {
this.dirprefix = sourceurl;
}
this.dirprefix = sourceurl;
}
@@
-58,7
+57,7
@@
public class JpredParserLocalFile implements JpredParser {
System.out.println("Execution Time = " + execTime + " ms");
}
System.out.println("Execution Time = " + execTime + " ms");
}
- private int ParsingForDate(List<String> input, String date) {
+ private void ParsingForDate(List<String> input, String date) {
int totalcount = 0;
int countNoData = 0;
int countUnclearFASTAid = 0;
int totalcount = 0;
int countNoData = 0;
int countUnclearFASTAid = 0;
@@
-66,15
+65,12
@@
public class JpredParserLocalFile implements JpredParser {
int countinserted = 0;
int counAlignments = 0;
int countStrange = 0;
int countinserted = 0;
int counAlignments = 0;
int countStrange = 0;
- int njobs = 0;
System.out.println("Inserting jobs for " + date);
for (String in : input) {
System.out.println("Inserting jobs for " + date);
for (String in : input) {
- if (in.matches(date + "(.*)jp_[^\\s]+")) {
+ if (in.matches(date + ":(.*)jp_[^\\s]+")) {
String[] table = in.split("\\s+");
String starttime = table[0];
String[] table = in.split("\\s+");
String starttime = table[0];
- String finishtime = table[1];
- String ip = table[2];
String id = table[table.length - 1];
totalcount++;
String confilename = dirprefix + "/" + id + "/" + id + ".concise";
String id = table[table.length - 1];
totalcount++;
String confilename = dirprefix + "/" + id + "/" + id + ".concise";
@@
-97,16
+93,14
@@
public class JpredParserLocalFile implements JpredParser {
} else {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
String dateInString1 = starttime.substring(0, starttime.indexOf(":"));
} else {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
String dateInString1 = starttime.substring(0, starttime.indexOf(":"));
- long insertdate = 0;
try {
Date dat = formatter.parse(dateInString1);
try {
Date dat = formatter.parse(dateInString1);
- insertdate = dat.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
} catch (ParseException e) {
e.printStackTrace();
}
- cc.InsertData(insertdate, starttime, finishtime, ip, id, "OK", "OK", newprotein, seqs);
- ++countinsertions;
- ++njobs;
+ // countinsertions += cw.FormQueryTables(insertdate,
+ // starttime, finishtime, ip, id, "OK", "OK",
+ // newprotein, seqs);
}
fr.close();
} catch (IOException e) {
}
fr.close();
} catch (IOException e) {
@@
-132,7
+126,6
@@
public class JpredParserLocalFile implements JpredParser {
System.out.println(" " + countUnclearFASTAid + " jobs with unclear FASTA protein id in *.concise.fasta");
System.out.println(" " + countinsertions + " new job insertions\n");
}
System.out.println(" " + countUnclearFASTAid + " jobs with unclear FASTA protein id in *.concise.fasta");
System.out.println(" " + countinsertions + " new job insertions\n");
}
- return njobs;
}
}
}
}