-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsquid.c
4329 lines (4191 loc) · 99.4 KB
/
squid.c
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
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
===========================================================================================================================
* AUTHOR: Christopher Riccardi, PhD student at Computational Biology Dept., University of Firenze
* PROJECT: Fast ungapped mapping of sequencing reads using Squid; Feb 2022
* CONTACT: CHRISTOPHER.RICCARDI@UNIFI.IT
===========================================================================================================================
*/
#pragma GCC diagnostic ignored "-Wunused-variable"
#include <zlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
#include <stdint.h>
#include <pthread.h>
#ifdef __APPLE__
#include <limits.h>
#endif // !__APPLE__
int VERBOSE = 1;
int DIFF = 0;
int MASK_LOWER = 0;
int AVAIL_THREADS = 1;
unsigned short MISMATCH = 15;
unsigned short K = 11;
int STEP = 17;
int FASTQ_OUT = 1;
int BED_OUT = 1;
int NO_DISJOIN = 1;
int IGNORE_N = 0;
int EVALS = 0;
#define REQUIRE_ARG_ERR(message, type) { \
fprintf(stderr, \
"[ERROR] %s option requires an argument of type %s.\n", \
message, type); \
}
#define MEMORY_FAILURE(pointer) { \
if (pointer==NULL) { \
fprintf (stderr, "%s:%d: " \
" memory allocation failed. (Error: %p)\n", \
__FILE__, __LINE__, \
strerror (errno)); \
exit (EXIT_FAILURE); \
} \
}
#define IO_FAILURE(bytes) { \
if (bytes==0) { \
fprintf (stderr, "\n%s:%d: " \
" I/O failure on file. (Error: %p)\n", \
__FILE__, __LINE__, \
strerror (errno)); \
exit (EXIT_FAILURE); \
} \
}
#define VERBOSE_MSG(type, message) { \
if(VERBOSE){ \
if(type=='W'){ \
fprintf(stderr, "[Warning] %s\n", message); \
} \
else if(type=='E'){ \
fprintf(stderr, "[Error] %s\n", message); \
exit(EXIT_FAILURE); \
} \
else if(type=='L'){ \
fprintf(stderr, "%s", message); \
} \
} \
}
#define INDEPENDENT_MSG(type, message) { \
if(type=='W'){ \
fprintf(stderr, "[Warning] %s\n", message); \
} \
else if(type=='E'){ \
fprintf(stderr, "[Error] %s\n", message); \
exit(EXIT_FAILURE); \
} \
else if(type=='L'){ \
fprintf(stderr, "%s", message); \
} \
}
#define VERBOSE_STR(message, str) { \
if(VERBOSE) fprintf(stderr, "%s %s\n", message, str); \
}
#define READ_SIZE 512
#define BUF_SIZE 8192 // buffer for reading a line in fgets/gzgets
#define PATH 256 // max size for a file path
static const char LIB_TYPE[9][4] = { "ISF", "ISR", "IU",
"OSF", "OSR", "OU",
"SF", "SR", "U" };
/* Structures */
typedef struct {
char header[READ_SIZE];
char sequence[READ_SIZE];
char placeholder[READ_SIZE];
char quality[READ_SIZE];
} READ;
typedef struct {
char* chrom; // The name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671)
uint32_t chromStart; // The starting position of the feature in the chromosome or scaffold. The first base in a chromosome is numbered 0.
uint32_t chromEnd; // The ending position of the feature in the chromosome or scaffold.
char* name; // Defines the name of the BED line
} BED;
typedef struct {
char* chrom1; // The name of the chromosome on which the first end of the feature exists
uint32_t start1; // The zero-based starting position of the first end of the feature on chrom1
uint32_t end1; // The one-based ending position of the first end of the feature on chrom1
char* chrom2; // The name of the chromosome on which the second end of the feature exists
uint32_t start2; // The zero-based starting position of the second end of the feature on chrom2
uint32_t end2; // The one-based ending position of the second end of the feature on chrom2
char* name; // Defines the name of the BEDPE feature
int score; // The UCSC definition requires that a BED score range from 0 to 1000, inclusive
char strand1; // Defines the strand for the first end of the feature. Either ‘+’ or ‘-‘
char strand2; // Defines the strand for the second end of the feature. Either ‘+’ or ‘-‘
} BEDPE;
typedef struct {
char* db;
char* input_R1;
char* input_R2;
char output_R1[PATH];
char output_R2[PATH];
char output_BED[PATH];
char basename[PATH];
unsigned short quiet;
short lib;
} PARAMS;
typedef struct {
char header[1024];
size_t size;
double GC_content;
char* sequence;
} FASTA;
typedef struct {
uint32_t id;
uint32_t size;
uint32_t** pos;
} HASH;
typedef struct {
HASH* hash;
uint32_t size;
} HASH_TBL;
typedef struct {
FASTA* fasta;
uint32_t size;
} INDEX;
typedef struct {
PARAMS* params;
INDEX* index;
HASH_TBL* hash_tbl;
long bytes_R1_start;
long bytes_R2_start;
size_t lines;
char temp_out_R1[PATH];
char temp_out_R2[PATH];
char temp_out_BED[PATH];
uint32_t hashfunc;
} THREAD;
/* General Functions */
void print_usage() {
fprintf(stderr,
"Thank you for using Squid\n"
"Usage: squid -i <str> -R1 <str> [-R2 <str>] -o <str> -l <str> [Options]\n\n"
"Please type \"squid -h\" to see a detailed help menu\n");
exit(EXIT_FAILURE);
}
void print_help() {
fprintf(stderr, "\n"
"Thank you for using Squid\n\n"
"Usage: squid -i <str> -R1 <str> [-R2 <str>] -l <str> -o <str> [Options]\n\n"
"Mandatory arguments:\n"
" -i <str> input database in FASTA format (can be gzipp'd)\n"
" -R1 <str> read in forward direction (R1) (can be gzipp'd)\n"
" -R2 <str> read in reverse direction (R2) (can be gzipp'd)\n"
" -o <str> basename, Squid will add \"_R1.fastq\", \"_R2.fastq\" and/or \".bed\"\n"
"\n \"-l\" argument is also mandatory, with one of the following format strings:\n"
" -l SF Stranded Forward. R1 comes from the forward strand, R2 from the reverse strand\n"
" -l SR Stranded Reverse. R1 comes from the reverse strand, R2 from the forward strand\n"
" -l U Unstranded. R1 or R2 can derive from both strands.\n"
" -l ISF Inward Stranded Forward. R1 and R2 behave as in SF. R1 must map upstream to R2\n"
" -l ISR Inward Stranded Reverse. R1 and R2 behave as in SR. R1 must map downstream to R2\n"
" -l IU Inward Unstranded. R1 and R2 behave as in U. With this option Squid tries ISF and ISR\n"
" -l OSF Outward Stranded Forward. R1 and R2 behave as in SF. R1 must map downstream to R2\n"
" -l OSR Outard Stranded Reverse. R1 and R2 behave as in SR. R1 must map upstream to R2\n"
" -l OU Outard Unstranded. R1 and R2 behave as in U. With this option Squid tries OSF and OSR\n"
"\nSquid also provides a number of additional arguments for a more flexible mapping.\n\n"
"Boolean arguments:\n"
" --diff when FASTQ(s) output is enabled, return reads that do not map to database.\n"
" By default this is switched off, meaning that only mapping reads will be written.\n"
" --disjoin when database is a multi-FASTA, allow R1 and R2 to map to different sequences.\n"
" Default is to coerce R1 and R2 to map to the the same seqid. When on,\n"
" disjoined read pairs will switch the score field in the BEDPE to 1 instead of 0.\n"
" --ignore_N do not treat Ns as mismatches, simply ignore them (default: OFF)\n"
" --mask-lower do not capitalize lowercase letters in database (default is to make them uppercase)\n"
" --no-bed do not produce BED/BEDPE output file (default is to write it)\n"
" --no-fastq do not produce FASTQ output file(s) (default is to write them)\n"
" --quiet do not print log to stderr (default is to be verbose)\n\n"
"Scanning and performance arguments:\n"
" -e <int> evaluate <int> number of alternative positionings of R1 and R2, looking for a better match.\n"
" Default is to break as soon as a suitable match is found (-e 0). This option is meaningful\n"
" when BED/BEDPE output is enabled. Greater values of <int> affect performance but could\n"
" report a more accurate mapping when higly similar sequences are present in the database.\n"
" -k <int> kmer size: 9, 11, 13 or 15 (default: 11)\n"
" -m <int> max %% of mismatches allowed during ungapped extension\n"
" Default is to force 85%% sequence identity, hence -m 15.\n"
" -s <int> step size while sliding over the sequencing reads\n"
" for a perfect match of length k.\n"
" Lower s increases sensitivity but decreases speed.\n"
" Min=1 (sliding window of 1), default: 17.\n"
" -t <int> number of threads (default: 1)\n\n"
);
exit(EXIT_FAILURE);
}
int is_int(char* string) {
if (strlen(string) == 0) return 0;
if (strlen(string) == 1 && !isdigit(*string)) return 0;
if (strlen(string) > 1 && string[0] == '-') {
++string;
while (*string != 0)
{
if (!isdigit(*string++)) return 0;
}
}
else if (strlen(string) > 1 && string[0] != '-') {
while (*string != 0) {
if (!isdigit(*string++)) return 0;
}
}
return 1;
}
/* Pseudo-Hash Functions */
uint32_t calc_hash_9(const char* s) {
uint32_t arr[9] = { 0 };
switch (s[8])
{
case 'A':
{
arr[7] = 4;
}break;
case 'C':
{
arr[8] = 1;
}break;
case 'G':
{
arr[8] = 2;
}break;
case 'T':
{
arr[8] = 3;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[7])
{
case 'A':
{
arr[7] = arr[8];
}break;
case 'C':
{
arr[7] = arr[8] + 4;
}break;
case 'G':
{
arr[7] = arr[8] + 8;
}break;
case 'T':
{
arr[7] = arr[8] + 12;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[6])
{
case 'A':
{
arr[6] = arr[7];
}break;
case 'C':
{
arr[6] = arr[7] + 16;
}break;
case 'G':
{
arr[6] = arr[7] + 32;
}break;
case 'T':
{
arr[6] = arr[7] + 48;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[5])
{
case 'A':
{
arr[5] = arr[6];
}break;
case 'C':
{
arr[5] = arr[6] + 64;
}break;
case 'G':
{
arr[5] = arr[6] + 128;
}break;
case 'T':
{
arr[5] = arr[6] + 192;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[4])
{
case 'A':
{
arr[4] = arr[5];
}break;
case 'C':
{
arr[4] = arr[5] + 256;
}break;
case 'G':
{
arr[4] = arr[5] + 512;
}break;
case 'T':
{
arr[4] = arr[5] + 768;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[3])
{
case 'A':
{
arr[3] = arr[4];
}break;
case 'C':
{
arr[3] = arr[4] + 1024;
}break;
case 'G':
{
arr[3] = arr[4] + 2048;
}break;
case 'T':
{
arr[3] = arr[4] + 3072;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[2])
{
case 'A':
{
arr[2] = arr[3];
}break;
case 'C':
{
arr[2] = arr[3] + 4096;
}break;
case 'G':
{
arr[2] = arr[3] + 8192;
}break;
case 'T':
{
arr[2] = arr[3] + 12288;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[1])
{
case 'A':
{
arr[1] = arr[2];
}break;
case 'C':
{
arr[1] = arr[2] + 16384;
}break;
case 'G':
{
arr[1] = arr[2] + 32768;
}break;
case 'T':
{
arr[1] = arr[2] + 49152;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[0])
{
case 'A':
{
arr[0] = arr[1];
}break;
case 'C':
{
arr[0] = arr[1] + 65536;
}break;
case 'G':
{
arr[0] = arr[1] + 131072;
}break;
case 'T':
{
arr[0] = arr[1] + 196608;
}break;
default:
{
return UINT_MAX;
}
}
return arr[0];
}
uint32_t calc_hash_11(const char* s) {
uint32_t arr[11] = { 0 };
switch (s[10])
{
case 'A':
{
arr[9] = 4;
}break;
case 'C':
{
arr[10] = 1;
}break;
case 'G':
{
arr[10] = 2;
}break;
case 'T':
{
arr[10] = 3;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[9])
{
case 'A':
{
arr[9] = arr[10];
}break;
case 'C':
{
arr[9] = arr[10] + 4;
}break;
case 'G':
{
arr[9] = arr[10] + 8;
}break;
case 'T':
{
arr[9] = arr[10] + 12;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[8])
{
case 'A':
{
arr[8] = arr[9];
}break;
case 'C':
{
arr[8] = arr[9] + 16;
}break;
case 'G':
{
arr[8] = arr[9] + 32;
}break;
case 'T':
{
arr[8] = arr[9] + 48;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[7])
{
case 'A':
{
arr[7] = arr[8];
}break;
case 'C':
{
arr[7] = arr[8] + 64;
}break;
case 'G':
{
arr[7] = arr[8] + 128;
}break;
case 'T':
{
arr[7] = arr[8] + 192;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[6])
{
case 'A':
{
arr[6] = arr[7];
}break;
case 'C':
{
arr[6] = arr[7] + 256;
}break;
case 'G':
{
arr[6] = arr[7] + 512;
}break;
case 'T':
{
arr[6] = arr[7] + 768;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[5])
{
case 'A':
{
arr[5] = arr[6];
}break;
case 'C':
{
arr[5] = arr[6] + 1024;
}break;
case 'G':
{
arr[5] = arr[6] + 2048;
}break;
case 'T':
{
arr[5] = arr[6] + 3072;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[4])
{
case 'A':
{
arr[4] = arr[5];
}break;
case 'C':
{
arr[4] = arr[5] + 4096;
}break;
case 'G':
{
arr[4] = arr[5] + 8192;
}break;
case 'T':
{
arr[4] = arr[5] + 12288;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[3])
{
case 'A':
{
arr[3] = arr[4];
}break;
case 'C':
{
arr[3] = arr[4] + 16384;
}break;
case 'G':
{
arr[3] = arr[4] + 32768;
}break;
case 'T':
{
arr[3] = arr[4] + 49152;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[2])
{
case 'A':
{
arr[2] = arr[3];
}break;
case 'C':
{
arr[2] = arr[3] + 65536;
}break;
case 'G':
{
arr[2] = arr[3] + 131072;
}break;
case 'T':
{
arr[2] = arr[3] + 196608;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[1])
{
case 'A':
{
arr[1] = arr[2];
}break;
case 'C':
{
arr[1] = arr[2] + 262144;
}break;
case 'G':
{
arr[1] = arr[2] + 524288;
}break;
case 'T':
{
arr[1] = arr[2] + 786432;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[0])
{
case 'A':
{
arr[0] = arr[1];
}break;
case 'C':
{
arr[0] = arr[1] + 1048576;
}break;
case 'G':
{
arr[0] = arr[1] + 2097152;
}break;
case 'T':
{
arr[0] = arr[1] + 3145728;
}break;
default:
{
return UINT_MAX;
}
}
return arr[0];
}
uint32_t calc_hash_13(const char* s) {
uint32_t arr[13] = { 0 };
switch (s[12])
{
case 'A':
{
arr[11] = 4;
}break;
case 'C':
{
arr[12] = 1;
}break;
case 'G':
{
arr[12] = 2;
}break;
case 'T':
{
arr[12] = 3;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[11])
{
case 'A':
{
arr[11] = arr[12];
}break;
case 'C':
{
arr[11] = arr[12] + 4;
}break;
case 'G':
{
arr[11] = arr[12] + 8;
}break;
case 'T':
{
arr[11] = arr[12] + 12;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[10])
{
case 'A':
{
arr[10] = arr[11];
}break;
case 'C':
{
arr[10] = arr[11] + 16;
}break;
case 'G':
{
arr[10] = arr[11] + 32;
}break;
case 'T':
{
arr[10] = arr[11] + 48;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[9])
{
case 'A':
{
arr[9] = arr[10];
}break;
case 'C':
{
arr[9] = arr[10] + 64;
}break;
case 'G':
{
arr[9] = arr[10] + 128;
}break;
case 'T':
{
arr[9] = arr[10] + 192;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[8])
{
case 'A':
{
arr[8] = arr[9];
}break;
case 'C':
{
arr[8] = arr[9] + 256;
}break;
case 'G':
{
arr[8] = arr[9] + 512;
}break;
case 'T':
{
arr[8] = arr[9] + 768;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[7])
{
case 'A':
{
arr[7] = arr[8];
}break;
case 'C':
{
arr[7] = arr[8] + 1024;
}break;
case 'G':
{
arr[7] = arr[8] + 2048;
}break;
case 'T':
{
arr[7] = arr[8] + 3072;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[6])
{
case 'A':
{
arr[6] = arr[7];
}break;
case 'C':
{
arr[6] = arr[7] + 4096;
}break;
case 'G':
{
arr[6] = arr[7] + 8192;
}break;
case 'T':
{
arr[6] = arr[7] + 12288;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[5])
{
case 'A':
{
arr[5] = arr[6];
}break;
case 'C':
{
arr[5] = arr[6] + 16384;
}break;
case 'G':
{
arr[5] = arr[6] + 32768;
}break;
case 'T':
{
arr[5] = arr[6] + 49152;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[4])
{
case 'A':
{
arr[4] = arr[5];
}break;
case 'C':
{
arr[4] = arr[5] + 65536;
}break;
case 'G':
{
arr[4] = arr[5] + 131072;
}break;
case 'T':
{
arr[4] = arr[5] + 196608;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[3])
{
case 'A':
{
arr[3] = arr[4];
}break;
case 'C':
{
arr[3] = arr[4] + 262144;
}break;
case 'G':
{
arr[3] = arr[4] + 524288;
}break;
case 'T':
{
arr[3] = arr[4] + 786432;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[2])
{
case 'A':
{
arr[2] = arr[3];
}break;
case 'C':
{
arr[2] = arr[3] + 1048576;
}break;
case 'G':
{
arr[2] = arr[3] + 2097152;
}break;
case 'T':
{
arr[2] = arr[3] + 3145728;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[1])
{
case 'A':
{
arr[1] = arr[2];
}break;
case 'C':
{
arr[1] = arr[2] + 4194304;
}break;
case 'G':
{
arr[1] = arr[2] + 8388608;
}break;
case 'T':
{
arr[1] = arr[2] + 12582912;
}break;
default:
{
return UINT_MAX;
}
}
switch (s[0])