Search in sources :

Example 1 with HiddenMarkovModelVBT

use of cz1.hmm.model.HiddenMarkovModelVBT in project polyGembler by c-zhou.

the class Resampler method run.

@Override
public void run() {
    // TODO Auto-generated method stub
    myLogger.info("Random seed - " + Constants.seed);
    DataEntry[] de = start_pos == null ? DataCollection.readDataEntry(in_zip, scaff) : DataCollection.readDataEntry(in_zip, scaff, start_pos, end_pos);
    // DataEntry[] de = DataCollection.readDataEntry(in_zip, Constants._ploidy_H);
    final HiddenMarkovModel hmm = vbt ? new HiddenMarkovModelVBT(de, seperation, reverse, trainExp, field) : (hmm_file == null ? new HiddenMarkovModelBWT(de, seperation, reverse, trainExp, field) : new HiddenMarkovModelBWT(de, seperation, reverse, trainExp, field, hmm_file));
    double ll, ll0 = hmm.loglik();
    String scaff_str = scaff[0] + (start_pos == null || start_pos[0] == Integer.MIN_VALUE ? "" : "_" + start_pos[0]) + (end_pos == null || end_pos[0] == Integer.MAX_VALUE ? "" : "_" + end_pos[0]);
    for (int i = 1; i < scaff.length; i++) {
        if (scaff_str.length() + scaff[i].length() + 32 <= Constants.MAX_FILE_ID_LENGTH)
            scaff_str += Constants.scaff_collapsed_str + scaff[i] + (start_pos == null || start_pos[i] == Integer.MIN_VALUE ? "" : "_" + start_pos[i]) + (end_pos == null || end_pos[i] == Integer.MAX_VALUE ? "" : "_" + end_pos[i]);
        else {
            scaff_str += Constants.scaff_collapsed_str + "etc" + scaff.length;
            break;
        }
    }
    hmm.write(out_prefix, expr_id, scaff_str, resampling);
}
Also used : DataEntry(cz1.hmm.data.DataEntry) HiddenMarkovModelBWT(cz1.hmm.model.HiddenMarkovModelBWT) HiddenMarkovModel(cz1.hmm.model.HiddenMarkovModel) HiddenMarkovModelVBT(cz1.hmm.model.HiddenMarkovModelVBT)

Aggregations

DataEntry (cz1.hmm.data.DataEntry)1 HiddenMarkovModel (cz1.hmm.model.HiddenMarkovModel)1 HiddenMarkovModelBWT (cz1.hmm.model.HiddenMarkovModelBWT)1 HiddenMarkovModelVBT (cz1.hmm.model.HiddenMarkovModelVBT)1