FastqPuri
fa_read.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (C) 2017 by Paula Perez Rubio *
3  * *
4  * This file is part of FastqPuri. *
5  * *
6  * FastqPuri is free software: you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as *
8  * published by the Free Software Foundation, either version 3 of the *
9  * License, or (at your option) any later version. *
10  * *
11  * FastqPuri is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with FastqPuri. *
18  * If not, see <http://www.gnu.org/licenses/>. *
19  ****************************************************************************/
20 
30 #ifndef FA_READ_H_
31 #define FA_READ_H_
32 
33 #include <stdint.h>
34 
38 typedef struct _fa_entry {
39  uint64_t N;
40  char *seq;
41 } Fa_entry;
42 
46 typedef struct _fa_data {
47  uint64_t nlines;
48  int nentries;
49  int linelen;
50  uint64_t *entrylen;
52 } Fa_data;
53 
54 int read_fasta(char *filename, Fa_data *ptr_fa);
55 uint64_t size_fasta(Fa_data *ptr_fa);
56 uint64_t nkmers(Fa_data *ptr_fa, int kmersize);
57 void free_fasta(Fa_data *ptr_fa);
58 
59 // static functions:
60 // static int ignore_line(char *line)
61 // static void init_fa(Fa_data *ptr_fa)
62 // static voiid realloc_fa(Fa_data *ptr_fa)
63 // static voiid init_entries(Fa_data *ptr_fa)
64 // static uint64_t swee_fa(char *filename, Fa_data *ptr_fa)
65 
66 
67 #endif // endif FA_READ_H_
uint64_t N
Definition: fa_read.h:39
int linelen
Definition: fa_read.h:49
stores sequences of a fasta file
Definition: fa_read.h:46
Fa_entry * entry
Definition: fa_read.h:51
uint64_t * entrylen
Definition: fa_read.h:50
uint64_t nlines
Definition: fa_read.h:47
int read_fasta(char *filename, Fa_data *ptr_fa)
reads a fasta file and stores the contents in a Fa_data structure.
Definition: fa_read.c:212
struct _fa_entry Fa_entry
fasta entry
void free_fasta(Fa_data *ptr_fa)
free fasta file
Definition: fa_read.c:311
uint64_t size_fasta(Fa_data *ptr_fa)
computes length of genome in fasta structure
Definition: fa_read.c:281
char * seq
Definition: fa_read.h:40
fasta entry
Definition: fa_read.h:38
int nentries
Definition: fa_read.h:48
uint64_t nkmers(Fa_data *ptr_fa, int kmersize)
number of kmers of length kmersize contained in a fasta structure
Definition: fa_read.c:295
struct _fa_data Fa_data
stores sequences of a fasta file