hmmer-3.3/easel/esl_sqio_ncbi.c
/* Function:  sqncbi_ReadSequence()
 * Synopsis:  Read the sequence, not the sequence header.
 * Incept:    MSF, Mon Dec 10, 2009 [Janelia]
 *
 * Purpose:   Read the next sequence from open sequence file <sqfp>,
 *            but not the header information.  Upon successful return,
 *            <s> holds all the sequence.
 *            
 *            This is useful reading binary formats and delaying the
 *            over heads of reading the sequence name until needed by
 *            the report generator.
 *
 * Returns:   <eslOK> on success; the new sequence is stored in <s>.
 * 
 *            Returns <eslEOF> when there is no sequence left in the
 *            file (including first attempt to read an empty file).
 *
 * Throws:    <eslEMEM> on allocation failure;
 */
sqncbi_ReadSequence()
Synopsis:  Read the sequence, not the sequence header.
Incept:    MSF, Mon Dec 10, 2009 [Janelia]

Read the next sequence from open sequence file ,
but not the header information.  Upon successful return,
 holds all the sequence.

This is useful reading binary formats and delaying the
over heads of reading the sequence name until needed by
the report generator.

 on success; the new sequence is stored in .

Returns  when there is no sequence left in the
file (including first attempt to read an empty file).

 on allocation failure.
sqncbi_ReadSequence () Synopsis : Read the sequence not the sequence header . Incept : MSF Mon Dec 10 2009 [ Janelia ] Read the next sequence from open sequence file but not the header information . Upon successful return holds all the sequence . This is useful reading binary formats and delaying the over heads of reading the sequence name until needed by the report generator . on success ; the new sequence is stored in . Returns when there is no sequence left in the file ( including first attempt to read an empty file ) . on allocation failure .
static int
sqncbi_ReadSequence(ESL_SQFILE *sqfp, ESL_SQ *sq)
{
  int    status;
  ESL_SQNCBI_DATA *ncbi = &sqfp->data.ncbi;
  if (ncbi->index >= ncbi->num_seq) return eslEOF;
  if ((status = pos_sequence(ncbi, ncbi->index)) != eslOK) return status;
  sq->idx  = ncbi->index;
  sq->roff = ncbi->roff;
  sq->doff = ncbi->doff;
  sq->hoff = ncbi->hoff;
  sq->eoff = ncbi->eoff;
  reset_header_values(ncbi);
  if (ncbi->alphatype == eslAMINO) 
    status = read_amino(sqfp, sq);
  else                             
    status = read_dna(sqfp, sq);
  if (status != eslOK) return status;
  (ncbi->index)++;
  return eslOK;
}
static int sqncbi_ReadSequence ( ESL_SQFILE * sqfp , ESL_SQ * sq ) { int status ; ESL_SQNCBI_DATA * ncbi = & sqfp -> data . ncbi ; if ( ncbi -> index >= ncbi -> num_seq ) return eslEOF ; if ( ( status = pos_sequence ( ncbi , ncbi -> index ) ) != eslOK ) return status ; sq -> idx = ncbi -> index ; sq -> roff = ncbi -> roff ; sq -> doff = ncbi -> doff ; sq -> hoff = ncbi -> hoff ; sq -> eoff = ncbi -> eoff ; reset_header_values ( ncbi ) ; if ( ncbi -> alphatype == eslAMINO ) status = read_amino ( sqfp , sq ) ; else status = read_dna ( sqfp , sq ) ; if ( status != eslOK ) return status ; ( ncbi -> index ) ++ ; return eslOK ; }
Function:  sqncbi_ReadSequence()
 Synopsis:  Read the sequence, not the sequence header.
Function : sqncbi_ReadSequence () Synopsis : Read the sequence not the sequence header .
//int    index; //index = ncbi->index + 1; /* Disk offset bookkeeping */