-rw-r--r-- | src/aggregator.c | 10 | ||||
-rw-r--r-- | src/assign/assign_protein_type.c | 24 | ||||
-rw-r--r-- | src/error/check_h5_error.c | 2 | ||||
-rw-r--r-- | src/error/check_h5_error.h | 2 | ||||
-rw-r--r-- | src/load/load_influenza_aa_dat.c | 12 | ||||
-rw-r--r-- | src/load/load_influenza_faa.c | 12 | ||||
-rw-r--r-- | src/updator.c | 4 |
7 files changed, 35 insertions, 31 deletions
diff --git a/src/aggregator.c b/src/aggregator.c index 4c4ca8e..200de7d 100644 --- a/src/aggregator.c +++ b/src/aggregator.c | |||
@@ -9,8 +9,8 @@ | |||
9 | #include <stdio.h> | 9 | #include <stdio.h> |
10 | 10 | ||
11 | #define H5FILE "influenza.h5" | 11 | #define H5FILE "influenza.h5" |
12 | #define INFLUENZA_AA_DAT "/home/don/exp004/genomes/INFLUENZA/influenza_aa.dat" | 12 | #define INFLUENZA_AA_DAT "/u/ac/dpellegr/Documents/exp004/genomes/INFLUENZA/influenza_aa.dat" |
13 | #define INFLUENZA_FAA "/home/don/exp004/genomes/INFLUENZA/influenza.faa" | 13 | #define INFLUENZA_FAA "/u/ac/dpellegr/Documents/exp004/genomes/INFLUENZA/influenza.faa" |
14 | 14 | ||
15 | int | 15 | int |
16 | main () | 16 | main () |
@@ -25,14 +25,14 @@ main () | |||
25 | { | 25 | { |
26 | file_id = H5Fcreate (H5FILE, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); | 26 | file_id = H5Fcreate (H5FILE, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); |
27 | if (file_id < 0) | 27 | if (file_id < 0) |
28 | check_h5_error (file_id, __FILE__, __LINE__); | 28 | check_h5_error (__FILE__, __LINE__); |
29 | } | 29 | } |
30 | else | 30 | else |
31 | { | 31 | { |
32 | fclose (f); | 32 | fclose (f); |
33 | file_id = H5Fopen (H5FILE, H5F_ACC_RDWR, H5P_DEFAULT); | 33 | file_id = H5Fopen (H5FILE, H5F_ACC_RDWR, H5P_DEFAULT); |
34 | if (file_id < 0) | 34 | if (file_id < 0) |
35 | check_h5_error (file_id, __FILE__, __LINE__); | 35 | check_h5_error (__FILE__, __LINE__); |
36 | } | 36 | } |
37 | 37 | ||
38 | /* | 38 | /* |
@@ -53,7 +53,7 @@ main () | |||
53 | */ | 53 | */ |
54 | herr_t status = H5Fclose (file_id); | 54 | herr_t status = H5Fclose (file_id); |
55 | if (status < 0) | 55 | if (status < 0) |
56 | check_h5_error (status, __FILE__, __LINE__); | 56 | check_h5_error (__FILE__, __LINE__); |
57 | 57 | ||
58 | return 0; | 58 | return 0; |
59 | } | 59 | } |
diff --git a/src/assign/assign_protein_type.c b/src/assign/assign_protein_type.c index 1df4c8d..065880f 100644 --- a/src/assign/assign_protein_type.c +++ b/src/assign/assign_protein_type.c | |||
@@ -19,12 +19,12 @@ | |||
19 | /* | 19 | /* |
20 | * BLAST database containing all of the influenza protein sequences. | 20 | * BLAST database containing all of the influenza protein sequences. |
21 | */ | 21 | */ |
22 | #define SEQDB "/home/don/exp004/influenzadb/influenzadb" | 22 | #define SEQDB "/u/ac/dpellegr/Documents/exp004/influenzadb/influenzadb" |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * BLAST reference database of prototypical protein types. | 25 | * BLAST reference database of prototypical protein types. |
26 | */ | 26 | */ |
27 | #define REFDB "/home/don/exp004/influenzadb/proteinnames" | 27 | #define REFDB "/u/ac/dpellegr/Documents/exp004/influenzadb/proteinnames" |
28 | 28 | ||
29 | #define BUFFER_LEN 50 | 29 | #define BUFFER_LEN 50 |
30 | 30 | ||
@@ -68,7 +68,7 @@ assign_protein_type (hid_t file_id) | |||
68 | herr_t status = H5TBget_table_info (file_id, "influenza.faa", &faa_nfields, | 68 | herr_t status = H5TBget_table_info (file_id, "influenza.faa", &faa_nfields, |
69 | &faa_nrecords); | 69 | &faa_nrecords); |
70 | if (status < 0) | 70 | if (status < 0) |
71 | check_h5_error (status, __FILE__, __LINE__); | 71 | check_h5_error (__FILE__, __LINE__); |
72 | 72 | ||
73 | sequence_data *faa_buf = malloc (sizeof (sequence_data) * faa_nrecords); | 73 | sequence_data *faa_buf = malloc (sizeof (sequence_data) * faa_nrecords); |
74 | 74 | ||
@@ -81,7 +81,7 @@ assign_protein_type (hid_t file_id) | |||
81 | status = H5TBread_table (file_id, "influenza.faa", faa_size, faa_offset, | 81 | status = H5TBread_table (file_id, "influenza.faa", faa_size, faa_offset, |
82 | faa_sizes, faa_buf); | 82 | faa_sizes, faa_buf); |
83 | if (status < 0) | 83 | if (status < 0) |
84 | check_h5_error (status, __FILE__, __LINE__); | 84 | check_h5_error (__FILE__, __LINE__); |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * Allocate memory for the new table. | 87 | * Allocate memory for the new table. |
@@ -115,7 +115,7 @@ assign_protein_type (hid_t file_id) | |||
115 | status = H5TBget_table_info (file_id, "gi_type_data", &gi_nfields, | 115 | status = H5TBget_table_info (file_id, "gi_type_data", &gi_nfields, |
116 | &gi_nrecords); | 116 | &gi_nrecords); |
117 | if (status < 0) | 117 | if (status < 0) |
118 | check_h5_error (status, __FILE__, __LINE__); | 118 | check_h5_error (__FILE__, __LINE__); |
119 | 119 | ||
120 | printf (" Using gi_type_data cache of %i records.\n", | 120 | printf (" Using gi_type_data cache of %i records.\n", |
121 | (int) gi_nrecords); | 121 | (int) gi_nrecords); |
@@ -125,11 +125,11 @@ assign_protein_type (hid_t file_id) | |||
125 | status = H5TBread_table (file_id, "gi_type_data", gi_size, gi_offset, | 125 | status = H5TBread_table (file_id, "gi_type_data", gi_size, gi_offset, |
126 | gi_sizes, old_buf); | 126 | gi_sizes, old_buf); |
127 | if (status < 0) | 127 | if (status < 0) |
128 | check_h5_error (status, __FILE__, __LINE__); | 128 | check_h5_error (__FILE__, __LINE__); |
129 | 129 | ||
130 | status = H5TBdelete_record (file_id, "gi_type_data", 0, gi_nrecords); | 130 | status = H5TBdelete_record (file_id, "gi_type_data", 0, gi_nrecords); |
131 | if (status < 0) | 131 | if (status < 0) |
132 | check_h5_error (status, __FILE__, __LINE__); | 132 | check_h5_error (__FILE__, __LINE__); |
133 | 133 | ||
134 | } | 134 | } |
135 | 135 | ||
@@ -155,7 +155,7 @@ assign_protein_type (hid_t file_id) | |||
155 | gi_offset, gi_field_type, | 155 | gi_offset, gi_field_type, |
156 | chunk_size, fill_data, compress, NULL); | 156 | chunk_size, fill_data, compress, NULL); |
157 | if (status < 0) | 157 | if (status < 0) |
158 | check_h5_error (status, __FILE__, __LINE__); | 158 | check_h5_error (__FILE__, __LINE__); |
159 | 159 | ||
160 | } | 160 | } |
161 | 161 | ||
@@ -295,11 +295,11 @@ assign_protein_type (hid_t file_id) | |||
295 | gi_size, gi_offset, gi_sizes, | 295 | gi_size, gi_offset, gi_sizes, |
296 | &new_buf[i - 1000]); | 296 | &new_buf[i - 1000]); |
297 | if (status < 0) | 297 | if (status < 0) |
298 | check_h5_error (status, __FILE__, __LINE__); | 298 | check_h5_error (__FILE__, __LINE__); |
299 | 299 | ||
300 | status = H5Fflush (file_id, H5F_SCOPE_GLOBAL); | 300 | status = H5Fflush (file_id, H5F_SCOPE_GLOBAL); |
301 | if (status < 0) | 301 | if (status < 0) |
302 | check_h5_error (status, __FILE__, __LINE__); | 302 | check_h5_error (__FILE__, __LINE__); |
303 | 303 | ||
304 | written = i; | 304 | written = i; |
305 | 305 | ||
@@ -326,11 +326,11 @@ assign_protein_type (hid_t file_id) | |||
326 | } | 326 | } |
327 | 327 | ||
328 | if (status < 0) | 328 | if (status < 0) |
329 | check_h5_error (status, __FILE__, __LINE__); | 329 | check_h5_error (__FILE__, __LINE__); |
330 | 330 | ||
331 | status = H5Fflush (file_id, H5F_SCOPE_GLOBAL); | 331 | status = H5Fflush (file_id, H5F_SCOPE_GLOBAL); |
332 | if (status < 0) | 332 | if (status < 0) |
333 | check_h5_error (status, __FILE__, __LINE__); | 333 | check_h5_error (__FILE__, __LINE__); |
334 | 334 | ||
335 | free (faa_buf); | 335 | free (faa_buf); |
336 | free (old_buf); | 336 | free (old_buf); |
diff --git a/src/error/check_h5_error.c b/src/error/check_h5_error.c index d90b21f..30183fe 100644 --- a/src/error/check_h5_error.c +++ b/src/error/check_h5_error.c | |||
@@ -3,7 +3,7 @@ | |||
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | 4 | ||
5 | void | 5 | void |
6 | check_h5_error (herr_t status, const char *filename, unsigned int linenum) | 6 | check_h5_error (const char *filename, unsigned int linenum) |
7 | { | 7 | { |
8 | error_at_line (EXIT_FAILURE, 0, filename, linenum, | 8 | error_at_line (EXIT_FAILURE, 0, filename, linenum, |
9 | "An error has been reported by the HDF5 API."); | 9 | "An error has been reported by the HDF5 API."); |
diff --git a/src/error/check_h5_error.h b/src/error/check_h5_error.h index e460e97..fa93c6b 100644 --- a/src/error/check_h5_error.h +++ b/src/error/check_h5_error.h | |||
@@ -7,6 +7,6 @@ | |||
7 | * Handle errors from the HDF5 API. | 7 | * Handle errors from the HDF5 API. |
8 | */ | 8 | */ |
9 | void | 9 | void |
10 | check_h5_error (herr_t status, const char *filename, unsigned int linenum); | 10 | check_h5_error (const char *filename, unsigned int linenum); |
11 | 11 | ||
12 | #endif // CHECK_H5_ERROR_H | 12 | #endif // CHECK_H5_ERROR_H |
diff --git a/src/load/load_influenza_aa_dat.c b/src/load/load_influenza_aa_dat.c index b50fcab..bbd4f8b 100644 --- a/src/load/load_influenza_aa_dat.c +++ b/src/load/load_influenza_aa_dat.c | |||
@@ -5,12 +5,14 @@ | |||
5 | * todo: Handle NULL values occuring in numeric fields. | 5 | * todo: Handle NULL values occuring in numeric fields. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define _GNU_SOURCE | ||
8 | #include "load_influenza_aa_dat.h" | 9 | #include "load_influenza_aa_dat.h" |
9 | #include "error/check_error.h" | 10 | #include "error/check_error.h" |
10 | #include "error/check_h5_error.h" | 11 | #include "error/check_h5_error.h" |
11 | #include <hdf5_hl.h> | 12 | #include <hdf5_hl.h> |
12 | #include <string.h> | 13 | #include <string.h> |
13 | #include <stdlib.h> | 14 | #include <stdlib.h> |
15 | #include <stdio.h> | ||
14 | 16 | ||
15 | #define NFIELDS (hsize_t) 11 | 17 | #define NFIELDS (hsize_t) 11 |
16 | 18 | ||
@@ -223,18 +225,18 @@ load_influenza_aa_dat (hid_t file_id, const char *file_name) | |||
223 | herr_t status = H5TBget_table_info (file_id, "influenza_aa.dat", | 225 | herr_t status = H5TBget_table_info (file_id, "influenza_aa.dat", |
224 | &nfields, &nrecords); | 226 | &nfields, &nrecords); |
225 | if (status < 0) | 227 | if (status < 0) |
226 | check_h5_error (status, __FILE__, __LINE__); | 228 | check_h5_error (__FILE__, __LINE__); |
227 | 229 | ||
228 | status = | 230 | status = |
229 | H5TBdelete_record (file_id, "influenza_aa.dat", 0, nrecords); | 231 | H5TBdelete_record (file_id, "influenza_aa.dat", 0, nrecords); |
230 | if (status < 0) | 232 | if (status < 0) |
231 | check_h5_error (status, __FILE__, __LINE__); | 233 | check_h5_error (__FILE__, __LINE__); |
232 | 234 | ||
233 | status = | 235 | status = |
234 | H5TBappend_records (file_id, "influenza_aa.dat", 1, dst_size, | 236 | H5TBappend_records (file_id, "influenza_aa.dat", 1, dst_size, |
235 | dst_offset, dst_sizes, &p_data); | 237 | dst_offset, dst_sizes, &p_data); |
236 | if (status < 0) | 238 | if (status < 0) |
237 | check_h5_error (status, __FILE__, __LINE__); | 239 | check_h5_error (__FILE__, __LINE__); |
238 | } | 240 | } |
239 | 241 | ||
240 | /* | 242 | /* |
@@ -250,7 +252,7 @@ load_influenza_aa_dat (hid_t file_id, const char *file_name) | |||
250 | chunk_size, fill_data, compress, | 252 | chunk_size, fill_data, compress, |
251 | &p_data); | 253 | &p_data); |
252 | if (status < 0) | 254 | if (status < 0) |
253 | check_h5_error (status, __FILE__, __LINE__); | 255 | check_h5_error (__FILE__, __LINE__); |
254 | } | 256 | } |
255 | } | 257 | } |
256 | 258 | ||
@@ -260,7 +262,7 @@ load_influenza_aa_dat (hid_t file_id, const char *file_name) | |||
260 | H5TBappend_records (file_id, "influenza_aa.dat", 1, dst_size, | 262 | H5TBappend_records (file_id, "influenza_aa.dat", 1, dst_size, |
261 | dst_offset, dst_sizes, &p_data); | 263 | dst_offset, dst_sizes, &p_data); |
262 | if (status < 0) | 264 | if (status < 0) |
263 | check_h5_error (status, __FILE__, __LINE__); | 265 | check_h5_error (__FILE__, __LINE__); |
264 | } | 266 | } |
265 | 267 | ||
266 | if (running) | 268 | if (running) |
diff --git a/src/load/load_influenza_faa.c b/src/load/load_influenza_faa.c index 80eb3ae..0026d11 100644 --- a/src/load/load_influenza_faa.c +++ b/src/load/load_influenza_faa.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #define _GNU_SOURCE | ||
1 | #include "error/check_error.h" | 2 | #include "error/check_error.h" |
2 | #include "error/check_h5_error.h" | 3 | #include "error/check_h5_error.h" |
3 | #include "load_influenza_faa.h" | 4 | #include "load_influenza_faa.h" |
@@ -6,6 +7,7 @@ | |||
6 | #include <hdf5_hl.h> | 7 | #include <hdf5_hl.h> |
7 | #include <string.h> | 8 | #include <string.h> |
8 | #include <stdlib.h> | 9 | #include <stdlib.h> |
10 | #include <stdio.h> | ||
9 | 11 | ||
10 | void | 12 | void |
11 | load_influenza_faa (hid_t file_id, const char *file_name) | 13 | load_influenza_faa (hid_t file_id, const char *file_name) |
@@ -72,18 +74,18 @@ load_influenza_faa (hid_t file_id, const char *file_name) | |||
72 | H5TBget_table_info (file_id, "influenza.faa", &nfields, | 74 | H5TBget_table_info (file_id, "influenza.faa", &nfields, |
73 | &nrecords); | 75 | &nrecords); |
74 | if (status < 0) | 76 | if (status < 0) |
75 | check_h5_error (status, __FILE__, __LINE__); | 77 | check_h5_error (__FILE__, __LINE__); |
76 | 78 | ||
77 | status = | 79 | status = |
78 | H5TBdelete_record (file_id, "influenza.faa", 0, nrecords); | 80 | H5TBdelete_record (file_id, "influenza.faa", 0, nrecords); |
79 | if (status < 0) | 81 | if (status < 0) |
80 | check_h5_error (status, __FILE__, __LINE__); | 82 | check_h5_error (__FILE__, __LINE__); |
81 | 83 | ||
82 | status = | 84 | status = |
83 | H5TBappend_records (file_id, "influenza.faa", 1, dst_size, | 85 | H5TBappend_records (file_id, "influenza.faa", 1, dst_size, |
84 | dst_offset, dst_sizes, &p_data); | 86 | dst_offset, dst_sizes, &p_data); |
85 | if (status < 0) | 87 | if (status < 0) |
86 | check_h5_error (status, __FILE__, __LINE__); | 88 | check_h5_error (__FILE__, __LINE__); |
87 | } | 89 | } |
88 | 90 | ||
89 | /* | 91 | /* |
@@ -101,7 +103,7 @@ load_influenza_faa (hid_t file_id, const char *file_name) | |||
101 | compress, | 103 | compress, |
102 | &p_data); | 104 | &p_data); |
103 | if (status < 0) | 105 | if (status < 0) |
104 | check_h5_error (status, __FILE__, __LINE__); | 106 | check_h5_error (__FILE__, __LINE__); |
105 | } | 107 | } |
106 | } | 108 | } |
107 | 109 | ||
@@ -111,7 +113,7 @@ load_influenza_faa (hid_t file_id, const char *file_name) | |||
111 | H5TBappend_records (file_id, "influenza.faa", 1, dst_size, | 113 | H5TBappend_records (file_id, "influenza.faa", 1, dst_size, |
112 | dst_offset, dst_sizes, &p_data); | 114 | dst_offset, dst_sizes, &p_data); |
113 | if (status < 0) | 115 | if (status < 0) |
114 | check_h5_error (status, __FILE__, __LINE__); | 116 | check_h5_error (__FILE__, __LINE__); |
115 | } | 117 | } |
116 | 118 | ||
117 | if (running) | 119 | if (running) |
diff --git a/src/updator.c b/src/updator.c index 9a5ad18..f93e205 100644 --- a/src/updator.c +++ b/src/updator.c | |||
@@ -17,7 +17,7 @@ main () | |||
17 | */ | 17 | */ |
18 | hid_t file_id = H5Fopen (FILE, H5F_ACC_RDWR, H5P_DEFAULT); | 18 | hid_t file_id = H5Fopen (FILE, H5F_ACC_RDWR, H5P_DEFAULT); |
19 | if (file_id < 0) | 19 | if (file_id < 0) |
20 | check_h5_error (file_id, __FILE__, __LINE__); | 20 | check_h5_error (__FILE__, __LINE__); |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * Assign protein type values to the sequence records. | 23 | * Assign protein type values to the sequence records. |
@@ -29,7 +29,7 @@ main () | |||
29 | */ | 29 | */ |
30 | herr_t status = H5Fclose (file_id); | 30 | herr_t status = H5Fclose (file_id); |
31 | if (status < 0) | 31 | if (status < 0) |
32 | check_h5_error (status, __FILE__, __LINE__); | 32 | check_h5_error (__FILE__, __LINE__); |
33 | 33 | ||
34 | return 0; | 34 | return 0; |
35 | } | 35 | } |