-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/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 @@ /* * BLAST database containing all of the influenza protein sequences. */ -#define SEQDB "/u/ac/dpellegr/Documents/exp004/influenzadb/influenzadb" +#define SEQDB "/influenzadb/influenzadb" /* * BLAST reference database of prototypical protein types. */ -#define REFDB "/u/ac/dpellegr/Documents/exp004/influenzadb/proteinnames" +#define REFDB "/influenzadb/proteinnames" #define BUFFER_LEN 50 void assign_protein_type (hid_t file_id) { + 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."); + exit (0); + } + /* * Iterate through the records for which no protein type has been * assigned. Create a BioSeq Pointer to the data and then use this @@ -47,7 +55,12 @@ assign_protein_type (hid_t file_id) /* * Open the BLAST sequence database. */ - ReadDBFILEPtr seqdb = readdb_new (SEQDB, true); + char* loc1 = malloc (strlen (exp004) + strlen (SEQDB) + 1); + loc1[0] = '\0'; + strcat (loc1, exp004); + strcat (loc1, SEQDB); + ReadDBFILEPtr seqdb = readdb_new (loc1, true); + free (loc1); /* * Get default BLAST options. @@ -215,14 +228,19 @@ assign_protein_type (hid_t file_id) "record set. See the BLAST formatdb.log file " "for details.\n", faa_buf[i].gi); } - + + char* loc2 = malloc (strlen (exp004) + strlen (REFDB) + 1); + loc2[0] = '\0'; + strcat (loc2, exp004); + strcat (loc2, REFDB); SeqAlignPtr seqalign = BioseqBlastEngine (bsp, "blastp", - REFDB, + loc2, options, NULL, &error_returns, NULL); + free (loc2); /* * BLAST reported an error. Write it out and continue processing. |