Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/eweight.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ eweight_target_f(double Neff, void *params, double *ret_fx)

p7_hmm_CopyParameters(p->hmm, p->h2);
p7_hmm_Scale(p->h2, Neff / (double) p->h2->nseq);
p7_ParameterEstimation(p->h2, p->pri);
p7_ParameterEstimation_MatchOnly(p->h2, p->pri);
*ret_fx = p7_MeanMatchRelativeEntropy(p->h2, p->bg) - p->etarget;
return eslOK;
}
Expand Down Expand Up @@ -107,7 +107,7 @@ eweight_target_exp_f(double exp, void *params, double *ret_fx)

p7_hmm_CopyParameters(p->hmm, p->h2);
p7_hmm_ScaleExponential(p->h2, exp);
p7_ParameterEstimation(p->h2, p->pri);
p7_ParameterEstimation_MatchOnly(p->h2, p->pri);
*ret_fx = p7_MeanMatchRelativeEntropy(p->h2, p->bg) - p->etarget;
return eslOK;
}
Expand Down
1 change: 1 addition & 0 deletions src/hmmer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,7 @@ extern P7_PRIOR *p7_prior_CreateLaplace(const ESL_ALPHABET *abc);
extern void p7_prior_Destroy(P7_PRIOR *pri);

extern int p7_ParameterEstimation(P7_HMM *hmm, const P7_PRIOR *pri);
extern int p7_ParameterEstimation_MatchOnly(P7_HMM *hmm, const P7_PRIOR *pri);

/* p7_profile.c */
extern P7_PROFILE *p7_profile_Create(int M, const ESL_ALPHABET *abc);
Expand Down
24 changes: 24 additions & 0 deletions src/p7_prior.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,30 @@ p7_prior_Destroy(P7_PRIOR *pri)



/* Function: p7_ParameterEstimation_MatchOnly()
* Purpose: Like p7_ParameterEstimation(), but only the match emissions.
* For callers (entropy weighting) that only read hmm->mat.
*/
int
p7_ParameterEstimation_MatchOnly(P7_HMM *hmm, const P7_PRIOR *pri)
{
int k;
double c[p7_MAXABET];
double p[p7_MAXABET];

if (pri==NULL) return p7_hmm_Renormalize(hmm);

for (k = 1; k <= hmm->M; k++) {
esl_vec_F2D(hmm->mat[k], hmm->abc->K, c);
esl_mixdchlet_MPParameters(pri->em, c, p);
esl_vec_D2F(p, hmm->abc->K, hmm->mat[k]);
}
esl_vec_FSet(hmm->mat[0], hmm->abc->K, 0.);
hmm->mat[0][0] = 1.0;
return eslOK;
}


/* Function: p7_ParameterEstimation()
* Incept: SRE, Sat Mar 24 10:15:37 2007 [Janelia]
*
Expand Down