Skip to content

Commit f7b7d69

Browse files
authored
Merge pull request #11 from satta/rename_prefixes
rename GenomeTools symbols to match new API
2 parents bfc6a05 + e5e441c commit f7b7d69

10 files changed

Lines changed: 40 additions & 40 deletions

File tree

src/gth/align_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
#define SCORE(T,N,M) dpm->core.score[T][N][M]
2929
#define GTH_MINUSINFINITY ((GthFlt) -99999.0)
30-
#define DASH (SEPARATOR-3)
31-
#define UNSET (SEPARATOR-4)
30+
#define DASH (GT_SEPARATOR-3)
31+
#define UNSET (GT_SEPARATOR-4)
3232

3333
/*
3434
The following updates maxvalue if it is smaller than value.

src/gth/bssm_seq_processor.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ static int show_and_check_sample_sizes(GthBSSMSeqProcessor *bsp, bool verbose,
12981298
printf("%s/F0: "GT_WU" seqs (sampled out of "GT_WU")\n", GT_DIR, len2,
12991299
gt_array_size(bsp->e2_false_don_gt));
13001300
printf("%s/Fi: "GT_WU" seqs (sampled out of "GT_WU")\n", GT_DIR,
1301-
MAX3(len0, len1, len2),
1301+
GT_MAX3(len0, len1, len2),
13021302
gt_array_size(bsp->i_false_don_gt));
13031303
}
13041304

@@ -1312,7 +1312,7 @@ static int show_and_check_sample_sizes(GthBSSMSeqProcessor *bsp, bool verbose,
13121312
gt_file_xprintf(logfp, "%s/F0: "GT_WU" seqs (sampled out of "GT_WU")\n",
13131313
GT_DIR, len2, gt_array_size(bsp->e2_false_don_gt));
13141314
gt_file_xprintf(logfp, "%s/Fi: "GT_WU" seqs (sampled out of "GT_WU")\n",
1315-
GT_DIR, MAX3(len0, len1, len2),
1315+
GT_DIR, GT_MAX3(len0, len1, len2),
13161316
gt_array_size(bsp->i_false_don_gt));
13171317

13181318
if (bsp->gcdonor) {
@@ -1333,7 +1333,7 @@ static int show_and_check_sample_sizes(GthBSSMSeqProcessor *bsp, bool verbose,
13331333
printf("%s/F0: "GT_WU" seqs (sampled out of "GT_WU")\n", GC_DIR, len2,
13341334
gt_array_size(bsp->e2_false_don_gc));
13351335
printf("%s/Fi: "GT_WU" seqs (sampled out of "GT_WU")\n", GC_DIR,
1336-
MAX3(len0, len1, len2),
1336+
GT_MAX3(len0, len1, len2),
13371337
gt_array_size(bsp->i_false_don_gc));
13381338
}
13391339

@@ -1347,7 +1347,7 @@ static int show_and_check_sample_sizes(GthBSSMSeqProcessor *bsp, bool verbose,
13471347
gt_file_xprintf(logfp, "%s/F0: "GT_WU" seqs (sampled out of "GT_WU")\n",
13481348
GC_DIR, len2, gt_array_size(bsp->e2_false_don_gc));
13491349
gt_file_xprintf(logfp, "%s/Fi: "GT_WU" seqs (sampled out of "GT_WU")\n",
1350-
GC_DIR, MAX3(len0, len1, len2),
1350+
GC_DIR, GT_MAX3(len0, len1, len2),
13511351
gt_array_size(bsp->i_false_don_gc));
13521352
}
13531353

@@ -1368,7 +1368,7 @@ static int show_and_check_sample_sizes(GthBSSMSeqProcessor *bsp, bool verbose,
13681368
printf("%s/F0: "GT_WU" seqs (sampled out of "GT_WU")\n", AG_DIR, len2,
13691369
gt_array_size(bsp->e2_false_acc));
13701370
printf("%s/Fi: "GT_WU" seqs (sampled out of "GT_WU")\n", AG_DIR,
1371-
MAX3(len0, len1, len2),
1371+
GT_MAX3(len0, len1, len2),
13721372
gt_array_size(bsp->i_false_acc));
13731373
}
13741374

@@ -1382,7 +1382,7 @@ static int show_and_check_sample_sizes(GthBSSMSeqProcessor *bsp, bool verbose,
13821382
gt_file_xprintf(logfp, "%s/F0: "GT_WU" seqs (sampled out of "GT_WU")\n",
13831383
AG_DIR, len2, gt_array_size(bsp->e2_false_acc));
13841384
gt_file_xprintf(logfp, "%s/Fi: "GT_WU" seqs (sampled out of "GT_WU")\n",
1385-
AG_DIR, MAX3(len0, len1, len2),
1385+
AG_DIR, GT_MAX3(len0, len1, len2),
13861386
gt_array_size(bsp->i_false_acc));
13871387

13881388
if (!site_found) {
@@ -1417,19 +1417,19 @@ int gth_bssm_seq_processor_sample(GthBSSMSeqProcessor *bsp, bool verbose,
14171417
len0 = gt_array_size(bsp->i0_true_don_gt);
14181418
len1 = gt_array_size(bsp->i1_true_don_gt);
14191419
len2 = gt_array_size(bsp->i2_true_don_gt);
1420-
sample_bssm_seqs(bsp->i_false_don_gt, MAX3(len0, len1, len2));
1420+
sample_bssm_seqs(bsp->i_false_don_gt, GT_MAX3(len0, len1, len2));
14211421

14221422
if (bsp->gcdonor) {
14231423
len0 = gt_array_size(bsp->i0_true_don_gc);
14241424
len1 = gt_array_size(bsp->i1_true_don_gc);
14251425
len2 = gt_array_size(bsp->i2_true_don_gc);
1426-
sample_bssm_seqs(bsp->i_false_don_gc, MAX3(len0, len1, len2));
1426+
sample_bssm_seqs(bsp->i_false_don_gc, GT_MAX3(len0, len1, len2));
14271427
}
14281428

14291429
len0 = gt_array_size(bsp->i0_true_acc);
14301430
len1 = gt_array_size(bsp->i1_true_acc);
14311431
len2 = gt_array_size(bsp->i2_true_acc);
1432-
sample_bssm_seqs(bsp->i_false_acc, MAX3(len0, len1, len2));
1432+
sample_bssm_seqs(bsp->i_false_acc, GT_MAX3(len0, len1, len2));
14331433

14341434
return 0;
14351435
}

src/gth/dp_param.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
/* XXX: why A? */
3030
#define SUBSTITUTEWILDCARDWITHA(C)\
31-
if (C == WILDCARD)\
31+
if (C == GT_WILDCARD)\
3232
{\
3333
C = gen_alphabet_symbolmap['A'];\
3434
}

