summaryrefslogtreecommitdiffstats
Side-by-side diff
-rw-r--r--src/aggregator.c34
-rw-r--r--src/assign/assign_protein_type.c141
-rw-r--r--src/load/load_influenza_aa_dat.c53
-rw-r--r--src/load/load_influenza_aa_dat.h2
-rw-r--r--src/load/load_influenza_faa.c53
-rw-r--r--src/load/load_influenza_faa.h2
-rw-r--r--src/updator.c2
7 files changed, 201 insertions, 86 deletions
diff --git a/src/aggregator.c b/src/aggregator.c
index c00d912..c9a03b5 100644
--- a/src/aggregator.c
+++ b/src/aggregator.c
@@ -6,28 +6,48 @@
#include "error/check_h5_error.h"
#include "load/load_influenza_aa_dat.h"
#include "load/load_influenza_faa.h"
+#include <stdio.h>
-#define FILE "influenza.h5"
+#define H5FILE "influenza.h5"
+#define INFLUENZA_AA_DAT "/home/don/exp004/genomes/INFLUENZA/influenza_aa.dat"
+#define INFLUENZA_FAA "/home/don/exp004/genomes/INFLUENZA/influenza.faa"
int
main ()
{
/*
- * Create the HDF5 file.
+ * Create a new HDF5 file if it does not already exist. If an
+ * existing file is found then open it.
*/
- hid_t file_id = H5Fcreate (FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- if (file_id < 0)
- check_h5_error (file_id, __FILE__, __LINE__);
+ hid_t file_id = 0;
+ FILE *f = fopen (H5FILE, "r+");
+ if (f == NULL)
+ {
+ file_id = H5Fcreate (H5FILE, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT);
+ if (file_id < 0)
+ check_h5_error (file_id, __FILE__, __LINE__);
+ }
+ else
+ {
+ fclose (f);
+ file_id = H5Fopen (H5FILE, H5F_ACC_RDWR, H5P_DEFAULT);
+ if (file_id < 0)
+ check_h5_error (file_id, __FILE__, __LINE__);
+ }
/*
* Load the supplementary protein data file.
*/
- load_influenza_aa_dat (file_id);
+ printf ("Loading \"influenza_aa.dat\" with contents of %s.\n",
+ INFLUENZA_AA_DAT);
+ load_influenza_aa_dat (file_id, INFLUENZA_AA_DAT);
/*
* Load the FASTA protein sequence data file.
*/
- load_influenza_faa (file_id);
+ printf ("Loading \"influenza.faa\" with contents of %s.\n",
+ INFLUENZA_FAA);
+ load_influenza_faa (file_id, INFLUENZA_FAA);
/*
* Close the HDF5 file.

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.