-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | src/Makefile.am | 10 | ||||
-rw-r--r-- | src/assign_protein_type.c | 135 | ||||
-rw-r--r-- | src/load_influenza_faa.c | 67 | ||||
-rw-r--r-- | src/sequence_data.h | 16 | ||||
-rw-r--r-- | src/sequence_data_init.c | 37 | ||||
-rw-r--r-- | src/sequence_data_init.h | 14 |
7 files changed, 188 insertions, 96 deletions
diff --git a/src/sequence_data_init.c b/src/sequence_data_init.c new file mode 100644 index 0000000..09ba189 --- a/dev/null +++ b/src/sequence_data_init.c @@ -0,0 +1,37 @@ +#include "sequence_data_init.h" +#include "sequence_data.h" + +void +sequence_data_init (size_t *dst_size, size_t *dst_offset, size_t *dst_sizes, + hid_t *field_type) +{ + *dst_size = sizeof (sequence_data); + + dst_offset[0] = HOFFSET (sequence_data, gi); + dst_offset[1] = HOFFSET (sequence_data, gb); + dst_offset[2] = HOFFSET (sequence_data, description); + dst_offset[3] = HOFFSET (sequence_data, protein_type); + + sequence_data dst_buf[1]; + + dst_sizes[0] = sizeof (dst_buf[0].gi); + dst_sizes[1] = sizeof (dst_buf[0].gb); + dst_sizes[2] = sizeof (dst_buf[0].description); + dst_sizes[3] = sizeof (dst_buf[0].protein_type); + + field_type[0] = H5T_NATIVE_INT; + + hid_t gb_type = H5Tcopy (H5T_C_S1); + H5Tset_size (gb_type, 9); + field_type[1] = gb_type; + + hid_t description_type = H5Tcopy (H5T_C_S1); + H5Tset_size (description_type, 196); + field_type[2] = description_type; + + hid_t protein_type_type = H5Tcopy (H5T_C_S1); + H5Tset_size (protein_type_type, 7); + field_type[3] = protein_type_type; + + return; +} |