libuproc  1.2.0
seqio.h
Go to the documentation of this file.
1 /* Copyright 2014 Peter Meinicke, Robin Martinjak
2  *
3  * This file is part of libuproc.
4  *
5  * libuproc is free software: you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License as published by the Free
7  * Software Foundation, either version 3 of the License, or (at your option)
8  * any later version.
9  *
10  * libuproc is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libuproc. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
30 #ifndef UPROC_FASTA_H
31 #define UPROC_FASTA_H
32 
33 #include <stdlib.h>
34 #include <stdio.h>
35 #include <stdbool.h>
36 
37 #include "uproc/io.h"
38 
48 {
50  char *header;
51 
53  char *data;
54 
63  long offset;
64 };
65 
67 #define UPROC_SEQUENCE_INITIALIZER \
68  { \
69  NULL, NULL, 0 \
70  }
71 
73 void uproc_sequence_init(struct uproc_sequence *seq);
74 
76 void uproc_sequence_free(struct uproc_sequence *seq);
77 
79 int uproc_sequence_copy(struct uproc_sequence *dest,
80  const struct uproc_sequence *src);
90 typedef struct uproc_seqiter_s uproc_seqiter;
91 
93 uproc_seqiter *uproc_seqiter_create(uproc_io_stream *stream);
94 
95 void uproc_seqiter_destroy(uproc_seqiter *iter);
96 
97 int uproc_seqiter_next(uproc_seqiter *iter, struct uproc_sequence *seq);
100 void uproc_seqio_write_fasta(uproc_io_stream *stream, const char *header,
101  const char *seq, int width);
102 
107 #endif
char * header
Sequence identifier.
Definition: seqio.h:50
DNA/RNA or protein sequence.
Definition: seqio.h:47
Module: General IO.
long offset
Position in the file.
Definition: seqio.h:63
char * data
Sequence data.
Definition: seqio.h:53
uproc_seqiter * uproc_seqiter_create(uproc_io_stream *stream)
Create new sequence iterator.
int uproc_sequence_copy(struct uproc_sequence *dest, const struct uproc_sequence *src)
Deep-copy a uproc_sequence struct.
void uproc_sequence_init(struct uproc_sequence *seq)
Initialize a uproc_sequence struct.
Optionally compressed I/O stream.
void uproc_sequence_free(struct uproc_sequence *seq)
Free allocated pointers of a uproc_sequence struct.