-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetHaPath.c
More file actions
executable file
·750 lines (629 loc) · 21.5 KB
/
getHaPath.c
File metadata and controls
executable file
·750 lines (629 loc) · 21.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
/*########################################################
# Name: getHaPath
# Use:
# - Determines if a flu strain is high or low path by the
# P1 to P6 amino acids in the HA gene
# Libraries
# - "hiLowPathFun.h" (No .c file)
# - "getHA2Start.h" (No .c file)
# o "dataTypeShortHand.h" (No .c file)
# o "hiLowPathTbls.h" (No .c file)
# o "alnSeq/memWater.h" (No .c file)
# o "alnSeq/cStrToNumberFun.h" (No .c file)
# o "alnSeq/seqStruct.h" (No .c file)
# o "alnSeq/generalAlnFun.h" (No .c file)
# o "alnSeq/alnSetStruct.h" (No .c file)
# o "alnSeq/alnSeqDefaults.h" (No .c file)
# C Stanard Libraries:
# o <stdlib.h>
# o <sdtio.h>
# o <stdint.h>
# o <string.h>
########################################################*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
' SOF: Start Of File
' - This file is the main file for determining if a flu
' strain is hi or low path.
' o header:
' - Has includes and default variables
' o main:
' - Driver function to find if a flu strain is high or
' low path
' o fun01 getUserInput:
' - Get user input
' o fun02 pHelpMesg
' - Prints out the help message
\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*--------------------------------------------------------\
| Header:
| - Has includes and default variables
\--------------------------------------------------------*/
#ifdef PLAN9
#include <u.h>
#include <libc.h>
#else
#include <stdlib.h>
#endif
#include <stdio.h>
#include <string.h>
#include "haStart.h"
#include "haPath.h"
#include "memwater/memwater.h"
#include "memwater/alnSetST.h"
#include "memwater/seqST.h"
/*.h files only*/
#include "generalLib/dataTypeShortHand.h"
#include "generalLib/base10str.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\
! Hidden libraries:
! - .h #include "memwater/alnDefaults.h"
! - .h #include "generalLib/ulCp.h"
\%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#define defVersion 20240627
/*-------------------------------------------------------\
| Fun01: getUserInpt
| Use:
| - Gets the user input from args
| Input:
| - numArgsI:
| o Number of arguments and parameters the user input
| - args:
| o Has the user input and parameters
| - faFileStr:
| o Set to point to the fasta file path in args
| - featureFileStr:
| o Set to point to the feature table path in args
| - HA2StartUL:
| o Changed to hold the starting position of the HA2
| gene (if the user supplied it)
| Output:
| - Modifies:
| - All input variables except numArgsI and args; see
| input for how modified.
\-------------------------------------------------------*/
char * getUserInput(
int numArgsI, /*Number of args/parms user input*/
char *args[], /*Input user arguments*/
char **faFileStr, /*Holds path to input fasta file*/
char **featureFileStr, /*Holds path to feature table*/
ulong *HA2StartUL /*In case user supplied HA2 start*/
){ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
' Fun01 TOC: getUserInput
' - Get user input
\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
char *parmStr = 0; /*Points to a single parameter*/
char *argStr = 0; /*Points to a single argument*/
uchar ucInput = 1;
for(ucInput = 1; ucInput < numArgsI; ++ucInput)
{ /*Loop: Get user input*/
parmStr = args[ucInput];
argStr = args[ucInput + 1];
if(strcmp(parmStr, "-tbl") == 0)
{ /*If: the user provided a feature table*/
*featureFileStr = argStr;
++ucInput;
} /*If: the user provided a feature table*/
else if(strcmp(parmStr, "-fa") == 0)
{ /*Else if: the user provied a fasta file*/
*faFileStr = argStr;
++ucInput;
} /*Else if: the user provied a fasta file*/
else if(strcmp(parmStr, "-HA2-start") == 0)
{ /*Else if: the user provided the start of HA2*/
/*Check if this is a numeric input*/
if(*strToUL_base10str(argStr, *HA2StartUL) > 32)
return "0 non-numeric HA2 length provided\n";
--(*HA2StartUL); /*Convert to index 0*/
++ucInput;
} /*Else if: the user provided the start of HA2*/
else return parmStr;
} /*Loop: Get user input*/
return 0;
} /*getUserInput*/
/*-------------------------------------------------------\
| Fun02: pHelpMesg
| Use:
| - Prints out the help message
| Input:
| - outFILE:
| o File to print the help message to
| Output:
| - Prints:
| o Prints help message to outFILE
\-------------------------------------------------------*/
void pHelpMesg(
FILE *outFILE /*File to print help message to*/
){ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
' Fun02 TOC: pHelpMesg
' - Prints out the help message
' o fun02 sec01:
' - Print out usage lines
' o fun02 sec02:
' - Print out the input options
' o fun02 sec02:
' - Print out the output
\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\
^ Fun02 Sec01:
^ - Print out usage lines
\<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
fprintf(
outFILE,
"isHiLowPath -tbl features.tbl -fa seq.fasta\n"
);
fprintf(outFILE, "Use:\n");
fprintf(
outFILE,
" - Determines if a flu HA sequence is from a hi or"
);
fprintf(outFILE, " low\n path flu strain.\n");
fprintf(
outFILE,
" - Checks if flu is high path by comparing the"
);
fprintf(outFILE, " P1 to P6\n");
fprintf(
outFILE,
" amino acids to see if they match sequences"
);
fprintf(outFILE, " seen in \n hi path flu's\n");
fprintf(outFILE, " o P1'-R-R\n");
fprintf(outFILE, " o P1'-R-K\n");
fprintf(outFILE, " o P1'-R-X-R\n");
fprintf(outFILE, " o P1'-R-X-K\n");
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\
^ Fun02 Sec02:
^ - Print out the input options
\<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
fprintf(outFILE, "Input:\n");
fprintf(outFILE, " -fa: [Required]\n");
fprintf(
outFILE,
" o Fasta file with HA sequence to check\n"
);
fprintf(
outFILE,
" o For tables or input HA2 starting positions;\n"
);
fprintf(
outFILE,
" include a \"HA\" in the header (>)\n"
);
fprintf(outFILE, " -tbl: [Optional]\n");
fprintf(outFILE, " o Feature table from\n ");
fprintf(
outFILE,
"https://www.ncbi.nlm.nih.gov/genomes/FLU/annotation/"
);
fprintf(outFILE, "\n");
fprintf(
outFILE,
" o This is more reliable than an alignment\n"
);
fprintf(outFILE, " -HA2-start: [Not used]\n");
fprintf(
outFILE,
" o The position of first base of the HA2 gene\n"
);
fprintf(
outFILE,
" o This disables -tbl\n"
);
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\
^ Fun02 Sec02:
^ - Print out the output
\<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
fprintf(outFILE, "Output:\n");
fprintf(
outFILE,
" - Prints result as tsv to stdout\n"
);
fprintf(
outFILE,
" o \"header\thi/low_path\tIs_P2_phe_or_try"
);
fprintf(outFILE, "\tP1_to_P6_aa\tH2start\"\n");
} /*pHelpMesg*/
/*-------------------------------------------------------\
| Main:
| - main driver function to pathotype HA sequences
| Input:
| - numArgsI:
| o number of arguments user input
| - argsStr:
| o c-string array with user input arguments
| Output:
| - Prints:
| o pathotype (as tsv) to the output file
\-------------------------------------------------------*/
int main(
int numArgsI, /*Number of arguments user input*/
char *argsStr[] /*Arguments user input*/
){ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
' Main: detectHiLowPath
' - Detects if a flu strain is high or low path
' o main sec01:
' - Variable declerations
' o main sec02:
' - get user input, check user input, and initialize
' o main sec03:
' - Get HA2 staring position and HA sequence
' o main sec04:
' - print out the header
' o main sec05:
' - Use HA2 start position to get if high/low path
' - only goes if user provided a start
' o main sec06:
' - Find HA2 start & then if high/low path
' - only goes if user did not provided a start
\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\
^ Main Sec01:
^ - Variable declerations
\>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
char *fastaStr = 0;
char *featureTblStr = 0;
char *errStr = 0; /*Errors from user input*/
char p1ToP6AaStr[def_numPSites_haPath];
char hiPathBl = 0;
char p2VirulBl = 0; /*is a phe or try*/
char *outHiLowStr = "";
char *outP2VirlStr = "";
long HA2AlnScoreL = 0; /*Alignment score for HA2*/
ulong HA2StartUL = 0;
ulong HA2ConFirstBaseUL = 0;
struct seqStruct *seqHeapST = 0;
struct seqStruct seqStackST;
struct alnSet alnStackST; /*alignment settings*/
FILE *testFILE = 0;
FILE *outFILE = stdout;
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\
^ Main Sec02:
^ - get user input, check user input, and initialize
^ o main sec02 sub01:
^ - get user input
^ o main sec02 sub02:
^ - Check if the reference can be opened
^ o main sec02 sub03:
^ - Check if feature table can be opened
^ o main sec02 sub04:
^ - initialize variables
\>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
/*****************************************************\
* Main Sec02 Sub01:
* - get user input
\*****************************************************/
errStr =
getUserInput(
numArgsI,
argsStr,
&fastaStr,
&featureTblStr,
&HA2StartUL /*In case user supplied HA2 start*/
);
if(errStr != 0)
{ /*If: there was an error*/
if(
strcmp(errStr, "-h") == 0
|| strcmp(errStr, "--h") == 0
|| strcmp(errStr, "-help") == 0
|| strcmp(errStr, "--help") == 0
|| strcmp(errStr, "help") == 0
) { /*If: the user wanted the help message*/
pHelpMesg(stdout);
exit(0);
} /*If: the user wanted the help message*/
if(
strcmp(errStr, "-v") == 0
|| strcmp(errStr, "--v") == 0
|| strcmp(errStr, "-version") == 0
|| strcmp(errStr, "--versoin") == 0
|| strcmp(errStr, "version") == 0
) { /*If: the user wanted the help message*/
fprintf(
stdout,
"isHiLowPathFlu version: %i\n",
defVersion
);
exit(0);
} /*If: the user wanted the help message*/
if(errStr[0] == '0')
{ /*If: this was do to non-numeric entry*/
fprintf(stderr, "%s", &errStr[2]);
exit(-1);
} /*If: this was do to non-numeric entry*/
pHelpMesg(stderr);
fprintf(stderr, "\nInvalid input (%s)\n", errStr);
exit(-1);
} /*If: there was an error*/
/*****************************************************\
* Main Sec02 Sub02:
* - Check if the reference file can be opened
\*****************************************************/
testFILE = fopen(fastaStr, "r");
if(testFILE == 0)
{ /*If: the reference file could not be opened*/
fprintf(
stderr,
"Input file (-fa %s) could not be opened\n",
fastaStr
);
exit(-1);
} /*If: the reference file could not be opened*/
fclose(testFILE);
testFILE = 0;
/*****************************************************\
* Main Sec02 Sub03:
* - Check if the feature table file can be opened
\*****************************************************/
if(HA2StartUL == 0 && featureTblStr != 0)
{ /*If: user did not provide the HA2 start position*/
testFILE = fopen(featureTblStr, "r");
if(testFILE == 0)
{ /*If: the freature table could not be opened*/
fprintf(
stderr,
"Feature table (-tbl %s) could not be opened\n",
featureTblStr
);
exit(-1);
} /*If: the feature table could not be opened*/
fclose(testFILE);
testFILE = 0;
} /*If: user did not provide the HA2 start position*/
/*****************************************************\
* Main Sec02 Sub03:
* - initialize variables
\*****************************************************/
init_alnSetST(&alnStackST);
init_seqST(&seqStackST);
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\
^ Main Sec03:
^ - Get HA2 staring position
\>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
/*Check if the user already provided this*/
if(HA2StartUL == 0 && featureTblStr != 0)
{ /*If: the user did not provided the HA2 start*/
HA2StartUL = get_haStart(featureTblStr);
if(HA2StartUL == 0)
{ /*If: I could not extract HA2 starting position*/
fprintf(
stderr,
"Could not get HA2 start from %s\n",
featureTblStr
);
freeStack_seqST(&seqStackST);
freeStack_alnSetST(&alnStackST);
exit(-1);
} /*If: I could not extract HA2 starting position*/
} /*If: the user did not provided the HA2 start*/
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\
^ Main Sec04:
^ - print out header
\>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
fprintf(
outFILE,
"id\thiPath\tP2_virl\taa_seq\tH2_start\n"
);
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\
^ Main Sec05:
^ - Use HA2 start position to get if high/low path
^ - only goes if user provided a start
^ o main sec05 sub01:
^ - Get the HA sequence (if have a start position)
^ o main sec05 sub02:
^ - Get the P1 to P6 amino acid sequence
^ o main sec05 sub03:
^ - Check high path/low path & other P1-P6 markers
^ o main sec05 sub04:
^ - Print out the results
^ o main sec05 sub05:
^ - Cean up and exit
\<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
/****************************************************\
* Main Sec05 Sub01:
* - Get the HA sequence (if have a start position)
\****************************************************/
if(HA2StartUL)
{ /*If: have an HA2 starting position*/
seqHeapST = getSeq_haStart(fastaStr);
if(seqHeapST == 0)
{ /*If: I could not find the HA sequence*/
freeHeap_seqST(seqHeapST);
seqHeapST = 0;
freeStack_seqST(&seqStackST);
freeStack_alnSetST(&alnStackST);
fprintf(
stderr,
"Could not find the HA sequence in %s\n",
fastaStr
);
exit(-1);
} /*If: I could not find the HA sequence*/
/**************************************************\
* Main Sec05 Sub02:
* - Get the P1 to P6 amino acid sequence
\**************************************************/
getP1_P6AA_haPath(
seqHeapST->seqStr,
p1ToP6AaStr,
HA2StartUL
); /*get P1 to P6 amino acid sequence*/
/**************************************************\
* Main Sec05 Sub03:
* - Check high path/low path & other P1-P6 markers
\**************************************************/
hiPathBl = find_haPath(p1ToP6AaStr);
if(hiPathBl)
outHiLowStr = "high_path";
else
outHiLowStr = "low_path";
p2VirulBl = P2PheTryMut_haPath(p1ToP6AaStr);
if(p2VirulBl)
outP2VirlStr = "P2=True";
else
outP2VirlStr = "P2=False";
/**************************************************\
* Main Sec05 Sub04:
* - Print out the results
\**************************************************/
/*Get rid of new line at end of header*/
seqHeapST->idStr[seqHeapST->lenIdUL - 1] = '\0';
fprintf(
outFILE,
"%s\t%s\t%s\tP1'-%c-%c-%c-%c-%c-%c\t%lu\n",
&seqHeapST->idStr[1], /*[0] is >*/
outHiLowStr,
outP2VirlStr,
p1ToP6AaStr[0],
p1ToP6AaStr[1],
p1ToP6AaStr[2],
p1ToP6AaStr[3],
p1ToP6AaStr[4],
p1ToP6AaStr[5],
HA2StartUL + 1 /*Convert to index 1*/
);
/*************************************************\
* Main Sec05 Sub05:
* - Clean up and exit
\*************************************************/
freeHeap_seqST(seqHeapST);
seqHeapST = 0;
freeStack_seqST(&seqStackST);
freeStack_alnSetST(&alnStackST);
exit(0);
} /*If: have an HA2 starting position*/
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\
^ Main Sec06:
^ - Find HA2 start & then if high/low path
^ - only goes if user did not provided a start
^ o main sec06 sub01:
^ - Open file and read in all sequences
^ o main sec06 sub02:
^ - Check if the sequence maps to the HA2 consensus
^ o main sec06 sub03:
^ - Check if have all thre bases in the P1 position
^ and if so, move to P1'
^ o main sec06 sub04:
^ - Get the P1 to P6 amino acid sequence
^ o main sec06 sub05:
^ - Check high path/low path & other P1-P6 markers
^ o main sec06 sub06:
^ - Print out the results
^ o main sec06 sub07:
^ - Clean up and exit
\<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
/*****************************************************\
* Main Sec06 Sub01:
* - Open file and read in all sequences
\*****************************************************/
testFILE = fopen(fastaStr, "r");
while(! getFaSeq_seqST(testFILE, &seqStackST))
{ /*Loop: Get each sequence & check if high/low path*/
/*Get rid of new line at end of header*/
seqStackST.idStr[seqStackST.lenIdUL - 1] ='\0';
/**************************************************\
* Main Sec06 Sub02:
* - Check if the sequence maps to the HA2 consensus
\**************************************************/
HA2AlnScoreL =
find_haStart(
&seqStackST,
&alnStackST,
&HA2StartUL,
&HA2ConFirstBaseUL
); /*Find the HA2 starting position*/
if(HA2AlnScoreL < 0)
{ /*If: had a memory error*/
freeStack_seqST(&seqStackST);
freeStack_alnSetST(&alnStackST);
fclose(testFILE);
fprintf(stderr, "Ran out of memory\n");
exit(-1);
} /*If: had a memory error*/
/*check if this aligment met the minimum score*/
if(HA2AlnScoreL == 0)
{ /*If: the sequence did not map, let user know*/
fprintf(
outFILE,
"%s\tNA\tNA\tNo-alignment\tNA\n",
&seqStackST.idStr[1] /*Skip > at start*/
);
continue;
} /*If: the sequence did not map, let user know*/
/**************************************************\
* Main Sec06 Sub03:
* - Check if have all thre bases in the P1 position
* and if so, move to P1'
\**************************************************/
/*If the first base in the P1 codon did not map,
` This means it is not a lysine or argine and so, is
` likely not the start of the HA2 sequence
*/
if(HA2ConFirstBaseUL > 0)
{ /*If: the 1st base in the P1 codon did not map*/
/*See if we can find P1' (print out for user*/
if(HA2ConFirstBaseUL < 2)
HA2StartUL += 3;
fprintf(
outFILE,
"%s\tNA\tNA\tMissing_1st_P1_base\t%lu\n",
&seqStackST.idStr[1], /*Skip > at start*/
HA2StartUL + 1 /*Convert to index 1*/
);
continue;
} /*If: the 1st base in the P1 codon did not map*/
HA2StartUL += 3; /*1st 3 bases is P1, I need P1'*/
/**************************************************\
* Main Sec06 Sub04:
* - Get the P1 to P6 amino acid sequence
\**************************************************/
getP1_P6AA_haPath(
seqStackST.seqStr,
p1ToP6AaStr,
HA2StartUL
);
/**************************************************\
* Main Sec06 Sub05:
* - Check high path/low path & other P1-P6 markers
\**************************************************/
hiPathBl = find_haPath(p1ToP6AaStr);
if(hiPathBl)
outHiLowStr = "high_path";
else
outHiLowStr = "low_path";
p2VirulBl = P2PheTryMut_haPath(p1ToP6AaStr);
if(p2VirulBl)
outP2VirlStr = "P2=True";
else
outP2VirlStr = "P2=False";
/**************************************************\
* Main Sec06 Sub06:
* - Print out the results
\**************************************************/
fprintf(
outFILE,
"%s\t%s\t%s\tP1'-%c-%c-%c-%c-%c-%c\t%lu\n",
&seqStackST.idStr[1], /*[0] is >*/
outHiLowStr,
outP2VirlStr,
p1ToP6AaStr[0],
p1ToP6AaStr[1],
p1ToP6AaStr[2],
p1ToP6AaStr[3],
p1ToP6AaStr[4],
p1ToP6AaStr[5],
HA2StartUL + 1 /*Convert to index 1*/
);
} /*Loop: Get each sequence & check if high/low path*/
/***************************************************\
* Main Sec06 Sub07:
* - Clean up and exit
\***************************************************/
fclose(testFILE);
testFILE = 0;
freeStack_seqST(&seqStackST);
/*more for future, currently does nothing*/
freeStack_alnSetST(&alnStackST);
exit(0);
} /*main*/