hmmer-3.3/easel/esl_sqio_ncbi.c
/* Function:  sqncbi_ReadInfo()
 * Synopsis:  Read sequence info, but not the sequence itself.
 * Incept:    MSF, Mon Dec 10, 2009 [Janelia]
 *
 * Purpose:   Read the next sequence from open sequence file <sqfp>,
 *            but don't store the sequence (or secondary structure).
 *            Upon successful return, <s> holds all the available 
 *            information about the sequence -- its name, accession,
 *            description, and overall length <sq->L>. 
 *            
 *            This is useful for indexing sequence files, where
 *            individual sequences might be ginormous, and we'd rather
 *            avoid reading complete seqs into memory.
 *
 * Returns:   <eslOK> on success.
 */
sqncbi_ReadInfo()
Synopsis:  Read sequence info, but not the sequence itself.
Incept:    MSF, Mon Dec 10, 2009 [Janelia]

Read the next sequence from open sequence file ,
but don't store the sequence (or secondary structure).
Upon successful return,  holds all the available
information about the sequence -- its name, accession,
description, and overall length L>.

This is useful for indexing sequence files, where
individual sequences might be ginormous, and we'd rather
avoid reading complete seqs into memory.

 on success.
sqncbi_ReadInfo () Synopsis : Read sequence info but not the sequence itself . Incept : MSF Mon Dec 10 2009 [ Janelia ] Read the next sequence from open sequence file but don ' t store the sequence ( or secondary structure ) . Upon successful return holds all the available information about the sequence -- its name accession description and overall length L > . This is useful for indexing sequence files where individual sequences might be ginormous and we ' d rather avoid reading complete seqs into memory . on success .
static int
sqncbi_ReadInfo(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;
  sq->L = -1;
  if ((status = parse_header(ncbi, sq)) != eslOK) return status;
  (ncbi->index)++;
  return eslOK;
}
static int sqncbi_ReadInfo ( 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 ; sq -> L = -1 ; if ( ( status = parse_header ( ncbi , sq ) ) != eslOK ) return status ; ( ncbi -> index ) ++ ; return eslOK ; }
Function:  sqncbi_ReadInfo()
 Synopsis:  Read sequence info, but not the sequence itself.
Function : sqncbi_ReadInfo () Synopsis : Read sequence info but not the sequence itself .
//int   index; //index = ncbi->index + 1; /* Disk offset bookkeeping */ /* figure out the sequence length */ /* read and parse the ncbi header */