/* * Aggregate the collected influenza data into a single HDF5 * container. */ #include "error/check_h5_error.h" #include "load/load_asn.h" #include "load/load_blast_scores.h" #include "load/load_features.h" #include "load/load_influenza_aa_dat.h" #include "load/load_influenza_faa.h" #include #include #include #define BLASTFILE "run20090807.del" #define H5FILE "influenza.h5" #define INFLUENZA_AA_DAT "/genomes/INFLUENZA/influenza_aa.dat" #define INFLUENZA_FAA "/genomes/INFLUENZA/influenza.faa" int main () { char* exp004 = getenv ("EXP004"); if (exp004 == NULL) { printf ("EXP004 environment variable not set. This should be set to the " "directory containing the genomes/INFLUENZA data.\n"); exit (0); } /* * Create a new HDF5 file if it does not already exist. If an * existing file is found then open it. */ 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__, __LINE__); } else { fclose (f); file_id = H5Fopen (H5FILE, H5F_ACC_RDWR, H5P_DEFAULT); if (file_id < 0) check_h5_error (__FILE__, __LINE__); } /* * Load the supplementary protein data file. */ /* char* loc1 = malloc (strlen (exp004) + strlen (INFLUENZA_AA_DAT) + 1); loc1[0] = '\0'; strcat (loc1, exp004); strcat (loc1, INFLUENZA_AA_DAT); printf ("Loading \"influenza_aa.dat\" with contents of %s.\n", loc1); load_influenza_aa_dat (file_id, loc1); free (loc1); */ /* * Load the FASTA protein sequence data file. */ /* char* loc2 = malloc (strlen (exp004) + strlen (INFLUENZA_FAA) + 1); loc2[0] = '\0'; strcat (loc2, exp004); strcat (loc2, INFLUENZA_FAA); printf ("Loading \"influenza.faa\" with contents of %s.\n", loc2); load_influenza_faa (file_id, loc2); free (loc2); */ /* * Load the Entrez features. */ // load_features (file_id, "efetch-protein-0.xml"); load_asn (file_id, "453644.asn"); /* * Load the BLAST scores. */ /* printf ("Loading \"blast\" with contents of %s.\n", BLASTFILE); load_blast_scores (file_id, BLASTFILE); */ /* * Close the HDF5 file. */ herr_t status = H5Fclose (file_id); if (status < 0) check_h5_error (__FILE__, __LINE__); return 0; }