src/gth/dp_scores_protein.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static GthFlt get_score(GtScoreMatrix *score_matrix,
3838
DNA of lengths 1, 2, or 3, irrespective of indel size */
3939
rval = scalefactor * indel_penalty;
4040
}
41-
else if (amino != WILDCARD && amino <= CHAR_MAX &&
41+
else if (amino != GT_WILDCARD && amino <= CHAR_MAX &&
4242
gt_alphabet_valid_input(score_matrix_alphabet, amino) &&
4343
origreferencechar <= CHAR_MAX &&
4444
gt_alphabet_valid_input(score_matrix_alphabet,
@@ -63,8 +63,8 @@ static GthFlt get_score(GtScoreMatrix *score_matrix,
6363
wcidx = gt_alphabet_size(score_matrix_alphabet) - 1;
6464
rval = scalefactor *
6565
gt_score_matrix_get_score(score_matrix,
66-
code1 == WILDCARD ? wcidx : code1,
67-
code2 == WILDCARD ? wcidx : code2);
66+
code1 == GT_WILDCARD ? wcidx : code1,
67+
code2 == GT_WILDCARD ? wcidx : code2);
6868
}
6969
}
7070
}

src/gth/dp_scores_protein.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static inline GthFlt GTHGETSCORE(GthDPScoresProtein *scores,
3333
if (n1 == DASH || n2 == DASH || n3 == DASH)
3434
return scores->score[DASH][aa];
3535
else if (n1 > 3 || n2 > 3 || n3 > 3)
36-
return scores->score[WILDCARD][aa];
36+
return scores->score[GT_WILDCARD][aa];
3737
return scores->score[scores->codon2amino[n1][n2][n3]][aa];
3838
}
3939

