-rw-r--r-- | src/aggregator.c | 33 | ||||
-rw-r--r-- | src/assign/assign_blast_scores.c | 11 | ||||
-rw-r--r-- | src/assign/assign_protein_type.c | 28 | ||||
-rw-r--r-- | src/updator.c | 2 |
4 files changed, 60 insertions, 14 deletions
diff --git a/src/aggregator.c b/src/aggregator.c index c789502..8057bb3 100644 --- a/src/aggregator.c +++ b/src/aggregator.c | |||
@@ -8,15 +8,25 @@ | |||
8 | #include "load/load_influenza_aa_dat.h" | 8 | #include "load/load_influenza_aa_dat.h" |
9 | #include "load/load_influenza_faa.h" | 9 | #include "load/load_influenza_faa.h" |
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <stdlib.h> | ||
12 | #include <string.h> | ||
11 | 13 | ||
12 | #define BLASTFILE "run20090807.del" | 14 | #define BLASTFILE "run20090807.del" |
13 | #define H5FILE "influenza.h5" | 15 | #define H5FILE "influenza.h5" |
14 | #define INFLUENZA_AA_DAT "/u/ac/dpellegr/Documents/exp004/genomes/INFLUENZA/influenza_aa.dat" | 16 | #define INFLUENZA_AA_DAT "/genomes/INFLUENZA/influenza_aa.dat" |
15 | #define INFLUENZA_FAA "/u/ac/dpellegr/Documents/exp004/genomes/INFLUENZA/influenza.faa" | 17 | #define INFLUENZA_FAA "/genomes/INFLUENZA/influenza.faa" |
16 | 18 | ||
17 | int | 19 | int |
18 | main () | 20 | main () |
19 | { | 21 | { |
22 | char* exp004 = getenv ("EXP004"); | ||
23 | if (exp004 == NULL) | ||
24 | { | ||
25 | printf ("EXP004 environment variable not set. This should be set to the " | ||
26 | "directory containing the genomes/INFLUENZA data."); | ||
27 | exit (0); | ||
28 | } | ||
29 | |||
20 | /* | 30 | /* |
21 | * Create a new HDF5 file if it does not already exist. If an | 31 | * Create a new HDF5 file if it does not already exist. If an |
22 | * existing file is found then open it. | 32 | * existing file is found then open it. |
@@ -40,15 +50,26 @@ main () | |||
40 | /* | 50 | /* |
41 | * Load the supplementary protein data file. | 51 | * Load the supplementary protein data file. |
42 | */ | 52 | */ |
53 | char* loc1 = malloc (strlen (exp004) + strlen (INFLUENZA_AA_DAT) + 1); | ||
54 | loc1[0] = '\0'; | ||
55 | strcat (loc1, exp004); | ||
56 | strcat (loc1, INFLUENZA_AA_DAT); | ||
43 | printf ("Loading \"influenza_aa.dat\" with contents of %s.\n", | 57 | printf ("Loading \"influenza_aa.dat\" with contents of %s.\n", |
44 | INFLUENZA_AA_DAT); | 58 | loc1); |
45 | load_influenza_aa_dat (file_id, INFLUENZA_AA_DAT); | 59 | load_influenza_aa_dat (file_id, loc1); |
60 | free (loc1); | ||
46 | 61 | ||
47 | /* | 62 | /* |
48 | * Load the FASTA protein sequence data file. | 63 | * Load the FASTA protein sequence data file. |
49 | */ | 64 | */ |
50 | printf ("Loading \"influenza.faa\" with contents of %s.\n", INFLUENZA_FAA); | 65 | char* loc2 = malloc (strlen (exp004) + strlen (INFLUENZA_FAA) + 1); |
51 | load_influenza_faa (file_id, INFLUENZA_FAA); | 66 | loc2[0] = '\0'; |
67 | strcat (loc2, exp004); | ||
68 | strcat (loc2, INFLUENZA_FAA); | ||
69 | printf ("Loading \"influenza.faa\" with contents of %s.\n", | ||
70 | loc2); | ||
71 | load_influenza_faa (file_id, loc2); | ||
72 | free (loc2); | ||
52 | 73 | ||
53 | /* | 74 | /* |
54 | * Load the BLAST scores. | 75 | * Load the BLAST scores. |
diff --git a/src/assign/assign_blast_scores.c b/src/assign/assign_blast_scores.c index 7c0493b..3bdcccc 100644 --- a/src/assign/assign_blast_scores.c +++ b/src/assign/assign_blast_scores.c | |||
@@ -30,7 +30,16 @@ assign_blast_scores (hid_t file_id) | |||
30 | * Write the contents of the matrix to a HDF5 file. | 30 | * Write the contents of the matrix to a HDF5 file. |
31 | */ | 31 | */ |
32 | PetscViewer viewer; | 32 | PetscViewer viewer; |
33 | PetscErrorCode err = PetscViewerHDF5Open (PETSC_COMM_WORLD, "sparse.h5", FILE_MODE_WRITE, &viewer); | 33 | |
34 | // PetscErrorCode err = | ||
35 | // PetscViewerHDF5Open (PETSC_COMM_WORLD, "sparse.h5", FILE_MODE_WRITE, &viewer); | ||
36 | |||
37 | PetscErrorCode err = | ||
38 | PetscViewerBinaryOpen (PETSC_COMM_WORLD, | ||
39 | "sparse.petsc", | ||
40 | FILE_MODE_WRITE, | ||
41 | &viewer); | ||
42 | |||
34 | MatView (M, viewer); | 43 | MatView (M, viewer); |
35 | PetscViewerDestroy (viewer); | 44 | PetscViewerDestroy (viewer); |
36 | 45 | ||
diff --git a/src/assign/assign_protein_type.c b/src/assign/assign_protein_type.c index 065880f..52a0b70 100644 --- a/src/assign/assign_protein_type.c +++ b/src/assign/assign_protein_type.c | |||
@@ -19,18 +19,26 @@ | |||
19 | /* | 19 | /* |
20 | * BLAST database containing all of the influenza protein sequences. | 20 | * BLAST database containing all of the influenza protein sequences. |
21 | */ | 21 | */ |
22 | #define SEQDB "/u/ac/dpellegr/Documents/exp004/influenzadb/influenzadb" | 22 | #define SEQDB "/influenzadb/influenzadb" |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * BLAST reference database of prototypical protein types. | 25 | * BLAST reference database of prototypical protein types. |
26 | */ | 26 | */ |
27 | #define REFDB "/u/ac/dpellegr/Documents/exp004/influenzadb/proteinnames" | 27 | #define REFDB "/influenzadb/proteinnames" |
28 | 28 | ||
29 | #define BUFFER_LEN 50 | 29 | #define BUFFER_LEN 50 |
30 | 30 | ||
31 | void | 31 | void |
32 | assign_protein_type (hid_t file_id) | 32 | assign_protein_type (hid_t file_id) |
33 | { | 33 | { |
34 | char* exp004 = getenv ("EXP004"); | ||
35 | if (exp004 == NULL) | ||
36 | { | ||
37 | printf ("EXP004 environment variable not set. This should be set to the " | ||
38 | "directory containing the genomes/INFLUENZA data."); | ||
39 | exit (0); | ||
40 | } | ||
41 | |||
34 | /* | 42 | /* |
35 | * Iterate through the records for which no protein type has been | 43 | * Iterate through the records for which no protein type has been |
36 | * assigned. Create a BioSeq Pointer to the data and then use this | 44 | * assigned. Create a BioSeq Pointer to the data and then use this |
@@ -47,7 +55,12 @@ assign_protein_type (hid_t file_id) | |||
47 | /* | 55 | /* |
48 | * Open the BLAST sequence database. | 56 | * Open the BLAST sequence database. |
49 | */ | 57 | */ |
50 | ReadDBFILEPtr seqdb = readdb_new (SEQDB, true); | 58 | char* loc1 = malloc (strlen (exp004) + strlen (SEQDB) + 1); |
59 | loc1[0] = '\0'; | ||
60 | strcat (loc1, exp004); | ||
61 | strcat (loc1, SEQDB); | ||
62 | ReadDBFILEPtr seqdb = readdb_new (loc1, true); | ||
63 | free (loc1); | ||
51 | 64 | ||
52 | /* | 65 | /* |
53 | * Get default BLAST options. | 66 | * Get default BLAST options. |
@@ -215,14 +228,19 @@ assign_protein_type (hid_t file_id) | |||
215 | "record set. See the BLAST formatdb.log file " | 228 | "record set. See the BLAST formatdb.log file " |
216 | "for details.\n", faa_buf[i].gi); | 229 | "for details.\n", faa_buf[i].gi); |
217 | } | 230 | } |
218 | 231 | ||
232 | char* loc2 = malloc (strlen (exp004) + strlen (REFDB) + 1); | ||
233 | loc2[0] = '\0'; | ||
234 | strcat (loc2, exp004); | ||
235 | strcat (loc2, REFDB); | ||
219 | SeqAlignPtr seqalign = BioseqBlastEngine (bsp, | 236 | SeqAlignPtr seqalign = BioseqBlastEngine (bsp, |
220 | "blastp", | 237 | "blastp", |
221 | REFDB, | 238 | loc2, |
222 | options, | 239 | options, |
223 | NULL, | 240 | NULL, |
224 | &error_returns, | 241 | &error_returns, |
225 | NULL); | 242 | NULL); |
243 | free (loc2); | ||
226 | 244 | ||
227 | /* | 245 | /* |
228 | * BLAST reported an error. Write it out and continue processing. | 246 | * BLAST reported an error. Write it out and continue processing. |
diff --git a/src/updator.c b/src/updator.c index 0bade65..b443183 100644 --- a/src/updator.c +++ b/src/updator.c | |||
@@ -31,9 +31,7 @@ main (int argc, char **argv) | |||
31 | /* | 31 | /* |
32 | * Assign protein type values to the sequence records. | 32 | * Assign protein type values to the sequence records. |
33 | */ | 33 | */ |
34 | /* | ||
35 | assign_protein_type (file_id); | 34 | assign_protein_type (file_id); |
36 | */ | ||
37 | 35 | ||
38 | /* | 36 | /* |
39 | * Assign pairwise BLAST scores. | 37 | * Assign pairwise BLAST scores. |