sam.c
/***************************************************************************
 *  Use auto-c2man to generate a man page from this comment
 *
 *  Library:
 *      #include <biolibc/sam.h>
 *      -lbiolibc -lxtend
 *
 *  Description:
 *      Skip over header lines in SAM input stream.  The FILE pointer
 *      sam_stream is advanced to the first character of the first line
 *      after the header.  The header is copied to a temporary file and and
 *      the function returns a FILE pointer to the header stream.
 *
 *  Arguments:
 *      sam_stream  FILE pointer to the open sam file
 *
 *  Returns:
 *      A FILE pointer to a temporary file containing a copy of the header
 *
 *  See also:
 *      bl_sam_read(3), bl_sam_copy_header(3)
 *  
 *  Arguments:
 *
 *  Returns:
 *
 *  Examples:
 *
 *  Files:
 *
 *  Environment
 *
 *  See also:
 *
 *  History: 
 *  Date        Name        Modification
 *  2022-04-08  Jason Bacon Begin
 ***************************************************************************/
Use auto-c2man to generate a man page from this comment
Library:
#include 
-lbiolibc -lxtend

Skip over header lines in SAM input stream.  The FILE pointer
sam_stream is advanced to the first character of the first line
after the header.  The header is copied to a temporary file and and
the function returns a FILE pointer to the header stream.

sam_stream  FILE pointer to the open sam file

A FILE pointer to a temporary file containing a copy of the header











Environment

See also.

Date        Name        Modification
2022-04-08  Jason Bacon Begin
Use auto - c2man to generate a man page from this comment Library : #include - lbiolibc - lxtend Skip over header lines in SAM input stream . The FILE pointer sam_stream is advanced to the first character of the first line after the header . The header is copied to a temporary file and and the function returns a FILE pointer to the header stream . sam_stream FILE pointer to the open sam file A FILE pointer to a temporary file containing a copy of the header Environment See also . Date Name Modification 2022 - 04 - 08 Jason Bacon Begin
FILE    *bl_sam_skip_header(FILE *sam_stream)
{
    int     ch;
    FILE    *header_stream = tmpfile();
    while ( (ch = getc(sam_stream)) == '@' )
    {
	putc(ch, header_stream);
	do
	{
	    ch = getc(sam_stream);
	    putc(ch, header_stream);
	}   while ( (ch != '\n') && (ch != EOF) );
    }
    if ( ch != EOF )
	ungetc(ch, sam_stream);
    rewind(header_stream);
    return header_stream;
}
FILE * bl_sam_skip_header ( FILE * sam_stream ) { int ch ; FILE * header_stream = tmpfile ( ) ; while ( ( ch = getc ( sam_stream ) ) == ' ' ) { putc ( ch , header_stream ) ; do { ch = getc ( sam_stream ) ; putc ( ch , header_stream ) ; } while ( ( ch != ' \n ' ) && ( ch != EOF ) ) ; } if ( ch != EOF ) ungetc ( ch , sam_stream ) ; rewind ( header_stream ) ; return header_stream ; }
Use auto-c2man to generate a man page from this comment
  Library:
      #include <biolibc/sam.h>
      -lbiolibc -lxtend
Use auto - c2man to generate a man page from this comment Library : #include <biolibc / sam . h > - lbiolibc - lxtend
/*
     *  Copy header to a nameless temp file and return the FILE *.
     *  This can be used by tools like peak-classifier to replicate the
     *  header in output files.
     */ // Rewind to start of first non-header line