X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FConservation.java;h=97863625646b5a901a538aa5787f424972b4afa4;hb=9218eaf932c0847b83e9886f5c06d70a0bc7808e;hp=c5ddd0f1561a209812a3ed2c0fa5773a56addbbd;hpb=485ceb23bbae52bb2b0fd1def01e1f6822ececcf;p=jalview.git diff --git a/src/jalview/analysis/Conservation.java b/src/jalview/analysis/Conservation.java index c5ddd0f..9786362 100755 --- a/src/jalview/analysis/Conservation.java +++ b/src/jalview/analysis/Conservation.java @@ -27,14 +27,52 @@ public class Conservation { Vector sequences; int start; int end; - - Vector total = new Vector(); - - String consString = ""; - - Sequence consSequence; - Hashtable propHash; - int threshold; + Vector seqNums; // vector of int vectors where first is sequence checksum + int maxLength=0; // used by quality calcs + boolean seqNumsChanged = false; // updated after any change via calcSeqNum; + private void calcSeqNums() { + for (int i=0; i-1 && i max) { + max = cons2[i][j]; + maxi = i; + maxj = j; + } + + } + } */ + } + +} + + +public void findQuality(int start, int end) { + quality = new Vector(); + double max = -10000; + String s = ""; + int[][] BLOSUM62 = jalview.schemes.ResidueProperties.getBLOSUM62(); + //Loop over columns // JBPNote Profiling info + // long ts = System.currentTimeMillis(); + //long te = System.currentTimeMillis(); + percentIdentity2(); + + int size = seqNums.size(); + int[] lengths = new int[size]; + + for (int l = 0; l < size; l++) + lengths[l] = ((int[]) seqNums.get(l)).length-1; + + for (int j=start; j <= end; j++) { + double bigtot = 0; + + // First Xr = depends on column only + double x[] = new double[24]; + + for (int ii=0; ii < 24; ii++) { + x[ii] = 0; + try { + for (int i2=0; i2 < 24; i2++) { + x[ii] += (double)cons2[j][i2] * BLOSUM62[ii][i2]+4; + } + } catch (Exception e) { + System.out.println("Exception : " + e); + } + //System.out.println("X " + ii + " " + x[ii]); + x[ii] /= (size); + //System.out.println("X " + ii + " " + x[ii]); + } + // Now calculate D for each position and sum + for (int k=0; k < size; k++) { + double tot = 0; + double[] xx = new double[24]; + int seqNum = + (jnewmax) + newmax = tmp; + } + // System.out.println("Quality " + s); + qualityRange[0] = new Double(0); + qualityRange[1] = new Double(newmax); + } + + }