hmmer-3.3/src/impl_vmx/fwdback.c
/* Function:  p7_Forward()
 * Synopsis:  The Forward algorithm, full matrix fill version.
 * Incept:    SRE, Fri Aug 15 18:59:43 2008 [Casa de Gatos]
 *
 * Purpose:   Calculates the Forward algorithm for sequence <dsq> of
 *            length <L> residues, using optimized profile <om>, and a
 *            preallocated DP matrix <ox>. Upon successful return, <ox>
 *            contains the filled Forward matrix, and <*opt_sc>
 *            optionally contains the raw Forward score in nats.
 *            
 *            This calculation requires $O(ML)$ memory and time.
 *            The caller must provide a suitably allocated full <ox>
 *            by calling <ox = p7_omx_Create(M, L, L)> or
 *            <p7_omx_GrowTo(ox, M, L, L)>.
 *
 *            The model <om> must be configured in local alignment
 *            mode. The sparse rescaling method used to keep
 *            probability values within single-precision floating
 *            point dynamic range cannot be safely applied to models in
 *            glocal or global mode.
 *
 * Args:      dsq     - digital target sequence, 1..L
 *            L       - length of dsq in residues          
 *            om      - optimized profile
 *            ox      - RETURN: Forward DP matrix
 *            opt_sc  - RETURN: Forward score (in nats)          
 *
 * Returns:   <eslOK> on success. 
 *
 * Throws:    <eslEINVAL> if <ox> allocation is too small, or if the profile
 *            isn't in local alignment mode.
 *            <eslERANGE> if the score exceeds the limited range of
 *            a probability-space odds ratio.
 *            In either case, <*opt_sc> is undefined.
 */
p7_Forward()
Synopsis:  The Forward algorithm, full matrix fill version.

Calculates the Forward algorithm for sequence  of
length  residues, using optimized profile , and a
preallocated DP matrix . Upon successful return, 
contains the filled Forward matrix, and <*opt_sc>
optionally contains the raw Forward score in nats.

This calculation requires $O(ML)$ memory and time.
The caller must provide a suitably allocated full 
by calling  or
.

The model  must be configured in local alignment
mode. The sparse rescaling method used to keep
probability values within single-precision floating
point dynamic range cannot be safely applied to models in
glocal or global mode.



 on success.

 if  allocation is too small, or if the profile
isn't in local alignment mode.
 if the score exceeds the limited range of
a probability-space odds ratio.
In either case, <*opt_sc> is undefined.
p7_Forward () Synopsis : The Forward algorithm full matrix fill version . Calculates the Forward algorithm for sequence of length residues using optimized profile and a preallocated DP matrix . Upon successful return contains the filled Forward matrix and < * opt_sc > optionally contains the raw Forward score in nats . This calculation requires $O ( ML ) $ memory and time . The caller must provide a suitably allocated full by calling or . The model must be configured in local alignment mode . The sparse rescaling method used to keep probability values within single - precision floating point dynamic range cannot be safely applied to models in glocal or global mode . on success . if allocation is too small or if the profile isn ' t in local alignment mode . if the score exceeds the limited range of a probability - space odds ratio . In either case < * opt_sc > is undefined .
int
p7_Forward(const ESL_DSQ *dsq, int L, const P7_OPROFILE *om, P7_OMX *ox, float *opt_sc)
{
#if eslDEBUGLEVEL > 0		
  if (om->M >  ox->allocQ4*4)    ESL_EXCEPTION(eslEINVAL, "DP matrix allocated too small (too few columns)");
  if (L     >= ox->validR)       ESL_EXCEPTION(eslEINVAL, "DP matrix allocated too small (too few MDI rows)");
  if (L     >= ox->allocXR)      ESL_EXCEPTION(eslEINVAL, "DP matrix allocated too small (too few X rows)");
  if (! p7_oprofile_IsLocal(om)) ESL_EXCEPTION(eslEINVAL, "Forward implementation makes assumptions that only work for local alignment");
#endif
  return forward_engine(TRUE, dsq, L, om, ox, opt_sc);
}
int p7_Forward ( const ESL_DSQ * dsq , int L , const P7_OPROFILE * om , P7_OMX * ox , float * opt_sc ) { #if eslDEBUGLEVEL > 0 if ( om -> M > ox -> allocQ4 * 4 ) ESL_EXCEPTION ( eslEINVAL , " " ) ; if ( L >= ox -> validR ) ESL_EXCEPTION ( eslEINVAL , " " ) ; if ( L >= ox -> allocXR ) ESL_EXCEPTION ( eslEINVAL , " " ) ; if ( ! p7_oprofile_IsLocal ( om ) ) ESL_EXCEPTION ( eslEINVAL , " " ) ; #endif return forward_engine ( TRUE , dsq , L , om , ox , opt_sc ) ; }
Function:  p7_Forward()
 Synopsis:  The Forward algorithm, full matrix fill version.
Function : p7_Forward () Synopsis : The Forward algorithm full matrix fill version .