Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions HMM.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,12 @@ void hmm_reset(hmm_t *hmm, void *_snapshot)

void hmm_set_tprob(hmm_t *hmm, double *tprob, int ntprob)
{
int old_ntprob_arr = hmm->ntprob_arr;
hmm->ntprob_arr = ntprob;
if ( ntprob<=0 ) ntprob = 1;

if ( !hmm->tprob_arr )
hmm->tprob_arr = (double*) malloc(sizeof(double)*hmm->nstates*hmm->nstates*ntprob);
if ( !hmm->tprob_arr || ntprob != old_ntprob_arr )
hmm->tprob_arr = (double*) realloc(hmm->tprob_arr, sizeof(double)*hmm->nstates*hmm->nstates*ntprob);

memcpy(hmm->tprob_arr,tprob,sizeof(double)*hmm->nstates*hmm->nstates);

Expand Down
2 changes: 1 addition & 1 deletion vcfcnv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ static void cnv_flush_viterbi(args_t *args)
for (isite=0; isite<args->nsites; isite++)
{
int state = vpath[args->nstates*isite];
double *pval = fwd + isite*args->nstates;
double *pval = fwd + (isite+1)*args->nstates;

qual += pval[start_cn];

Expand Down
2 changes: 1 addition & 1 deletion vcfroh.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ static void flush_viterbi(args_t *args, int ismpl)
for (i=0; i<end; i++)
{
int state = vpath[i*2]==STATE_AZ ? 1 : 0;
double qual = phred_score(1.0 - fwd[i*2 + state]);
double qual = phred_score(1.0 - fwd[(i+1)*2 + state]);
if ( args->output_type & OUTPUT_ST )
{
args->str.l = 0;
Expand Down