/* Function: p7_oprofile_Copy() * Synopsis: Allocate an optimized profile structure. * Incept: MSF Tue Nov 3, 2009 [Janelia] * * Purpose: Allocate for profiles of up to <allocM> nodes for digital alphabet <abc>. * * Throws: <NULL> on allocation error. */ P7_OPROFILE * p7_oprofile_Copy(P7_OPROFILE *om1) { P7_PROFILE *dst = NULL; if ((dst = p7_profile_Create(om1->M, om1->abc)) == NULL) goto ERROR; if ((p7_profile_Copy(om1, dst)) != eslOK) goto ERROR; return dst; ERROR: p7_profile_Destroy(dst); return NULL; }
/* Function: p7_profile_Clone() * Synopsis: Duplicates a profile. * * Purpose: Duplicate profile <gm>; return a pointer * to the newly allocated copy. * * Returns: ptr to new clone. * * Throws: <NULL> on allocation failure. */ P7_PROFILE * p7_profile_Clone(const P7_PROFILE *gm) { P7_PROFILE *g2 = NULL; int status; if ((g2 = p7_profile_Create(gm->allocM, gm->abc)) == NULL) return NULL; if ((status = p7_profile_Copy(gm, g2)) != eslOK) goto ERROR; return g2; ERROR: p7_profile_Destroy(g2); return NULL; }
/* Function: p7_oprofile_Convert() * Synopsis: Converts standard profile to an optimized one. * Incept: MSF Tue Nov 3, 2009 [Janelia] * * Purpose: Convert a standard profile <gm> to an optimized profile <om>, * where <om> has already been allocated for a profile of at * least <gm->M> nodes and the same emission alphabet <gm->abc>. * * Args: gm - profile to optimize * om - allocated optimized profile for holding the result. * * Returns: <eslOK> on success. * * Throws: <eslEINVAL> if <gm>, <om> aren't compatible. * <eslEMEM> on allocation failure. */ int p7_oprofile_Convert(const P7_PROFILE *gm, P7_OPROFILE *om) { return p7_profile_Copy(gm, om); }