hmmer-3.3/easel/esl_msaweight.c
/* Function:  esl_msaweight_IDFilter()
 * Synopsis:  Filter by %ID.
 * Incept:    ER, Wed Oct 29 10:06:43 2008 [Janelia]
 * 
 * Purpose:   Remove sequences in <msa> that are $\geq$ <maxid>
 *            fractional identity to another aligned sequence.  Return
 *            the filtered alignment in <*ret_newmsa>.  The original
 *            <msa> is not changed.
 *            
 *            When a pair of sequences has $\geq$ <maxid> fractional
 *            identity, the default rule for which of them we keep
 *            differs depending on whether the <msa> is in digital or
 *            text mode. We typically manipulate biosequence
 *            alignments in digital mode. In digital mode, the default
 *            rule (called "conscover") is to prefer the sequence with
 *            an alignment span that covers more consensus columns.
 *            (Where "span" is defined by the column coordinates of
 *            the leftmost and rightmost aligned residues of the
 *            sequence; fragment definition rules also use the concept
 *            of "span".)  In the simpler text mode, the rule is to
 *            keep the earlier sequence and discard the later, in the
 *            order the seqs come in the alignment. The conscover rule
 *            is designed to avoid keeping fragments, while trying not
 *            to bias the insertion/deletion statistics of the
 *            filtered alignment. To use different preference rules in
 *            digital mode alignments, see the more customizable
 *            <esl_msaweight_IDFilter_adv()>.
 *
 *            Fractional identity is calculated by
 *            <esl_dst_{CX}PairID()>, which defines the denominator of
 *            the calculation as MIN(rlen1, rlen2).
 *            
 *            Unparsed Stockholm markup is not propagated into the new
 *            filtered alignment.
 *            
 * Return:    <eslOK> on success, and <*ret_newmsa> is the filtered
 *            alignment.
 *
 * Throws:    <eslEMEM> on allocation error. <eslEINVAL> if a pairwise
 *            identity calculation fails because of corrupted sequence 
 *            data. In either case, the <msa> is unmodified.
 *
 * Xref:      squid::weight.c::FilterAlignment().
 */
esl_msaweight_IDFilter()
Synopsis:  Filter by %ID.

Remove sequences in  that are $\geq$ 
fractional identity to another aligned sequence.  Return
the filtered alignment in <*ret_newmsa>.  The original
 is not changed.

When a pair of sequences has $\geq$  fractional
identity, the default rule for which of them we keep
differs depending on whether the  is in digital or
text mode. We typically manipulate biosequence
alignments in digital mode. In digital mode, the default
rule (called "conscover") is to prefer the sequence with
an alignment span that covers more consensus columns.
(Where "span" is defined by the column coordinates of
the leftmost and rightmost aligned residues of the
sequence; fragment definition rules also use the concept
of "span".)  In the simpler text mode, the rule is to
keep the earlier sequence and discard the later, in the
order the seqs come in the alignment. The conscover rule
is designed to avoid keeping fragments, while trying not
to bias the insertion/deletion statistics of the
filtered alignment. To use different preference rules in
digital mode alignments, see the more customizable
.

Fractional identity is calculated by
, which defines the denominator of
the calculation as MIN(rlen1, rlen2).

Unparsed Stockholm markup is not propagated into the new
filtered alignment.

 on success, and <*ret_newmsa> is the filtered
alignment.

 on allocation error.  if a pairwise
identity calculation fails because of corrupted sequence
data. In either case, the  is unmodified.


esl_msaweight_IDFilter () Synopsis : Filter by %ID . Remove sequences in that are $ \ geq$ fractional identity to another aligned sequence . Return the filtered alignment in < * ret_newmsa > . The original is not changed . When a pair of sequences has $ \ geq$ fractional identity the default rule for which of them we keep differs depending on whether the is in digital or text mode . We typically manipulate biosequence alignments in digital mode . In digital mode the default rule ( called " conscover " ) is to prefer the sequence with an alignment span that covers more consensus columns . ( Where " span " is defined by the column coordinates of the leftmost and rightmost aligned residues of the sequence ; fragment definition rules also use the concept of " span " . ) In the simpler text mode the rule is to keep the earlier sequence and discard the later in the order the seqs come in the alignment . The conscover rule is designed to avoid keeping fragments while trying not to bias the insertion / deletion statistics of the filtered alignment . To use different preference rules in digital mode alignments see the more customizable . Fractional identity is calculated by which defines the denominator of the calculation as MIN ( rlen1 rlen2 ) . Unparsed Stockholm markup is not propagated into the new filtered alignment . on success and < * ret_newmsa > is the filtered alignment . on allocation error . if a pairwise identity calculation fails because of corrupted sequence data . In either case the is unmodified .
int
esl_msaweight_IDFilter(const ESL_MSA *msa, double maxid, ESL_MSA **ret_newmsa)
{
  if (msa->flags & eslMSA_DIGITAL) return esl_msaweight_IDFilter_adv(NULL, msa, maxid, ret_newmsa);
  else                             return msaweight_IDFilter_txt    (      msa, maxid, ret_newmsa);
}
int esl_msaweight_IDFilter ( const ESL_MSA * msa , double maxid , ESL_MSA * * ret_newmsa ) { if ( msa -> flags & eslMSA_DIGITAL ) return esl_msaweight_IDFilter_adv ( NULL , msa , maxid , ret_newmsa ) ; else return msaweight_IDFilter_txt ( msa , maxid , ret_newmsa ) ; }
Function:  esl_msaweight_IDFilter()
 Synopsis:  Filter by %ID.
Function : esl_msaweight_IDFilter () Synopsis : Filter by %ID .