/** * sets the model used to generate results * * @param manager the model used to generate results */ public void setManager(ModelManager manager) { this.manager = manager; ctCodingNucleotide = new PredictedActualBinaryContingencyTable(); ctExons = new PredictedActualBinaryContingencyTable(); ctExons.forgetTN(); nStates = manager.getNumStates(); ctStates = new ArrayList<PredictedActualBinaryContingencyTable>(); for (int i = 0; i < nStates; i++) { ctStates.add(new PredictedActualBinaryContingencyTable()); } DenseBooleanMatrix2D LT = manager.getLegalTransitions(); fromInd = new ArrayList<Integer>(); toInd = new ArrayList<Integer>(); for (int from = 0; from < nStates; from++) { for (int to = 0; to < nStates; to++) { if (LT.getQuick(from, to)) { fromInd.add(from); toInd.add(to); } } } nTransitions = fromInd.size(); ctTransitions = new ArrayList<PredictedActualBinaryContingencyTable>(); for (int i = 0; i < nTransitions; i++) { ctTransitions.add(new PredictedActualBinaryContingencyTable()); } }
@Override public String toString() { String ret = ""; for (int s = 0; s < nStates; s++) { ret += "[State=" + manager.getStateName(s) + "] "; ctStates.get(s).freeze(); ret += "Predicted: " + ctStates.get(s).pp(); ret += "\n"; } for (int t = 0; t < nTransitions; t++) { ret += "[Transition " + manager.getStateName(fromInd.get(t)) + " --> " + manager.getStateName(toInd.get(t)) + " ] "; ctTransitions.get(t).freeze(); ret += "Predicted: " + ctTransitions.get(t).pp(); ret += "\n"; } ctCodingNucleotide.freeze(); ret += "[Coding nucleotides] Predicted: " + ctCodingNucleotide.pp() + "\n"; ctExons.freeze(); ret += "[Coding exons] Predicted: " + ctExons.pp() + "\n"; if (lla > 0) { ret += "LLA:" + lla + " LLV:" + llv + " " + "\n"; } // ret += String.format("Perfectly predicted hidden sequences: %d/%d %.2f // %%",perfect,perfect+imperfect,perfect*100.0/(float) (perfect+imperfect))+ "\n"; // ret += String.format("Nucleotide Hidden State Agreement: %d/%d %.2f %%",correct, correct + // incorrect, correct * 100.0 / (float) (correct + incorrect)) + "\n"; return ret; }