GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
bl_fasta_read(3) FreeBSD Library Functions Manual bl_fasta_read(3)

#include <biolibc/fasta.h>
-lbiolibc -lxtend

int bl_fasta_read(bl_fasta_t *record, FILE *fasta_stream)

fasta_stream    FILE stream from which FASTA data are read
record          Pointer to a bl_fasta_t structure to receive data

Read a FASTA record from a FILE stream. Each record must begin with a description line (beginning with '>'), which is then followed by one or more lines of sequence data. The end of the sequence is marked either by the next description line or EOF. If desc_len and seq_len are 0 (e.g. the structure is initialized with BL_FASTA_INIT or bl_fasta_init(3), or has been freed with bl_fasta_free(3), then memory is allocated for the description and sequence.

Otherwise, the existing allocated buffers are reused. Hence, when reading many FASTA records of the same length, only one allocation is needed. In any case, the buffers are automatically enlarged if they become full and automatically trimmed to the actual data size after reading is complete.

Buffer memory should be freed as soon as possible by calling bl_fasta_free(3).

BL_READ_OK upon successful read of description and sequence BL_READ_BAD_DATA if something is amiss with input format BL_READ_EOF if no more data are available

bl_fasta_t  rec = BL_FASTA_INIT;
while ( bl_fasta_read(stdin, &rec) != BL_READ_EOF )
    bl_fasta_write(stdout, &rec, BL_FASTA_LINE_UNLIMITED);
bl_fasta_free(&rec);

bl_fasta_write(3), bl_fastq_read(3), bl_fastq_write(3), bl_fasta_free(3)


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.