src/gth/gthalignment.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,14 @@ static void match_mismatch_genomicproteinline(GtUchar **genomicproteinptr,
461461

462462
if (*processing_intron_with_2_bases_left) {
463463
*processing_intron_with_2_bases_left = false;
464-
gt_assert(*first_base_left != UNDEFCHAR);
465-
gt_assert(*second_base_left != UNDEFCHAR);
464+
gt_assert(*first_base_left != GT_UNDEFCHAR);
465+
gt_assert(*second_base_left != GT_UNDEFCHAR);
466466
gt_assert(dummyptr != NULL);
467467
dna[0] = *first_base_left;
468468
dna[1] = *second_base_left;
469469
dna[2] = genseqorig[(*genseqindex)++];
470-
*first_base_left = (GtUchar) UNDEFCHAR;
471-
*second_base_left = (GtUchar) UNDEFCHAR;
470+
*first_base_left = (GtUchar) GT_UNDEFCHAR;
471+
*second_base_left = (GtUchar) GT_UNDEFCHAR;
472472

473473
rval = gt_trans_table_translate_codon(transtable, dna[0], dna[1], dna[2],
474474
&codon, NULL);
@@ -485,9 +485,9 @@ static void match_mismatch_genomicproteinline(GtUchar **genomicproteinptr,
485485
else {
486486
if (*processing_intron_with_1_base_left) {
487487
*processing_intron_with_1_base_left = false;
488-
gt_assert(*first_base_left != UNDEFCHAR);
488+
gt_assert(*first_base_left != GT_UNDEFCHAR);
489489
dna[0] = *first_base_left;
490-
*first_base_left = (GtUchar) UNDEFCHAR;
490+
*first_base_left = (GtUchar) GT_UNDEFCHAR;
491491
}
492492
else {
493493
dna[0] = genseqorig[(*genseqindex)++];
@@ -530,8 +530,8 @@ static GtUword construct_genomic_protein_line(GtUchar *genomicproteinline,
530530
Eoptype eoptype;
531531
GtUword eoplength, l,
532532
i = 0;
533-
GtUchar first_base_left = (GtUchar) UNDEFCHAR,
534-
second_base_left = (GtUchar) UNDEFCHAR,
533+
GtUchar first_base_left = (GtUchar) GT_UNDEFCHAR,
534+
second_base_left = (GtUchar) GT_UNDEFCHAR,
535535
*dummyptr = NULL,
536536
*genomicproteinptr = genomicproteinline;
537537
#ifndef NDEBUG
@@ -824,7 +824,7 @@ static GtUword filltheproteinlines(GtUchar *genomicdnaline,
824824
static GtUchar implodewildcard(GtUchar c, bool wildcardimplosion,
825825
GtAlphabet *alphabet)
826826
{
827-
if (wildcardimplosion && (gt_alphabet_encode(alphabet, c) == WILDCARD)) {
827+
if (wildcardimplosion && (gt_alphabet_encode(alphabet, c) == GT_WILDCARD)) {
828828
if (islower(c))
829829
return (GtUchar) tolower(gt_alphabet_wildcard_show(alphabet));
830830
else
@@ -925,7 +925,7 @@ static void showeditopline(GtFile *outfp,
925925
acompare = tolower(firstlineorig[i]);
926926
bcompare = tolower(secondlineorig[i]);
927927
if (acompare == bcompare && acompare != (GtUchar) CONCRETEGAPSYMBOL &&
928-
gt_alphabet_encode(alphabet, acompare) != (GtUchar) WILDCARD)
928+
gt_alphabet_encode(alphabet, acompare) != (GtUchar) GT_WILDCARD)
929929
{
930930
charinline = true;
931931
break;
@@ -951,7 +951,7 @@ static void showeditopline(GtFile *outfp,
951951
acompare = tolower(firstlineorig[i]);
952952
bcompare = tolower(secondlineorig[i]);
953953
if (acompare == bcompare && acompare != (GtUchar) CONCRETEGAPSYMBOL &&
954-
gt_alphabet_encode(alphabet, acompare) != (GtUchar) WILDCARD)
954+
gt_alphabet_encode(alphabet, acompare) != (GtUchar) GT_WILDCARD)
955955
{
956956
OUTCHAR('|');
957957
} else
@@ -1016,8 +1016,8 @@ static void showeditoplineprotein(GtFile *outfp,
10161016
code2 = gt_alphabet_encode(score_matrix_alphabet, refchar);
10171017
wcidx = gt_alphabet_size(score_matrix_alphabet) - 1;
10181018
score = gt_score_matrix_get_score(score_matrix,
1019-
code1 == WILDCARD ? wcidx : code1,
1020-
code2 == WILDCARD ? wcidx : code2);
1019+
code1 == GT_WILDCARD ? wcidx : code1,
1020+
code2 == GT_WILDCARD ? wcidx : code2);
10211021

10221022
/* output corresponding character depending on score */
10231023
if (score > 0) {
@@ -1260,11 +1260,11 @@ GtUword gthfillthethreealignmentlines(GtUchar **firstline,
12601260

12611261
/* set the lenght of the three output lines */
12621262
lengthofgenomicdnaline = genseqlen
1263-
+ MIN(indelcount, refseqlen * GT_CODON_LENGTH);
1263+
+ GT_MIN(indelcount, refseqlen * GT_CODON_LENGTH);
12641264
lengthofgenomicproteinline = genseqlen
1265-
+ MIN(indelcount, refseqlen * GT_CODON_LENGTH);
1265+
+ GT_MIN(indelcount, refseqlen * GT_CODON_LENGTH);
12661266
lengthofreferenceproteinline = refseqlen * GT_CODON_LENGTH
1267-
+ MIN(indelcount, genseqlen);
1267+
+ GT_MIN(indelcount, genseqlen);
12681268

12691269
/* alloc space for the three output lines */
12701270
*firstline = gt_malloc(lengthofgenomicdnaline * sizeof (GtUchar));
@@ -1354,8 +1354,8 @@ GtUword gthfillthetwoalignmentlines(GtUchar **firstline,
13541354
*shortintroninfo,
13551355
GtUword indelcount)
13561356
{
1357-
*firstline = gt_malloc(ulen + MIN(indelcount, vlen) * sizeof (GtUchar));
1358-
*secondline = gt_malloc(vlen + MIN(indelcount, ulen) * sizeof (GtUchar));
1357+
*firstline = gt_malloc(ulen + GT_MIN(indelcount, vlen) * sizeof (GtUchar));
1358+
*secondline = gt_malloc(vlen + GT_MIN(indelcount, ulen) * sizeof (GtUchar));
13591359

13601360
return fillthelines(*firstline, *secondline, useq, vseq, alignment, lenalg,
13611361
linewidth, showintronmaxlen, shortintroninfo);

src/gth/gthalignment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
#define CONCRETEINTRONSYMBOL '.'
2929
#define CONCRETEGAPSYMBOL '-'
30-
#define ABSTRACTINTRONSYMBOL (SEPARATOR-4) /* the abstract intron symbol */
31-
#define ABSTRACTGAPSYMBOL (SEPARATOR-3) /* the abstract gap symbol */
30+
#define ABSTRACTINTRONSYMBOL (GT_SEPARATOR-4) /* the abstract intron symbol */
31+
#define ABSTRACTGAPSYMBOL (GT_SEPARATOR-3) /* the abstract gap symbol */
3232

3333
/*
3434
For the display of long introns in short form we need the following

src/gth/gthsplicesitescr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void calcsplicesitescoreprocmatch(Traversealignmentstate *state,
8686
if (d->processedalignmentpositions < SPLICE_SITE_SCORE_WINDOW) {
8787
alignmentpositionsleft = SPLICE_SITE_SCORE_WINDOW -
8888
d->processedalignmentpositions;
89-
numofmatchestoprocess = MIN(lengthofeop, alignmentpositionsleft);
89+
numofmatchestoprocess = GT_MIN(lengthofeop, alignmentpositionsleft);
9090

9191
genomicchar = d->gen_seq_tran[state->genomicptr];
9292
referencechar = d->ref_seq_tran[state->referenceptr];

src/gth/path_matrix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ GthPathMatrix* gth_path_matrix_new(GthPath **path,
8080
{
8181
GthPathMatrix *pm = gt_malloc(sizeof *pm);
8282
pm->gen_range.start = btmatrixgenrange->start;
83-
pm->gen_range.end = MIN(btmatrixgenrange->end, gen_dp_length);
83+
pm->gen_range.end = GT_MIN(btmatrixgenrange->end, gen_dp_length);
8484
pm->ref_range.start = btmatrixrefrange->start;
85-
pm->ref_range.end = MIN(btmatrixrefrange->end, ref_dp_length);
85+
pm->ref_range.end = GT_MIN(btmatrixrefrange->end, ref_dp_length);
8686
gt_array2dim_calloc(pm->entries, gt_range_length(&pm->gen_range),
8787
gt_range_length(&pm->ref_range));
8888
path_matrix_fill(pm, path, ri);

src/libgenomethreader/jt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static GtRowInfo* get_half_row_info(GtRowInfo *ri_full,
419419
ri_half[i].offset = ri_full[x].offset;
420420
if (y < full_length) {
421421
if (ri_full[x].offset == ri_full[y].offset)
422-
ri_half[i].length = MAX(ri_full[x].length, ri_full[y].length);
422+
ri_half[i].length = GT_MAX(ri_full[x].length, ri_full[y].length);
423423
else {
424424
gt_assert(ri_full[x].offset < ri_full[y].offset);
425425
if (ri_full[x].offset + ri_full[x].length > ri_full[y].offset) {

0 commit comments

Comments
 (0)