40 softbase(
char base_,
int origin_,
char last_gapchar_) :
43 last_gapchar(last_gapchar_),
44 targetpos(NO_POSITION)
62 mutable int *soft_remap_tab;
64 char *calc_softmapping(
softbaselist& softbases,
int start,
int end,
int &outlen)
const;
67 bool have_softmapping()
const {
return soft_remap_tab; }
68 void create_softmapping()
const;
69 void forget_softmapping()
const {
70 delete [] soft_remap_tab;
71 soft_remap_tab =
NULp;
74 static int *build_initial_mapping(
const char *iref,
int ilen,
const char *oref,
int olen);
75 void merge_mapping(
MG_remap &other,
int& inconsistent,
int& added);
90 const char *
add_reference(
const char *in_reference,
const char *out_reference);
91 char *
remap(
const char *sequence)
const;
93 #if defined(DUMP_MAPPING)
94 static void dump(
const int *data,
int len,
const char *comment,
int dontShow) {
99 for (
int pos = 0; pos<len; ++pos) {
100 if (data[pos] == dontShow) {
101 fprintf(stdout,
"%*s", digits,
"_");
104 fprintf(stdout,
"%*i", digits, data[pos]);
107 fprintf(stdout,
" (%s)\n", comment);
110 void dump_remap(
const char *comment) { dump(remap_tab, in_length, comment, NO_POSITION); }
111 #endif // DUMP_MAPPING
114 int *MG_remap::build_initial_mapping(
const char *iref,
int ilen,
const char *oref,
int olen) {
115 int *
remap =
new int[ilen];
117 const char *spacers =
"-. n";
122 while (ipos<ilen && opos<olen) {
123 size_t ispaces = strspn(iref+ipos, spacers);
124 size_t ospaces = strspn(oref+opos, spacers);
126 while (ispaces && ipos<ilen) {
131 if (ipos<ilen && opos<olen) remap[ipos++] = opos++;
143 void MG_remap::merge_mapping(
MG_remap &other,
int& inconsistent,
int& added) {
144 const int *primary = remap_tab;
145 int *secondary = other.remap_tab;
146 bool increased_len =
false;
148 if (other.in_length>in_length) {
153 increased_len =
true;
155 out_length =
std::max(out_length, other.out_length);
157 int mixlen =
std::min(in_length, other.in_length);
162 int max_target_pos = 0;
163 for (
int pos = 0; pos<mixlen; ++pos) {
164 max_target_pos =
std::max(max_target_pos, primary[pos]);
165 if (secondary[pos]<max_target_pos) {
166 if (secondary[pos] != NO_POSITION) {
167 #if defined(DUMP_INCONSISTENCIES)
168 fprintf(stderr,
"merge-inconsistency: pos=%i primary[]=%i secondary[]=%i max_target_pos=%i\n",
169 pos, primary[pos], secondary[pos], max_target_pos);
170 #endif // DUMP_INCONSISTENCIES
179 int min_target_pos = out_length-1;
180 for (
int pos = mixlen-1; pos >= 0; --pos) {
181 if (primary[pos] >= 0 && primary[pos]<min_target_pos) min_target_pos = primary[pos];
182 if (secondary[pos] > min_target_pos) {
183 #if defined(DUMP_INCONSISTENCIES)
184 fprintf(stderr,
"merge-inconsistency: pos=%i primary[]=%i secondary[]=%i min_target_pos=%i\n",
185 pos, primary[pos], secondary[pos], min_target_pos);
186 #endif // DUMP_INCONSISTENCIES
195 for (
int pos = 0; pos < mixlen; ++pos) {
196 if (primary[pos] == NO_POSITION) {
197 remap_tab[pos] = secondary[pos];
201 remap_tab[pos] = primary[pos];
208 for (
int pos = other.in_length; pos<in_length; ++pos) {
221 if (have_softmapping()) forget_softmapping();
224 in_length = strlen(in_reference);
225 out_length = strlen(out_reference);
226 remap_tab = build_initial_mapping(in_reference, in_length, out_reference, out_length);
227 #if defined(DUMP_MAPPING)
228 dump_remap(
"initial");
229 #endif // DUMP_MAPPING
235 int inconsistent, added;
236 merge_mapping(tmp, inconsistent, added);
238 if (inconsistent>0) warning =
GBS_global_string(
"contains %i inconsistent positions", inconsistent);
240 const char *useless_warning =
"doesn't add useful information";
242 else warning = useless_warning;
245 #if defined(DUMP_MAPPING)
246 dump_remap(
"merged");
247 #endif // DUMP_MAPPING
253 void MG_remap::create_softmapping()
const {
254 soft_remap_tab =
new int[in_length];
258 for (pos = 0; pos<in_length && last_fixed_position ==
NO_POSITION; ++pos) {
259 if (remap_tab[pos] == NO_POSITION) {
264 last_fixed_position = pos;
267 if (last_fixed_position != NO_POSITION) {
268 for ( ; pos<in_length; ++pos) {
269 if (remap_tab[pos] != NO_POSITION) {
270 int softstart = last_fixed_position+1;
271 int softsize = pos-softstart;
274 int target_softstart = remap_tab[last_fixed_position]+1;
275 int target_softsize = remap_tab[pos]-target_softstart;
278 if (softsize>1 && target_softsize>1) {
279 target_step = double(target_softsize-1)/(softsize-1);
285 if (target_step >= 1.0 && target_softsize>softsize) {
287 int halfsoftsize = softsize/2;
288 int target_softpos = softstart;
290 for (off = 0; off<halfsoftsize; ++off) {
291 soft_remap_tab[softstart+off] = target_softpos++;
293 target_softpos += target_softsize-softsize;
294 for (; off<softsize; ++off) {
295 soft_remap_tab[softstart+off] = target_softpos++;
299 double target_softpos = target_softstart;
300 for (
int off = 0; off<softsize; ++off) {
301 soft_remap_tab[softstart+off] =
int(target_softpos+0.5);
302 target_softpos += target_step;
306 last_fixed_position = pos;
311 for (--pos; pos>last_fixed_position; --pos) {
316 #if defined(DUMP_MAPPING)
317 dump(soft_remap_tab, in_length,
"softmap", -1);
318 #endif // DUMP_MAPPING
323 bool justseendot =
false;
326 while (excessive_positions && next != softbases.end()) {
327 bool isdot = (next->base ==
'.');
328 if (isdot && justseendot) {
329 excessive_positions--;
330 next = softbases.erase(next);
338 if (excessive_positions) {
340 next = softbases.begin();
341 while (excessive_positions && next != softbases.end()) {
342 if (next->base ==
'.') {
343 next = softbases.erase(next);
352 #if defined(DUMP_SOFTMAPPING)
353 static char *softbaselist_2_string(
const softbaselist& softbases) {
358 base->last_gapchar ? base->last_gapchar :
' ',
362 if (base->targetpos == NO_POSITION) {
366 out.putlong(base->targetpos);
370 return out.release();
372 #endif // DUMP_SOFTMAPPING
374 char *MG_remap::calc_softmapping(
softbaselist& softbases,
int start,
int end,
int& outlen)
const {
378 int wanted_size = end-start+1;
379 int listsize = softbases.size();
381 #if defined(DUMP_SOFTMAPPING)
382 char *sbl_initial = softbaselist_2_string(softbases);
383 char *sbl_exdots =
NULp;
384 char *sbl_target =
NULp;
385 char *sbl_exclash =
NULp;
386 #endif // DUMP_SOFTMAPPING
388 if (listsize>wanted_size) {
389 int excessive_positions = listsize-wanted_size;
390 drop_dots(softbases, excessive_positions);
391 listsize = softbases.size();
393 #if defined(DUMP_SOFTMAPPING)
394 sbl_exdots = softbaselist_2_string(softbases);
395 #endif // DUMP_SOFTMAPPING
399 if (listsize >= wanted_size) {
409 bool conflicts =
false;
412 for (
softbaseiter base = softbases.begin(); base != softbases.end(); ++base) {
414 int targetpos = soft_remap_tab[base->origin];
415 if (targetpos == lasttargetpos) {
419 base->targetpos = lasttargetpos = targetpos;
423 #if defined(DUMP_SOFTMAPPING)
424 sbl_target = softbaselist_2_string(softbases);
425 #endif // // DUMP_SOFTMAPPING
429 for (softbaselist::reverse_iterator base = softbases.rbegin(); base != softbases.rend(); ++base) {
430 if (base->targetpos >= nextpos) {
431 base->targetpos = nextpos-1;
433 nextpos = base->targetpos;
439 #if defined(DUMP_SOFTMAPPING)
440 sbl_exclash = softbaselist_2_string(softbases);
441 #endif // // DUMP_SOFTMAPPING
445 for (
softbaseiter base = softbases.begin(); base != softbases.end(); ++base) {
446 int pos = base->targetpos -
start;
449 char gapchar = base->last_gapchar;
450 while (idx<pos) result[idx++] = gapchar;
452 result[idx++] = base->base;
459 #if defined(DUMP_SOFTMAPPING)
462 printf(
"initial:%s\n", sbl_initial);
463 if (sbl_exdots) printf(
"exdots :%s\n", sbl_exdots);
464 if (sbl_target) printf(
"target :%s\n", sbl_target);
465 if (sbl_exclash) printf(
"exclash:%s\n", sbl_exclash);
466 printf(
"calc_softmapping(%i, %i) -> \"%s\"\n", start, end, result);
472 #endif // DUMP_SOFTMAPPING
479 char *softmapped = calc_softmapping(softbases, start, end, mappedlen);
481 outs.
cat(softmapped);
489 int slen = strlen(sequence);
490 int minlen =
std::min(slen, in_length);
496 if (!have_softmapping()) create_softmapping();
499 for (pos = 0; pos<in_length && soft_remap_tab[pos] ==
LEFT_BORDER; ++pos) {
500 char c = pos<slen ? sequence[pos] :
'-';
503 softbases.push_back(
softbase(c, pos,
'.'));
506 char last_gapchar = 0;
508 int bases = softbases.size();
510 int fixed = remap_tab[pos];
513 int bases_start = fixed-bases;
514 if (written<bases_start) {
515 outs.
nput(
'.', bases_start-written);
516 written = bases_start;
519 written += softmap_to(softbases, written, fixed-1, outs);
528 for (; pos<in_length; ++pos) {
529 char c = pos<slen ? sequence[pos] :
'-';
530 int target_pos = remap_tab[pos];
532 if (target_pos == NO_POSITION) {
534 if (!last_gapchar) last_gapchar =
'-';
537 if (!last_gapchar) last_gapchar = c ==
'.' ?
'.' :
'-';
539 softbases.push_back(
softbase(c, pos, last_gapchar));
540 if (c !=
'.') last_gapchar = 0;
544 if (!softbases.empty()) {
545 written += softmap_to(softbases, written, target_pos-1, outs);
547 if (written<target_pos) {
548 if (!last_gapchar) last_gapchar = c ==
'.' ?
'.' :
'-';
550 outs.
nput(last_gapchar, target_pos-written);
551 written = target_pos;
555 if (!last_gapchar) last_gapchar =
'-';
556 outs.
put(last_gapchar); written++;
559 outs.
put(c); written++;
560 if (c !=
'.') last_gapchar = 0;
570 if (!softbases.empty()) {
572 softmap_to(softbases, written, written, outs);
577 const char *gap_chars =
"- .";
578 for (
int i = minlen; i < slen; i++) {
580 if (!strchr(gap_chars, c)) outs.
put(c);
589 for (terminal_gaps = 0; terminal_gaps<end; ++terminal_gaps) {
590 char c = out[end-1-terminal_gaps];
591 if (c !=
'-' and c !=
'.')
break;
597 outs.
nput(
'.', terminal_gaps);
608 char *ref_list =
ARB_strdup(reference_species_names);
610 for (
char *tok = strtok(ref_list,
" \n,;"); tok; tok = strtok(
NULp,
" \n,;")) {
611 bool is_SAI = strncmp(tok,
"SAI:", 4) == 0;
624 if (!gb_species_left || !gb_species_right) {
626 is_SAI ?
"" :
"species ",
628 gb_species_left ?
"right" :
"left"));
635 if (gb_seq_left && gb_seq_right) {
639 if (type_left != type_right) {
675 for (n_remaps = 0; alignment_names[n_remaps]; n_remaps++) {}
678 for (
int i = 0; i<n_remaps; ++i) {
679 remaps[i] =
MG_create_remap(gb_left, gb_right, reference_species_names, alignment_names[i]);
686 for (
int i=0; i<n_remaps; i++)
delete remaps[i];
697 if (gb_seq_left && gb_seq_right) {
701 if (strcmp(ls, rs) == 0) {
703 rs = remap.
remap(ls);
710 if (old_check == new_check) {
733 for (
int i=0; i<remaps.
size() && !
error; i++) {
749 #if defined(VERBOOSE_REMAP_TESTS)
750 #define DUMP_REMAP(id, comment, from, to) fprintf(stderr, "%s %s '%s' -> '%s'\n", id, comment, from, to)
751 #define DUMP_REMAP_STR(str) fputs(str, stderr)
753 #define DUMP_REMAP(id, comment, from, to)
754 #define DUMP_REMAP_STR(str)
757 #define TEST_REMAP(id, remapper, ASS_EQ, seqold, expected, got) \
758 char *calculated = remapper.remap(seqold); \
759 DUMP_REMAP(id, "want", seqold, expected); \
760 DUMP_REMAP(id, "calc", seqold, calculated); \
761 ASS_EQ(calculated, expected, got); \
762 DUMP_REMAP_STR("\n"); \
765 #define TEST_REMAP1REF_INT(id, ASS_EQ, refold, refnew, seqold, expected, got) \
768 DUMP_REMAP(id, "ref ", refold, refnew); \
769 remapper.add_reference(refold, refnew); \
770 TEST_REMAP(id, remapper, ASS_EQ, seqold, expected, got); \
773 #define TEST_REMAP2REFS_INT(id, ASS_EQ, refold1, refnew1, refold2, refnew2, seqold, expected, got) \
776 DUMP_REMAP(id, "ref1", refold1, refnew1); \
777 DUMP_REMAP(id, "ref2", refold2, refnew2); \
778 remapper.add_reference(refold1, refnew1); \
779 remapper.add_reference(refold2, refnew2); \
780 TEST_REMAP(id, remapper, ASS_EQ, seqold, expected, got); \
783 #define TEST_REMAP1REF(id,ro,rn,seqold,expected) TEST_REMAP1REF_INT(id, TEST_EXPECT_EQUAL__IGNARG, ro, rn, seqold, expected, NULp)
784 #define TEST_REMAP1REF__BROKEN(id,ro,rn,seqold,expected,got) TEST_REMAP1REF_INT(id, TEST_EXPECT_EQUAL__BROKEN, ro, rn, seqold, expected, got)
786 #define TEST_REMAP2REFS(id,ro1,rn1,ro2,rn2,seqold,expected) TEST_REMAP2REFS_INT(id, TEST_EXPECT_EQUAL__IGNARG, ro1, rn1, ro2, rn2, seqold, expected, NULp)
788 #define TEST_REMAP1REF_FWDREV(id, ro, rn, so, sn) \
789 TEST_REMAP1REF(id "(fwd)", ro, rn, so, sn); \
790 TEST_REMAP1REF(id "(rev)", rn, ro, sn, so)
792 #define TEST_REMAP1REF_ALLDIR(id, ro, rn, so, sn) \
793 TEST_REMAP1REF_FWDREV(id "/ref=ref", ro, rn, so, sn); \
794 TEST_REMAP1REF_FWDREV(id "/ref=src", so, sn, ro, rn)
796 #define TEST_REMAP2REFS_FWDREV(id, ro1, rn1, ro2, rn2, so, sn) \
797 TEST_REMAP2REFS(id "(fwd)", ro1, rn1, ro2, rn2, so, sn); \
798 TEST_REMAP2REFS(id "(rev)", rn1, ro1, rn2, ro2, sn, so)
800 #define TEST_REMAP2REFS_ALLDIR(id, ro1, rn1, ro2, rn2, so, sn) \
801 TEST_REMAP2REFS_FWDREV(id "/ref=r1+r2 ", ro1, rn1, ro2, rn2, so, sn); \
802 TEST_REMAP2REFS_FWDREV(id "/ref=r1+src", ro1, rn1, so, sn, ro2, rn2); \
803 TEST_REMAP2REFS_FWDREV(id "/ref=r2+src", ro2, rn2, so, sn, ro1, rn1)
809 TEST_REMAP1REF_ALLDIR(
"simple gap",
813 TEST_REMAP1REF_FWDREV(
"dotgap",
817 TEST_REMAP1REF(
"unused position (1)",
818 "A-C-G-T",
"A--C--G--T",
819 "A---G-T",
"A-----G--T");
820 TEST_REMAP1REF(
"unused position (2)",
821 "A-C-G-T",
"A--C--G--T",
822 "Az-z-zT",
"Az--z--z-T");
824 TEST_REMAP1REF(
"empty (1)",
827 TEST_REMAP1REF(
"empty (2)",
828 "...A-C-G...",
"...A--C--G...",
831 TEST_REMAP1REF(
"leadonly",
832 "...A-C-G...",
"...A--C--G...",
834 TEST_REMAP1REF(
"trailonly",
835 "...A-C-G...",
"...A--C--G...",
836 ".........XX",
"..........XX");
837 TEST_REMAP1REF__BROKEN(
"lead+trail",
838 "...A-C-G...",
"...A--C--G...",
839 "XX.......XX",
".XX-------XX",
842 TEST_REMAP1REF(
"enforce leading dots (1)",
843 "--A-T",
"------A--T",
844 "--T-A",
"......T--A");
845 TEST_REMAP1REF(
"enforce leading dots (2)",
846 "---A-T",
"------A--T",
847 "-.-T-A",
"......T--A");
848 TEST_REMAP1REF(
"enforce leading dots (3)",
849 "---A-T",
"------A--T",
850 "...T-A",
"......T--A");
851 TEST_REMAP1REF(
"enforce leading dots (4)",
852 "-..--A-T",
"--.---A--T",
853 "-.-.-T-A",
"......T--A");
854 TEST_REMAP1REF(
"enforce leading dots (5)",
855 "---A-T-",
"---A----T",
856 "-----A-",
"........A");
857 TEST_REMAP1REF(
"enforce leading dots (6)",
858 "---A-T-",
"---A----T",
859 ".....A-",
"........A");
861 TEST_REMAP1REF(
"no trailing gaps",
865 TEST_REMAP1REF(
"should expand full-dot-gaps (1)",
868 TEST_REMAP1REF(
"should expand full-dot-gaps (2)",
869 "AC--GT",
"AC----GT",
870 "TG..CA",
"TG....CA");
872 TEST_REMAP1REF(
"keep 'missing bases' (1)",
873 "AC---GT",
"AC---GT",
874 "TG-.-CA",
"TG-.-CA");
876 TEST_REMAP1REF(
"keep 'missing bases' (2)",
877 "AC-D-GT",
"AC-D-GT",
878 "TG-.-CA",
"TG-.-CA");
882 TEST_REMAP2REFS_ALLDIR(
"simple 3-way",
883 "A-CA-C-T",
"AC-A---CT",
884 "A---GC-T",
"A----G-CT",
885 "T-GAC--A",
"TG-A-C--A");
887 TEST_REMAP2REFS(
"undefpos-nogap(2U)",
891 TEST_REMAP2REFS(
"undefpos-nogap(3U)",
895 TEST_REMAP2REFS(
"undefpos-nogap(4U)",
898 "GUUUUG",
"GUU-UUG");
899 TEST_REMAP2REFS(
"undefpos-nogap(4U2)",
900 "-----A",
"-------A",
901 "C-----",
"C-------",
902 "GUUUUG",
"GUU--UUG");
904 TEST_REMAP2REFS(
"undefpos1-gapleft",
908 TEST_REMAP2REFS(
"undefpos1-gapright",
914 TEST_REMAP2REFS(
"missing ali-pos (ref1-source)",
919 TEST_REMAP2REFS(
"missing ali-pos (ref2-source)",
924 TEST_REMAP2REFS(
"missing ali-pos (ref1-target)",
928 TEST_REMAP2REFS(
"missing ali-pos (ref2-target)",
933 TEST_REMAP2REFS(
"missing ali-pos (seq-source)",
941 TEST_REMAP1REF(
"gap gets too small (1)",
942 "A---T---A",
"A--T--A",
943 "AGGGT---A",
"AGGGT-A");
945 TEST_REMAP1REF(
"gap gets too small (2)",
946 "A---T---A",
"A--T--A",
947 "AGGGT--GA",
"AGGGTGA");
949 TEST_REMAP1REF(
"gap gets too small (3)",
950 "A---T---A",
"A--T--A",
951 "AGGGT-G-A",
"AGGGTGA");
953 TEST_REMAP1REF(
"gap gets too small (4)",
954 "A---T---A",
"A--T--A",
955 "AGGGTG--A",
"AGGGTGA");
957 TEST_REMAP1REF(
"gap tightens to fit (1)",
958 "A---T---A",
"A--T--A",
959 "AGG-T---A",
"AGGT--A");
961 TEST_REMAP1REF(
"gap tightens to fit (2)",
962 "A---T---A",
"A--T--A",
963 "AGC-T---A",
"AGCT--A");
964 TEST_REMAP1REF(
"gap tightens to fit (2)",
965 "A---T---A",
"A--T--A",
966 "A-CGT---A",
"ACGT--A");
968 TEST_REMAP1REF(
"gap with softmapping conflict (1)",
969 "A-------A",
"A----A",
970 "A-CGT---A",
"ACGT-A");
971 TEST_REMAP1REF(
"gap with softmapping conflict (2)",
972 "A-------A",
"A----A",
973 "A--CGT--A",
"ACGT-A");
974 TEST_REMAP1REF(
"gap with softmapping conflict (3)",
975 "A-------A",
"A----A",
976 "A---CGT-A",
"A-CGTA");
977 TEST_REMAP1REF(
"gap with softmapping conflict (4)",
978 "A-------A",
"A----A",
979 "A----CGTA",
"A-CGTA");
980 TEST_REMAP1REF(
"gap with softmapping conflict (5)",
981 "A-------A",
"A----A",
982 "AC----GTA",
"AC-GTA");
984 TEST_REMAP1REF(
"drop missing bases to avoid misalignment (1)",
987 TEST_REMAP1REF(
"drop missing bases to avoid misalignment (2)",
990 TEST_REMAP1REF(
"dont drop missing bases if fixed map",
993 TEST_REMAP1REF(
"dont drop gaps if fixed map",
999 TEST_REMAP1REF(
"append rest of seq (1)",
1001 "AGG---T...A...",
"A--GGTA");
1002 TEST_REMAP1REF(
"append rest of seq (2)",
1004 "AGG---T...A...",
"A--GGTA");
1005 TEST_REMAP1REF(
"append rest of seq (3)",
1007 "AGG---T...A...",
"A--GGTA");
1008 TEST_REMAP1REF(
"append rest of seq (4)",
1010 "AGG---T...A...",
"A--G--GTA");
1011 TEST_REMAP1REF(
"append rest of seq (4)",
1013 "AGG---T...A...",
"A--GG--TA");
1017 TEST_REMAP2REFS(
"impossible references",
1018 "AC-TA",
"A---CT--A",
1019 "A-GTA",
"AG---T--A",
1020 "TGCAT",
"T---GCA-T");
1022 TEST_REMAP2REFS(
"impossible references",
1023 "AC-TA",
"A--C-T--A",
1024 "A-GTA",
"AG---T--A",
1025 "TGCAT",
"T--GCA--T");
1028 #endif // UNIT_TESTS
void cut_tail(size_t byte_count)
GB_ERROR GB_write_string(GBDATA *gbd, const char *s)
softbase(char base_, int origin_, char last_gapchar_)
void GBT_get_alignment_names(ConstStrArray &names, GBDATA *gbd)
char * ARB_strdup(const char *str)
char * GB_read_as_string(GBDATA *gbd)
MG_remaps(GBDATA *gb_left, GBDATA *gb_right, bool enable, const char *reference_species_names)
const char * GBS_global_string(const char *templat,...)
void warning(int warning_num, const char *warning_message)
static char * alignment_name
void nput(char c, size_t count)
void cat(const char *from)
static HelixNrInfo * start
GBDATA * GBT_find_SAI(GBDATA *gb_main, const char *name)
GB_ERROR MG_adaptAllCopiedAlignments(const MG_remaps &remaps, GBDATA *source_species, GBDATA *destination_species)
GB_ERROR GB_await_error()
GB_TYPES GB_read_type(GBDATA *gbd)
TYPE * ARB_alloc(size_t nelem)
static void drop_dots(softbaselist &softbases, int excessive_positions)
softbaselist::const_iterator const_softbaseiter
CONSTEXPR_INLINE int digits(int parts)
static void error(const char *msg)
const char * add_reference(const char *in_reference, const char *out_reference)
CONSTEXPR_INLINE_Cxx14 void swap(unsigned char &c1, unsigned char &c2)
const MG_remap & remap(int idx) const
const char * alignment_name(int idx) const
char * remap(const char *sequence) const
GBDATA * GBT_find_sequence(GBDATA *gb_species, const char *aliname)
static GB_ERROR adaptCopiedAlignment(const MG_remap &remap, GBDATA *source_species, GBDATA *destination_species, const char *alignment_name)
static void copy(double **i, double **j)
TYPE * ARB_calloc(size_t nelem)
static MG_remap * MG_create_remap(GBDATA *gb_left, GBDATA *gb_right, const char *reference_species_names, const char *alignment_name)
char * GB_read_string(GBDATA *gbd)
uint32_t GBS_checksum(const char *seq, int ignore_case, const char *exclude)
void aw_message(const char *msg)
bool is_std_gap(const char c)
GBDATA * GBT_find_species(GBDATA *gb_main, const char *name)
#define __ATTR__REDUCED_OPTIMIZE__NO_GCSE
const char * get_data() const
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
softbaselist::iterator softbaseiter
GB_CSTR GBT_get_name_or_description(GBDATA *gb_item)
static int info[maxsites+1]
size_t get_position() const
std::list< softbase > softbaselist