-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathstats_info.h
83 lines (76 loc) · 3.93 KB
/
stats_info.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/****************************************************************************
* Copyright (C) 2017 by Paula Perez Rubio *
* *
* This file is part of FastqPuri. *
* *
* FastqPuri is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* FastqPuri is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with FastqPuri. *
* If not, see <http://www.gnu.org/licenses/>. *
****************************************************************************/
/**
* @file stats_info.h
* @brief Construct the quality report variables and update them
* @author Paula Perez <[email protected]>
* @date 04.08.2017
*
*
* */
#ifndef STATS_INFO_H_
#define STATS_INFO_H_
#include <stdint.h>
#include <stdlib.h>
#include "fq_read.h"
#include "defines.h"
/**
* @brief stores info needed to create the summary graphs
* */
typedef struct statsinfo {
int read_len; /**< Maximum length of a read */
int ntiles; /**< \# tiles */
int nQ; /**< \# possible quality values */
int zeroQ; /**< \# ASCII integer for phred zero */
int minQ; /**< Minimum quality threshold */
int nLowQprops; /**< Quality values for quality proportion plots, number of values */
int *lowQprops; /**< Quality values for quality proportion plots */
int tile_pos; /**< current tile position */
int nreads; /**< \# reads read till current position. */
int reads_wN; /**< \# reads with N's found till current position */
int sz_lowQ_ACGT_tile; /**< lowQ_ACGT_tile size = ntiles * N_ACGT*/
int sz_ACGT_tile; /**< ACGT_tile size = ntiles * NACGT */
int sz_reads_MlowQ; /**< reads_MlowQ size = read_len + 1 */
int sz_QPosTile_table; /**< QposTile_Table size = ntiles * nQ * read_len */
int sz_ACGT_pos; /**< ACGT_pos size = read_len * N_ACGT */
int *tile_tags; /**< Names of the existing tiles */
int *lane_tags; /**< Names of the existing tiles */
int *qual_tags; /**< Names of the existing qualities */
uint64_t* lowQ_ACGT_tile; /**< \# low Quality A, C, G, T, N per tile */
uint64_t* ACGT_tile; /**< \# A, C, G, T, N per tile, to compute
the fraction of lowQuality bases
per tile and per nucleotide.*/
uint64_t* reads_MlowQ; /**< \# reads with M(position)
lowQuality bases.*/
uint64_t* QPosTile_table; /**< \# bases of a given quality per tile. */
uint64_t* ACGT_pos; /**< \# A, C, G, T, N per position */
} Info;
void init_info(Info* res);
void free_info(Info* res);
void read_info(Info* res, char* file);
void write_info(Info* res, char* file);
void print_info(Info* res, char *infofile);
void get_first_tile(Info* res, Fq_read* seq);
void update_info(Info* res, Fq_read* seq);
int update_ACGT_counts(uint64_t* ACGT_low, char ACGT);
void update_QPosTile_table(Info *res, Fq_read *seq);
void update_ACGT_pos(uint64_t* ACGT_pos, Fq_read *seq);
void resize_info(Info* res);
#endif // endif STATS_INFO_H_