summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@drexel.edu>2010-01-18 04:22:23 (GMT)
committer Don Pellegrino <don@drexel.edu>2010-01-18 04:22:23 (GMT)
commit6848b5e1aad3265278c728f8ae0849de31de4472 (patch) (unidiff)
tree6e286d2ae4e16deb60fc5d85e92b9bea22679364
parentc9b5307e5d4acd555aaf8629915020e4a70bb652 (diff)
downloadexp007-6848b5e1aad3265278c728f8ae0849de31de4472.zip
exp007-6848b5e1aad3265278c728f8ae0849de31de4472.tar.gz
exp007-6848b5e1aad3265278c728f8ae0849de31de4472.tar.bz2
Moved updating the HDF5 file to a separate driver.
-rw-r--r--src/Makefile.am11
-rw-r--r--src/aggregator.c7
-rw-r--r--src/updator.c33
3 files changed, 43 insertions, 8 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index fcbcdd5..a7e6852 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,15 +1,18 @@
1bin_PROGRAMS = aggregator1bin_PROGRAMS = aggregator updator
22
3aggregator_SOURCES = \3aggregator_SOURCES = \
4 aggregator.c \4 aggregator.c \
5 assign_protein_type.c \
6 check_error.c \5 check_error.c \
7 check_h5_error.c \6 check_h5_error.c \
8 check_ncbi_error.c \
9 load_influenza_aa_dat.c \7 load_influenza_aa_dat.c \
10 load_influenza_faa.c8 load_influenza_faa.c
119
12aggregator_LDADD = -lhdf510updator_SOURCES = \
11 updator.c \
12 check_error.c \
13 check_h5_error.c \
14 check_ncbi_error.c \
15 assign_protein_type.c
1316
14noinst_HEADERS = \17noinst_HEADERS = \
15 assign_protein_type.h \18 assign_protein_type.h \
diff --git a/src/aggregator.c b/src/aggregator.c
index 36ea18c..07aba39 100644
--- a/src/aggregator.c
+++ b/src/aggregator.c
@@ -3,7 +3,6 @@
3 * container.3 * container.
4 */4 */
55
6#include "assign_protein_type.h"
7#include "check_h5_error.h"6#include "check_h5_error.h"
8#include "load_influenza_aa_dat.h"7#include "load_influenza_aa_dat.h"
9#include "load_influenza_faa.h"8#include "load_influenza_faa.h"
@@ -17,6 +16,8 @@ main ()
17 * Create the HDF5 file.16 * Create the HDF5 file.
18 */17 */
19 hid_t file_id = H5Fcreate (FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);18 hid_t file_id = H5Fcreate (FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
19 if (file_id < 0)
20 check_h5_error (file_id, __FILE__, __LINE__);
2021
21 /*22 /*
22 * Load the supplementary protein data file.23 * Load the supplementary protein data file.
@@ -29,13 +30,11 @@ main ()
29 load_influenza_faa (file_id);30 load_influenza_faa (file_id);
3031
31 /*32 /*
32 * Close the HD5 file.33 * Close the HDF5 file.
33 */34 */
34 herr_t status = H5Fclose (file_id);35 herr_t status = H5Fclose (file_id);
35 if (status < 0)36 if (status < 0)
36 check_h5_error (status, __FILE__, __LINE__);37 check_h5_error (status, __FILE__, __LINE__);
3738
38 // assign_protein_type (0);
39
40 return 0;39 return 0;
41}40}
diff --git a/src/updator.c b/src/updator.c
new file mode 100644
index 0000000..8d556da
--- a/dev/null
+++ b/src/updator.c
@@ -0,0 +1,33 @@
1/*
2 * Update derived fields.
3 */
4
5#include "assign_protein_type.h"
6#include "check_h5_error.h"
7
8#define FILE "influenza.h5"
9
10int
11main ()
12{
13 /*
14 * Open the HDF5 file.
15 */
16 hid_t file_id = H5Fopen (FILE, H5F_ACC_RDWR, H5P_DEFAULT);
17 if (file_id < 0)
18 check_h5_error (file_id, __FILE__, __LINE__);
19
20 /*
21 * Assign protein type values to the sequence records.
22 */
23 assign_protein_type (file_id);
24
25 /*
26 * Close the HDF5 file.
27 */
28 herr_t status = H5Fclose (file_id);
29 if (status < 0)
30 check_h5_error (status, __FILE__, __LINE__);
31
32 return 0;
33}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.