Skip to content

issue in hmm kernel #4

@dridon

Description

@dridon

When the algorithm calculates the scaling factor in estimate_b in main_bwa_hmm.c @ line 871-872, the states are treated as the rows and the symbols the columns.
mat_vec_mul( 'N', nstates, nsymbols, b_d, nstates,
ones_s_d, 0, c_d, 0);

But in the kernel the indexing scheme seems to suggest the reverse:
if (idx < nstates && idy < nsymbols)
{
if (b_d[(idy * nstates) + idx] == 0)
{
b_d[(idy * nstates) + idx] = 1e-10;
}
else
{
b_d[(idy * nstates) + idx] = b_d[(idy * nstates) + idx] / c_d[idx];
}
}

Shouldn't the matrix be transposed and then multiplied or the kernel be changed? Otherwise we get a division by zero (after we change the 'N' to 'n', see issue #3 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions