From 4814641a15b58566fc6a8b13683fa9ae1cafb27f Mon Sep 17 00:00:00 2001 From: ioannistamposis Date: Sun, 22 May 2022 18:34:20 +0300 Subject: [PATCH] REFINE module supports multiple labels --- .idea/.gitignore | 2 + conf/conf.casino | 1 + conf/conf.cpg | 1 + conf/conf.demo | 4 +- conf/conf.hmmtm | 124 -------------------------------- conf/conf.lipo | 1 + conf/conf.signal | 1 + conf/conf.tat | 1 + conf/conf.tmbb | 18 ++--- conf/conf.tmbbHNN | 6 +- models/CpG.mdel | 16 ++--- models/casino.mdel | 2 +- src/hmm/Args.java | 5 +- src/hmm/Estimator.java | 12 +++- src/hmm/Juchmme.java | 3 +- src/hmm/LPB.java | 157 +++++++++++++++++++++++++++++++++++++++++ src/hmm/Params.java | 7 +- src/hmm/RandomSeq.java | 2 +- src/hmm/Seq.java | 6 ++ src/hmm/Stats.java | 9 +++ src/hmm/Test.java | 9 ++- tables/E_CpG | 16 ++--- 22 files changed, 242 insertions(+), 161 deletions(-) create mode 100644 .idea/.gitignore delete mode 100644 conf/conf.hmmtm create mode 100644 src/hmm/LPB.java diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..5c98b42 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/conf/conf.casino b/conf/conf.casino index 8aa4ebb..53185da 100644 --- a/conf/conf.casino +++ b/conf/conf.casino @@ -53,6 +53,7 @@ STRDIV=9 #Refine OPTIONS FLANK=3 REFINE=false +REFINE_LABELS=M ML_INIT=false # DECODING OPTIONS diff --git a/conf/conf.cpg b/conf/conf.cpg index 6947468..fbb8b4d 100644 --- a/conf/conf.cpg +++ b/conf/conf.cpg @@ -53,6 +53,7 @@ STRDIV=9 #Refine OPTIONS FLANK=3 REFINE=false +REFINE_LABELS=M ML_INIT=false # DECODING OPTIONS diff --git a/conf/conf.demo b/conf/conf.demo index ec41700..9d34477 100644 --- a/conf/conf.demo +++ b/conf/conf.demo @@ -17,7 +17,7 @@ EMISSIONS=FILE WEIGHTS=RPROP # Multithreaded parallelization for multicores -PARALLEL=true +PARALLEL=false defCPU=true nCPU=10 @@ -53,6 +53,7 @@ STRDIV=9 #Refine OPTIONS FLANK=3 REFINE=false +REFINE_LABELS=M ML_INIT=false # DECODING OPTIONS @@ -61,6 +62,7 @@ NBEST=false DYNAMIC=false POSVIT=false PLP=true +LPB=false CONSTRAINT=false #EARLY STOPPING OPTIONS diff --git a/conf/conf.hmmtm b/conf/conf.hmmtm deleted file mode 100644 index 90c814a..0000000 --- a/conf/conf.hmmtm +++ /dev/null @@ -1,124 +0,0 @@ -# TRAINING OPTIONS -RUN_CML=true -RUN_GRADIENT=true -HNN=true -ALLOW_BEGIN=true -ALLOW_END=true -RUN_ViterbiTraining=false -threshold=0.02 -maxIter=50 - -#PROBABILITIES -#FILE, RANDOM, UNIFORM, VITERBI -TRANSITIONS=FILE -#FILE, RANDOM, UNIFORM, VITERBI -EMISSIONS=FILE -#FILE, RANDOM_NORMAL, RANDOM_UNIFORM, RPROP, BOOT -WEIGHTS=RPROP - -# Multithreaded parallelization for multicores -PARALLEL=false -defCPU=true -nCPU=10 - -#SEMI-SUPERVISED LEARNING OPTIONS -SSL_ENABLED=false -# SSL (standard Semi-supervised Method) or GEM (Generalized EM) -SSL_METHOD=SSL -#1: Use all, 2: Use weight (Constant) for each sequence, 3: Use weight (Reliability) for each sequence, 4: Use a few most confident -SSL_ADD_METHOD=4 -#1:VITERBI, 2:NBEST, 3:POSVIT, 4:PLP -SSL_USING_METHOD=4 -SSL_THRESHOLD=0.000002 -SSL_maxIter=200 -SSL_relscore= 0.95 -SSL_WEIGHT=0.2 - -#EXTENDED PAST OBSERVATIONS -PAST_OBS_EXTENSION=false -#1=40, 2=80, 3=160, 4=400, 0=Your Encoding -ENCODE_TYPE=1 -GROUP_SYMBOLS = 10 -GROUPING=10001011011000000111 -PAST_OBS_NO = 1 - -#DYNAMIC OPTIONS -MINHLEN=7 -MINLLEN=1 -MAXHLEN=17 -MAXNSTRAND=32 -MINSSC=3 -STRDIV=9 - -#Refine OPTIONS -FLANK=3 -REFINE=true -ML_INIT=false - -# DECODING OPTIONS -VITERBI=true -NBEST=false -DYNAMIC=false -POSVIT=false -PLP=true -CONSTRAINT=false - -#EARLY STOPPING OPTIONS -EARLY=false -CUSTOM_STOP=0.0 -NTRAIN=15 -NROUND=5 -ITER=2 - -#GRADIENT DESCENT OPTIONS -JACOBI=false -RPROP=true -SILVA=true -momentum=0.0 -kappaA=0.01 -kappaAmin=1E-20 -kappaAmax=1.0 -kappaE=0.01 -kappaEmin=1E-20 -kappaEmax=1.0 -NPLUS=1.2 -NMINUS=0.5 - -ni=50.0 - -#PRIOR OPTIONS -NOISE_TR=true -NOISE_EM=true -PRIOR_TRANS=0.001 - -#HNN OPTIONS -windowLeft=9 -windowRight=9 -nhidden=7 -ADD_GRAD=0.0 -DECAY=0.001 -#1: Sigmoid, 2: Sigmoid Modified, 3: Tanh -hiddenLayerFunction=2 - -#BOOTSTRAP OPTIONS (HNN ONLY) -BOOT=0 -STDEV=1.5 -RANGE=5.0 -SEED=568381 -WEIGHT_RAND=0.0 -WEIGHT_TIME=false - -#RPROPNN OPTIONS (HNN ONLY) -numberOfCycles=50 -doCrossVal=true -crossValIter=5 -minGEdiff=0 -#RMSE, CE: Cross Entropy -globalError=CE -initialDelta=0.1 -maxDelta=50.0 -minDelta=1e-6 -etaInc=1.2 -etaDec=0.5 - -#RANDOM SEQUENCE UTILITY \ No newline at end of file diff --git a/conf/conf.lipo b/conf/conf.lipo index ec41700..8b531de 100644 --- a/conf/conf.lipo +++ b/conf/conf.lipo @@ -53,6 +53,7 @@ STRDIV=9 #Refine OPTIONS FLANK=3 REFINE=false +REFINE_LABELS=M ML_INIT=false # DECODING OPTIONS diff --git a/conf/conf.signal b/conf/conf.signal index ec41700..8b531de 100644 --- a/conf/conf.signal +++ b/conf/conf.signal @@ -53,6 +53,7 @@ STRDIV=9 #Refine OPTIONS FLANK=3 REFINE=false +REFINE_LABELS=M ML_INIT=false # DECODING OPTIONS diff --git a/conf/conf.tat b/conf/conf.tat index ec41700..8b531de 100644 --- a/conf/conf.tat +++ b/conf/conf.tat @@ -53,6 +53,7 @@ STRDIV=9 #Refine OPTIONS FLANK=3 REFINE=false +REFINE_LABELS=M ML_INIT=false # DECODING OPTIONS diff --git a/conf/conf.tmbb b/conf/conf.tmbb index 71ff64b..9b58eaf 100644 --- a/conf/conf.tmbb +++ b/conf/conf.tmbb @@ -1,20 +1,20 @@ # TRAINING OPTIONS RUN_CML=true RUN_GRADIENT=true -HNN=true +HNN=false ALLOW_BEGIN=true ALLOW_END=true RUN_ViterbiTraining=false threshold=0.02 -maxIter=50 +maxIter=200 -#PR +#PROBABILITIES #FILE, RANDOM, UNIFORM, VITERBI TRANSITIONS=FILE #FILE, RANDOM, UNIFORM, VITERBI EMISSIONS=FILE #FILE, RANDOM_NORMAL, RANDOM_UNIFORM, RPROP, BOOT -WEIGHTS=RPROP +WEIGHTS=FILE # Multithreaded parallelization for multicores PARALLEL=false @@ -53,6 +53,7 @@ STRDIV=9 #Refine OPTIONS FLANK=3 REFINE=true +REFINE_LABELS=M ML_INIT=false # DECODING OPTIONS @@ -61,7 +62,8 @@ NBEST=false DYNAMIC=false POSVIT=false PLP=true -CONSTRAINT=false +LPB=false +CONSTRAINT=true #EARLY STOPPING OPTIONS EARLY=false @@ -92,9 +94,9 @@ NOISE_EM=true PRIOR_TRANS=0.001 #HNN OPTIONS -windowLeft=5 -windowRight=5 -nhidden=9 +windowLeft=3 +windowRight=3 +nhidden=11 ADD_GRAD=0.0 DECAY=0.001 #1: Sigmoid, 2: Sigmoid Modified, 3: Tanh diff --git a/conf/conf.tmbbHNN b/conf/conf.tmbbHNN index 78fbddf..5ea68bf 100644 --- a/conf/conf.tmbbHNN +++ b/conf/conf.tmbbHNN @@ -17,7 +17,7 @@ EMISSIONS=FILE WEIGHTS=FILE # Multithreaded parallelization for multicores -PARALLEL=false +PARALLEL=true defCPU=true nCPU=10 @@ -53,6 +53,7 @@ STRDIV=9 #Refine OPTIONS FLANK=3 REFINE=true +REFINE_LABELS=M ML_INIT=false # DECODING OPTIONS @@ -61,6 +62,7 @@ NBEST=false DYNAMIC=false POSVIT=false PLP=true +LPB=false CONSTRAINT=false #EARLY STOPPING OPTIONS @@ -121,4 +123,4 @@ minDelta=1e-6 etaInc=1.2 etaDec=0.5 -#RANDOM SEQUENCE UTILITY \ No newline at end of file +#RANDOM SEQUENCE UTILITY diff --git a/models/CpG.mdel b/models/CpG.mdel index 568acd4..b597244 100644 --- a/models/CpG.mdel +++ b/models/CpG.mdel @@ -1,7 +1,7 @@ # MODEL OPTIONS MODEL=CpG -ESYM=AGCT +ESYM=ACGT OSYM=HLBE PSYM=HBE @@ -14,15 +14,15 @@ outLabels=O # A+ C+ G+ T+ A- C- G- T- # A C G T a c g t STATE =B A C G T a c g t E -OSTATE=B A C G T a c g t E -PSTATE=B H H H H H H H H E +OSTATE=B H H H H L L L L E +PSTATE=B H H H H L L L L E #MODEL PRIOR for every esym PRIOR = 0.077 0.018 0.058 0.066 # Distribution for each osym -# Each column must have a summ equal to 1 -# osym H B E -PRIOR1 = 0.97 0.0 0.0 -PRIOR2 = 0.01 0.0 0.0 -PRIOR3 = 0.02 0.0 0.0 +# Each column must have a sum equal to 1 +# osym H L B E +PRIOR1 = 0.97 0.97 0.0 0.0 +PRIOR2 = 0.01 0.01 0.0 0.0 +PRIOR3 = 0.02 0.02 0.0 0.0 diff --git a/models/casino.mdel b/models/casino.mdel index ddaf229..2e9a4a3 100644 --- a/models/casino.mdel +++ b/models/casino.mdel @@ -19,7 +19,7 @@ PSTATE=B H H E PRIOR = 0.077 0.018 0.058 0.066 0.040 0.072 # Distribution for each osym -# Each column must have a summ equal to 1 +# Each column must have a sum equal to 1 # osym H B E PRIOR1 = 0.97 0.0 0.0 PRIOR2 = 0.01 0.0 0.0 diff --git a/src/hmm/Args.java b/src/hmm/Args.java index f6c93b4..c5b384e 100644 --- a/src/hmm/Args.java +++ b/src/hmm/Args.java @@ -3,7 +3,7 @@ import java.io.*; public class Args { - static String Vesrion = "1.0.1"; + static String Vesrion = "1.0.5"; static boolean RUN_TRAINING = false; static boolean RUN_CROSSVAL = false; @@ -54,7 +54,7 @@ public static final void Init(String[] args) { switch (a) { case 'V': - System.err.println("JUCHMME Version" + Vesrion); + System.err.println("JUCHMME Version " + Vesrion); System.exit(0); case 'a': @@ -140,6 +140,7 @@ public static final void Init(String[] args) { case 't': if (args.length > i + 1) { file = args[i + 1]; + filesThree.add(args[i + 1]); i++; RUN_TRAINING = true; Params.THREELINE = true; diff --git a/src/hmm/Estimator.java b/src/hmm/Estimator.java index 31c601c..1f95ad5 100644 --- a/src/hmm/Estimator.java +++ b/src/hmm/Estimator.java @@ -172,10 +172,18 @@ private HMM Estimate(SeqSet trainSet, Probs tab, WeightsL weightsL) throws Excep //training.GetModel().print( new SystemOut() ); for (int j = 0; j < trainSet.nseqs; j++) { - trainSet.seq[j].PutDashes(Model.transmLabels); + System.out.println("Performed refinement " + trainSet.seq[j].header); + //Refine multiple labels + for (int i = 0; i < Params.REFINE_LABELS.length(); i++) { + String label = Character.toString(Params.REFINE_LABELS.charAt(i)); + if (Model.psym.contains(label)) { + trainSet.seq[j].PutDashes(label); + } else { + System.out.println("Warning: Refinement label "+label+" doesn't exist in model PSYM value."); + } + } Viterbi vit2 = new Viterbi(training.GetModel(), trainSet.seq[j], false); trainSet.seq[j].SetObs(vit2.getPath2()); - System.out.println("Performed refinement."); } } diff --git a/src/hmm/Juchmme.java b/src/hmm/Juchmme.java index cd2af02..21dd3d8 100644 --- a/src/hmm/Juchmme.java +++ b/src/hmm/Juchmme.java @@ -24,7 +24,7 @@ public static void main(String[] args) throws Exception { long startTime = System.currentTimeMillis(); System.out.println("JUCHMME :: Java Utility for Class Hidden Markov Models and Extensions"); - System.out.println("Version 1.0.4; September 2019"); + System.out.println("Version 1.0.5; September 2019"); System.out.println("Copyright (C) 2019 Pantelis Bagos"); System.out.println("Freely distributed under the GNU General Public Licence (GPLv3)"); System.out.println("--------------------------------------------------------------------------"); @@ -109,6 +109,7 @@ public static void main(String[] args) throws Exception { if (Params.THREELINE) { SeqSet testSet = new SeqSet((String) Args.filesThree.get(0)); Decoding dec = new Decoding(model, testSet, Params.CONSTRAINT, true, Params.parallel, Params.MSA); + stats.calcStats(testSet); } if (Params.FASTA) { diff --git a/src/hmm/LPB.java b/src/hmm/LPB.java new file mode 100644 index 0000000..18a2371 --- /dev/null +++ b/src/hmm/LPB.java @@ -0,0 +1,157 @@ +package hmm; + +import java.util.*; + +class LPB extends HMMAlgo { + private String path; + int i; + private double best_sum; + + public LPB(HMM hmm, Seq x, final int nbh, boolean free, PosteriorProb postp2) { + super(hmm, x); + final int L = x.getLen(); + Vector hypo = new Vector(); + path = new String(); + + //System.out.println( "Start 1 Best" ); + i = 1; //start at 1 + { + // System.out.println( " Position "+i ); + for (int o = 0; o < Model.npsym; o++) { + Hypothese hy = new Hypothese(L + 1, hmm.nstte); + hy.lab[i] = o; + hy.gamma[0] = Double.NEGATIVE_INFINITY; + + int lab = x.getNPObs(i - 1); + + for (int ell = 1; ell < hmm.nstte; ell++) { + if ((free || lab == -1 || lab == Model.plab[ell - 0]) && Model.plab[ell - 0] == o) + hy.gamma[ell] = hmm.getLoga(0, ell) + hmm.getLoge(ell, x, 0); + else + hy.gamma[ell] = Double.NEGATIVE_INFINITY; + } + hypo.add(hy); + } + } + + for (i = 2; i <= L; i++) { + Vector hypo_temp = new Vector(); + for (int h = 0; h < hypo.size(); h++) { + for (int o = 0; o < Model.npsym; o++) { + Hypothese hy = ((Hypothese) hypo.elementAt(h)).copy(); + hy.lab[i] = o; + hypo_temp.add(hy); + } + } + + hypo = hypo_temp; + boolean chosen[] = new boolean[hypo.size()]; + + for (int ell = 0; ell < hmm.nstte; ell++) { + int[] best_hypo = new int[nbh]; + double[] maxgam = new double[nbh]; + + for (int bh = 0; bh < nbh; bh++) { + best_hypo[bh] = -1; + maxgam[bh] = Double.NEGATIVE_INFINITY; + } + + + for (int h = 0; h < hypo.size(); h++) { + Hypothese hy = ((Hypothese) hypo.elementAt(h)); + double gam = Double.NEGATIVE_INFINITY; // = log(0) + if (ell > 0) { + int lab = x.getNPObs(i - 1); + + if ((free || lab == -1 || lab == Model.plab[ell - 0]) && Model.plab[ell - 0] == hy.lab[i]) { + for (int k = 1; k < hmm.nstte; k++) { + double prod = hy.gamma0[k] + hmm.getLoga(k, ell); + gam = logplus(gam, prod); + } + //gam += hmm.getLoge(ell, x, i - 1); + + //label posterior probability + // grab the posterior probability fot the label + double p = postp2.getPostForLabel(i - 1, Model.plab[ell]); + + //state posterior probability + //get posterior probability for state + //double p = postp2.getPost(i - 1, ell); + //add to the current path prob + gam+=Math.log(p); + } + } + + for (int bh = nbh - 1; bh >= 0; bh--) { + if (gam > maxgam[bh]) { + if (bh < nbh - 1) { + maxgam[bh + 1] = maxgam[bh]; + best_hypo[bh + 1] = best_hypo[bh]; + } + maxgam[bh] = gam; + best_hypo[bh] = h; + } + } + hy.gamma[ell] = gam; + + } + + for (int bh = 0; bh < nbh; bh++) + if (best_hypo[bh] > -1) + chosen[best_hypo[bh]] = true; + } + + // System.out.print( " From "+ hypo.size() + " hypotheses" ); + + int hypos = hypo.size(); + int ind = 0; + + for (int h = 0; h < hypos; h++) + if (!chosen[h]) + hypo.removeElementAt(ind); + else + ind++; + + // System.out.println( " I chose "+ hypo.size() + "." ); + + // for( int h=0; h best_sum) { + best_sum = sum; + best_hypo = h; + } + } + path = labeling((Hypothese) hypo.elementAt(best_hypo)); + } + + public String getPath() { + return path; + } + + String labeling(Hypothese hy) { + StringBuffer lab = new StringBuffer(); + for (int ii = 1; ii <= i; ii++) { + lab.append(Model.psym.charAt(hy.lab[ii])); + } + return lab.toString(); + } + + public double getProb() { + return best_sum; + } + +} diff --git a/src/hmm/Params.java b/src/hmm/Params.java index 19d942c..c1155ca 100644 --- a/src/hmm/Params.java +++ b/src/hmm/Params.java @@ -41,6 +41,7 @@ public class Params { //ESTIMATION static int FLANK = 5; static boolean REFINE = false; + static String REFINE_LABELS = "M"; static boolean ML_INIT = false; static boolean ALLOW_END = true; static boolean ALLOW_BEGIN = true; //conf R:starting stage @@ -51,12 +52,14 @@ public class Params { static boolean DYNAMIC_p = false; static boolean POSVIT_p = true; static boolean PLP_p = true; + static boolean LPB_p = true; static boolean CONSTRAINT = false; static int VITERBI = 1; static int DYNAMIC = -2; static int POSVIT = 3; static int PLP = 4; static int NBEST = -5; + static int LPB = -6; static boolean MSA = false; // MSA static String MSAgapSymbol = "*"; @@ -215,6 +218,7 @@ public static final void Init(String file) { //Estimation Options FLANK = Utils.parseInteger(props.getProperty("FLANK"), "FLANK"); REFINE = Utils.parseBoolean(props.getProperty("REFINE"), "REFINE"); + REFINE_LABELS = props.getProperty("REFINE_LABELS"); ML_INIT = Utils.parseBoolean(props.getProperty("ML_INIT"), "ML_INIT"); // DECODING OPTIONS @@ -228,7 +232,8 @@ public static final void Init(String file) { POSVIT = (POSVIT_p) ? 3 : -3; PLP_p = Utils.parseBoolean(props.getProperty("PLP"), "PLP"); PLP = (PLP_p) ? 4 : -4; - + LPB_p = Utils.parseBoolean(props.getProperty("LPB"), "LPB"); + LPB = (LPB_p) ? 6 : -6; //EARLY STOPPING EARLY = Utils.parseBoolean(props.getProperty("EARLY"), "EARLY"); diff --git a/src/hmm/RandomSeq.java b/src/hmm/RandomSeq.java index d14d2ae..aa749da 100644 --- a/src/hmm/RandomSeq.java +++ b/src/hmm/RandomSeq.java @@ -32,7 +32,7 @@ public static void main(String[] args) { } try { - File outputFile = new File("set.txt"); + File outputFile = new File("CpGset.txt"); FileWriter out = new FileWriter(outputFile); for (int i = 0; i < seqNum; i++) { diff --git a/src/hmm/Seq.java b/src/hmm/Seq.java index 6216a4f..7981b74 100644 --- a/src/hmm/Seq.java +++ b/src/hmm/Seq.java @@ -208,6 +208,12 @@ void ShowRes() { System.out.println("DR: " + dynScoreDiff); System.out.println("DP: " + path[Params.DYNAMIC]); } + + if (Params.LPB > -1 && Model.isCHMM && Params.MSA != true) { + System.out.println("LPBS: " + score[Params.LPB]); + System.out.println("LPBR: " + relscore[Params.LPB]); + System.out.println("LPBP: " + path[Params.LPB]); + } } diff --git a/src/hmm/Stats.java b/src/hmm/Stats.java index a5a0f7b..8fdf4d8 100644 --- a/src/hmm/Stats.java +++ b/src/hmm/Stats.java @@ -254,5 +254,14 @@ public void calcStats(SeqSet testSet) { Print(); } + if (Params.LPB > -1) { + for (int j = 0; j < testSet.nseqs; j++) + pp[j] = testSet.seq[j].path[Params.LPB]; + + Run(testSet.getOrigPath(), pp, Model.transmLabels, Model.inLabels, Model.outLabels); + System.out.println("LPB:\n"); + Print(); + } + } } \ No newline at end of file diff --git a/src/hmm/Test.java b/src/hmm/Test.java index 55d5d83..77f01e7 100644 --- a/src/hmm/Test.java +++ b/src/hmm/Test.java @@ -62,7 +62,6 @@ public void Run(HMM estimate, Seq sequence, boolean free, boolean MSA, String p_ PLP plp2 = new PLP(estimate, sequence, free, postp2); sequence.path[Params.PLP] = plp2.getPath2(); sequence.score[Params.PLP] = plp2.getProb() - fwd.logprob(); - sequence.relscore[Params.PLP] = CalcRelScore(sequence.getLen(), sequence.path[Params.PLP], pp2); } @@ -74,6 +73,13 @@ public void Run(HMM estimate, Seq sequence, boolean free, boolean MSA, String p_ sequence.relscore[Params.NBEST] = CalcRelScore(sequence.getLen(), sequence.path[Params.NBEST], pp2); } + if (Params.LPB > -1 && Model.isCHMM) { + LPB lpb = new LPB(estimate, sequence, 1, free, postp2); + sequence.path[Params.LPB] = lpb.getPath(); + sequence.score[Params.LPB] = lpb.getProb() - fwd.logprob(); + sequence.relscore[Params.LPB] = CalcRelScore(sequence.getLen(), sequence.path[Params.LPB], pp2); + } + if (Params.DYNAMIC > -1 || Args.SHOW_PLOT || Args.graphPlotDir != null) { if (Params.DYNAMIC > -1 && Model.isCHMM){ @@ -123,7 +129,6 @@ public void Run(HMM estimate, Seq sequence, boolean free, boolean MSA, String p_ public static double CalcRelScore(final int len, final String path, final double[][] pp) { double relScore = 0; - for (int i = 0; i < len; i++) { int lab = Model.psym.indexOf(path.charAt(i)); if (lab == -1) diff --git a/tables/E_CpG b/tables/E_CpG index 6c89ad3..1224332 100644 --- a/tables/E_CpG +++ b/tables/E_CpG @@ -1,10 +1,10 @@ 0 0 0 0 -1 0 0 0 -0 1 0 0 -0 0 1 0 -0 0 0 1 -1 0 0 0 -0 1 0 0 -0 0 1 0 -0 0 0 1 +0.180 0.274 0.426 0.120 +0.171 0.368 0.274 0.188 +0.161 0.339 0.375 0.125 +0.079 0.355 0.384 0.182 +0.300 0.205 0.285 0.210 +0.322 0.298 0.078 0.302 +0.248 0246 0.298 0.208 +0.177 0.239 0.292 0.292 0 0 0 0 \ No newline at end of file