]> git.donarmstrong.com Git - biopieces.git/blob - code_c/Maasha/src/inc/fasta.h
fixed bug in vmatch_index
[biopieces.git] / code_c / Maasha / src / inc / fasta.h
1 #define MAX_SEQ_NAME 1024
2 #define FASTA_BUFFER 256 * 1024
3
4 #define isseq( x ) ( x > 32 && x < 127 ) ? TRUE : FALSE
5
6 /* Structure of a sequence entry. */
7 struct _seq_entry
8 {
9     char   *seq_name;
10     char   *seq;
11     size_t  seq_len;
12 };
13
14 typedef struct _seq_entry seq_entry;
15
16 /* Count all entries in a FASTA file given a file pointer. */
17 size_t fasta_count( FILE *fp );
18
19 /* Get the next FASTA sequence name from a stream. */
20 bool fasta_get_seq_name( FILE *fp, char **seq_name_ppt );
21
22 /* Get next sequence entry from a FASTA file given a file pointer. */
23 bool fasta_get_entry( file_buffer **buffer_ppt, seq_entry **entry );
24
25 /* Output a sequence entry in FASTA format. */
26 void fasta_put_entry( seq_entry *entry );
27
28 /* Get all sequence entries from a FASTA file in a list. */
29 void fasta_get_entries( FILE *fp, struct list **entries );
30
31 /* Output all sequence entries from a list in FASTA format. */
32 void fasta_put_entries( struct list *entries );
33
34 /* Deallocates memory from a seq_entry. */
35 void fasta_free_entry( seq_entry *entry );