hmmer-3.3/easel/esl_sqio.c
/* Function:  esl_sqio_AcceptAs()
 * Synopsis:  Map a list of additional characters.
 *
 * Purpose:   Set the input map of the open <sqfp> to allow the 
 *            characters in the string <xchars> to appear in 
 *            input sequences. These characters will all be 
 *            mapped to the character <readas> (or, for digital
 *            sequence input, to the digitized representation 
 *            of the text character <readas> in the <sqfp>'s
 *            digital alphabet).
 *            
 *            For example, an application might want to read
 *            '*' as 'X' when reading translated peptide files
 *            that use '*' to indicate a stop codon.
 *
 * Returns:   <eslOK> on success.
 */
esl_sqio_AcceptAs()
Synopsis:  Map a list of additional characters.

Set the input map of the open  to allow the
characters in the string  to appear in
input sequences. These characters will all be
mapped to the character  (or, for digital
sequence input, to the digitized representation
of the text character  in the 's
digital alphabet).



 on success.
esl_sqio_AcceptAs () Synopsis : Map a list of additional characters . Set the input map of the open to allow the characters in the string to appear in input sequences . These characters will all be mapped to the character ( or for digital sequence input to the digitized representation of the text character in the ' s digital alphabet ) . on success .
int
esl_sqio_AcceptAs(ESL_SQFILE *sqfp, char *xchars, char readas)
{
  int i;
  if (sqfp->do_digital)
    {
      for (i = 0; xchars[i] != '\0'; i++)
	sqfp->inmap[(int) xchars[i]] = esl_abc_DigitizeSymbol(sqfp->abc, readas);
    }
  if (! sqfp->do_digital)
    {
      for (i = 0; xchars[i] != '\0'; i++)
	sqfp->inmap[(int) xchars[i]] = readas;
    }
  return eslOK;
}
int esl_sqio_AcceptAs ( ESL_SQFILE * sqfp , char * xchars , char readas ) { int i ; if ( sqfp -> do_digital ) { for ( i = 0 ; xchars [ i ] != ' \0 ' ; i ++ ) sqfp -> inmap [ ( int ) xchars [ i ] ] = esl_abc_DigitizeSymbol ( sqfp -> abc , readas ) ; } if ( ! sqfp -> do_digital ) { for ( i = 0 ; xchars [ i ] != ' \0 ' ; i ++ ) sqfp -> inmap [ ( int ) xchars [ i ] ] = readas ; } return eslOK ; }
Function:  esl_sqio_AcceptAs()
 Synopsis:  Map a list of additional characters.
Function : esl_sqio_AcceptAs () Synopsis : Map a list of additional characters .