summaryrefslogtreecommitdiffstats
Side-by-side diff
-rw-r--r--src/assign_protein_type.c29
-rw-r--r--src/load_influenza_aa_dat.c2
-rw-r--r--src/load_influenza_faa.c42
3 files changed, 59 insertions, 14 deletions
diff --git a/src/assign_protein_type.c b/src/assign_protein_type.c
index 54db84e..1b58f54 100644
--- a/src/assign_protein_type.c
+++ b/src/assign_protein_type.c
@@ -1,10 +1,12 @@
#include "assign_protein_type.h"
#include "check_ncbi_error.h"
+#include "check_h5_error.h"
#include <ncbi.h>
#include <readdb.h>
#include <blast.h>
#include <salpacc.h>
#include <stdbool.h>
+#include <hdf5_hl.h>
/*
* BLAST database containing all of the influenza protein sequences.
@@ -45,6 +47,33 @@ assign_protein_type (hid_t file_id)
ValNodePtr error_returns = NULL;
/*
+ * Read the data from HDF5 file.
+ */
+ hsize_t nfields;
+ hsize_t nrecords;
+ herr_t status = H5TBget_table_info (file_id, "influenza.faa", &nfields,
+ &nrecords);
+ if (status < 0)
+ check_h5_error (status, __FILE__, __LINE__);
+
+ /*
+ * todo: Allocate memory of nrecords for dst_buf.
+ *
+ * todo: Refactor code to share structres in read and write HDF5
+ * calls.
+ */
+
+ status = H5TBread_table (file_id, "influenza.faa", dst_size, dst_offset,
+ dst_sizes, dst_buf);
+ if (status < 0)
+ check_h5_error (status, __FILE__, __LINE__);
+
+ for (int i = 0; i < nrecords; i++)
+ {
+
+ }
+
+ /*
* Read the sequence from the database by GI.
*/
Int4 sequence_number = readdb_gi2seq (seqdb, 453644, NULL);

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.