if (r.getReadFeatures() == null)
continue;
else
for (ReadFeature rf : r.getReadFeatures())
if (rf.getOperator() == Substitution.operator) {
Substitution s = ((Substitution) rf);
byte refBase = s.getRefernceBase();
byte base = s.getBase();
freqs[refBase][base]++;
}
}
h.substitutionMatrix = new SubstitutionMatrix(freqs);
} else h.substitutionMatrix = substitutionMatrix ;
HuffmanParamsCalculator calculator = new HuffmanParamsCalculator();
for (CramRecord r : records)
if (r.getReadFeatures() == null)
continue;
else
for (ReadFeature rf : r.getReadFeatures()) {
if (rf.getOperator() == Substitution.operator) {
Substitution s = ((Substitution) rf);
if (s.getCode() == -1) {
byte refBase = s.getRefernceBase();
byte base = s.getBase();
s.setCode(h.substitutionMatrix.code(refBase,
base));
}
calculator.add(s.getCode());
}
}
calculator.calculate();
h.eMap.put(EncodingKey.BS_BaseSubstitutionCode,