13 #include <PT_server_prototypes.h>
36 #define MIN_DESIGN_PROBE_LENGTH DOMAIN_MIN_LENGTH
37 int Complement::calc_complement(
int base) {
48 inline void aisc_link(dll_public *dll, PT_tprobes *tprobe) {
aisc_link(reinterpret_cast<dllpublic_ext*>(dll), reinterpret_cast<dllheader_ext*>(tprobe)); }
51 THIS->bond[0].val = 0.0;
52 THIS->bond[1].val = 0.0;
53 THIS->bond[2].val = 0.5;
54 THIS->bond[3].val = 1.1;
55 THIS->bond[4].val = 0.0;
56 THIS->bond[5].val = 0.0;
57 THIS->bond[6].val = 1.5;
58 THIS->bond[7].val = 0.0;
59 THIS->bond[8].val = 0.5;
60 THIS->bond[9].val = 1.5;
61 THIS->bond[10].val = 0.4;
62 THIS->bond[11].val = 0.9;
63 THIS->bond[12].val = 1.1;
64 THIS->bond[13].val = 0.0;
65 THIS->bond[14].val = 0.9;
66 THIS->bond[15].val = 0.0;
75 dt_bondssum(
double dt_,
double sum_bonds_) : dt(dt_), sum_bonds(sum_bonds_) {}
84 Oligo(
const char *data_,
int length_) : data(data_), length(length_) {}
90 int size()
const {
return length; }
93 return skip <= length ?
Oligo(data+skip, length-skip) :
Oligo();
96 #if defined(DUMP_OLIGO_MATCHING)
97 void dump(FILE *out)
const {
111 double maxDomainBondSum;
116 : oligo(other.oligo),
117 matched(other.matched+1),
118 domain_found(other.domain_found),
119 maxDomainBondSum(other.maxDomainBondSum),
120 linkage(other.linkage)
125 lastSplit = matched-1;
126 linkage.
dt -= strength;
133 : oligo(other.oligo),
134 matched(other.matched+1),
135 domain_found(other.domain_found),
136 maxDomainBondSum(other.maxDomainBondSum),
137 linkage(other.linkage)
142 lastSplit = other.lastSplit;
143 linkage.
dt += strength;
154 void accept_rest_dangling() {
156 lastSplit = matched+1;
157 matched = oligo.
size();
161 void optimal_bind_rest(
const Splits& splits) {
165 double strength = splits.
check(pc, pc);
172 linkage.
dt += strength;
188 maxDomainBondSum(-1),
193 int dangle_count = oligo.
size()-matched;
200 return oligo.
at(matched);
218 strength = splits.
check(pc, c);
228 accepted.accept_rest_dangling();
246 double ndt = (linkage.
dt * pdc->dt + (tprobe->sum_bonds - maxDomainBondSum)*pdc->dte) / tprobe->seq_len;
255 optimum.optimal_bind_rest(splits);
260 return centpos >= PERC_SIZE;
265 #if defined(DUMP_OLIGO_MATCHING)
266 void dump(FILE *out)
const {
267 fputs(
"oligo='", out);
270 const char *domainState =
"impossible";
274 fprintf(out,
"' matched=%2i lastSplit=%2i domainLength()=%2i dangling()=%2i domainState=%s maxDomainBondSum=%f dt=%f sum_bonds=%f\n",
281 const PT_tprobes *tp1 = (
const PT_tprobes*)vtp1;
282 const PT_tprobes *tp2 = (
const PT_tprobes*)vtp2;
286 cmp = tp1->apos - tp2->apos;
287 if (!cmp) cmp = strcmp(tp1->sequence, tp2->sequence);
293 const PT_tprobes *tp1 = (
const PT_tprobes*)vtp1;
294 const PT_tprobes *tp2 = (
const PT_tprobes*)vtp2;
296 return strcmp(tp1->sequence, tp2->sequence);
306 int list_len = pdc->tprobes->get_count();
308 PT_tprobes **my_list = ARB_calloc<PT_tprobes*>(list_len);
313 for (i = 0, tprobe = pdc->tprobes; tprobe; i++, tprobe = tprobe->next) {
328 for (
int i=0; i<list_len; i++) {
329 aisc_unlink(reinterpret_cast<dllheader_ext*>(my_list[i]));
341 for (i=0, tprobe = pdc->tprobes;
343 i++, tprobe = tprobe->next) ;
346 while (tprobe->next) {
347 destroy_PT_tprobes(tprobe->next);
354 if (*probe ==
PT_G ||
365 while ((i=*(probe++))) {
366 if (i ==
PT_G || i ==
PT_C) t+=4.0;
else t += 2.0;
372 for (PT_tprobes *tprobe = pdc->tprobes; tprobe; tprobe = tprobe->next) {
380 for (i=0; i<PERC_SIZE; ++i) {
381 sum += tprobe->perc[i];
382 tprobe->perc[i] = sum;
388 int limit = 2*tprobe->mishits;
389 for (i=0; i<(PERC_SIZE-1); ++i) {
390 if (tprobe->perc[i]>limit)
break;
394 tprobe->quality = ((double)tprobe->groupsize * i) + 1000.0/(1000.0 + tprobe->perc[i]);
396 #if defined(DEBUG) && 0
397 fprintf(stderr,
"quality=%3i (groupsize=%3i, mishits=%3i, limit=%3i, COL=%2i, hits[COL]=%i)\n",
398 int(tprobe->quality+0.5),
409 const int firstSmall = ALPHA_SIZE/2;
411 if (idx >= firstSmall) {
412 c =
'a'+(idx-firstSmall);
422 return pdc->max_probelen == -1 ? pdc->min_probelen : pdc->max_probelen;
427 inline int shown_qual(
const PT_tprobes *tprobe) {
return int(tprobe->quality+0.5); }
430 int width[PERC_SIZE];
438 static inline void track_max(
int& tracked,
int val) { tracked =
std::max(tracked, val); }
440 void collect(
const int *perc) {
for (
int i = 0; i<PERC_SIZE; ++i) width[i] =
std::max(width[i], perc[i]); }
441 void collect(
const PT_tprobes *tprobe) {
442 collect(tprobe->perc);
447 track_max(maxprobelen, tprobe->seq_len);
451 for (
int i = 0; i<PERC_SIZE; ++i) width[i] = 0;
461 static inline int width4num(
int num) {
469 return digits ? digits : 1;
478 for (PT_tprobes *tprobe = pdc->tprobes; tprobe; tprobe = tprobe->next) collect(tprobe);
481 for (
int i = 0; i<PERC_SIZE; ++i) width[i] = width4num(width[i]);
483 apos_width =
std::max(width4num(apos_width), 2);
484 ecol_width =
std::max(width4num(ecol_width), 4);
485 qual_width =
std::max(width4num(qual_width), 4);
486 grps_width =
std::max(width4num(grps_width), 4);
492 for (
int i = 0; i<PERC_SIZE; ++i) {
493 buffer[printed++] =
' ';
495 ? sprintf(buffer+printed,
"%*i", width[i], perc[i])
496 : sprintf(buffer+printed,
"%*s", width[i],
"-");
513 PD_Formatter4design::iterator found = format4design.find(pdc);
514 if (found == format4design.end()) {
516 found = format4design.find(pdc);
520 return found->second;
529 PT_pdc *pdc = (PT_pdc *)tprobe->mh.parent->parent;
535 int len = tprobe->seq_len;
537 strcpy(probe, tprobe->sequence);
540 p += sprintf(p,
"%-*s", formatter.get_max_designed_len()+1, probe);
549 for (c=0; c<ALPHA_SIZE; c++) {
550 if (!pdc->pos_groups[c]) {
551 pdc->pos_groups[c] = apos;
555 int dist =
abs(apos - pdc->pos_groups[c]);
556 if (dist < pdc->min_probelen) {
557 apos = apos - pdc->pos_groups[c];
578 p += sprintf(p,
"%2i ", tprobe->seq_len);
579 p += sprintf(p,
"%c%c%*i ", c, cs, formatter.get_apos_width(), apos);
580 p += sprintf(p,
"%*i ", formatter.get_ecol_width(),
shown_ecoli(tprobe));
583 p += sprintf(p,
"%*i ", formatter.get_qual_width(),
shown_qual(tprobe));
584 p += sprintf(p,
"%*i ", formatter.get_grps_width(), tprobe->groupsize);
585 p += sprintf(p,
"%5.1f", ((
double)
pt_get_gc_content(tprobe->sequence))/tprobe->seq_len*100.0);
593 p += sprintf(p,
"%*s |", formatter.get_max_designed_len(), probe);
598 p += formatter.sprint_centigrade_list(p, tprobe->perc);
613 char *ecolipos =
NULp;
614 if (pdc->min_ecolipos == -1) {
615 if (pdc->max_ecolipos == -1) {
623 if (pdc->max_ecolipos == -1) {
631 char *mishit_annotation =
NULp;
632 if (pdc->min_rj_mishits<INT_MAX) {
636 char *coverage_annotation =
NULp;
637 if (pdc->max_rj_coverage>0.0) {
638 coverage_annotation =
GBS_global_string_copy(
" (max. rejected coverage: %.0f%%)", pdc->max_rj_coverage*100.0);
650 "Probe design parameters:\n"
651 "Length of probe %s\n"
652 "Temperature [%4.1f -%5.1f]\n"
653 "GC-content [%4.1f -%5.1f]\n"
654 "E.Coli position [%s]\n"
655 "Max. nongroup hits %i%s\n"
656 "Min. group hits %.0f%%%s\n",
658 pdc->mintemp, pdc->maxtemp,
659 pdc->min_gc*100.0, pdc->max_gc*100.0,
661 pdc->max_mishits, null2empty(mishit_annotation),
662 pdc->min_coverage*100.0, null2empty(coverage_annotation));
665 free(coverage_annotation);
666 free(mishit_annotation);
674 s += sprintf(s,
"%-*s", maxprobelen+1,
"Target");
675 s += sprintf(s,
"le ");
680 s += sprintf(s,
" G+C temp ");
681 s += sprintf(s,
"%*s | ", maxprobelen, maxprobelen<14 ?
"Probe" :
"Probe sequence");
682 s += sprintf(s,
"Decrease T by n*.3C -> probe matches n non group species");
685 s += sprintf(s,
"No probes found!");
713 for (
int i = 0; probe[i] && readableLoc[height+i]; ++i) {
714 if (probe[i] != readableLoc[height+i])
return 0;
753 if (i != *probe)
continue;
768 for (
int i = 0; probe[i] && loc[height+i]; ++i) {
769 if (probe[i] != loc[height+i]) {
786 int min_rej_mishit_amount = INT_MAX;
788 for (PT_tprobes *tprobe = pdc->tprobes; tprobe; ) {
789 PT_tprobes *tprobe_next = tprobe->next;
794 if (tprobe->mishits > pdc->max_mishits) {
795 min_rej_mishit_amount =
std::min(min_rej_mishit_amount, tprobe->mishits);
796 destroy_PT_tprobes(tprobe);
798 tprobe = tprobe_next;
802 pdc->min_rj_mishits =
std::min(pdc->min_rj_mishits, min_rej_mishit_amount);
809 for (PT_tprobes *tprobe = pdc->tprobes; tprobe; ) {
810 PT_tprobes *tprobe_next = tprobe->next;
812 if (relpos < pdc->min_ecolipos || (relpos > pdc->max_ecolipos && pdc->max_ecolipos != -1)) {
813 destroy_PT_tprobes(tprobe);
815 tprobe = tprobe_next;
826 PT_pdc *pdc = locs->pdc;
831 for (PT_tprobes *tprobe = pdc->tprobes; tprobe; ) {
832 PT_tprobes *tprobe_next = tprobe->next;
833 tprobe->seq_len = strlen(tprobe->sequence);
835 for (
int i=0; i<tprobe->seq_len; i++) {
838 tprobe->sum_bonds = sbond;
841 tprobe = tprobe_next;
847 typedef std::map<int, int> Pos4Name;
853 static bool is_valid_pos(
int pos) {
return pos >= 0 && pos<PERC_SIZE; }
857 Pos4Name::iterator found = cpos.find(name);
858 if (found == cpos.end()) {
861 else if (pos<found->second) {
867 for (
int i = 0; i<PERC_SIZE; ++i) centigrade_hits[i] = 0;
868 for (Pos4Name::const_iterator p = cpos.begin(); p != cpos.end(); ++p) {
871 centigrade_hits[pos]++;
875 bool empty()
const {
return cpos.empty(); }
879 const PT_pdc *
const pdc;
883 PT_tprobes *currTprobe;
886 bool only_bind_behind_dot;
888 void uncond_announce_match(
int centPos,
const AbsLoc& loc) {
890 #if defined(DUMP_OLIGO_MATCHING)
891 fprintf(stderr,
"announce_match centPos=%2i loc", centPos);
899 bool location_follows_dot(
const DataLoc& loc)
const {
return location_follows_dot(
ReadableDataLoc(loc)); }
902 template<
typename LOC>
903 bool acceptable_location(
const LOC& loc)
const {
904 return loc.get_pid().outside_group() &&
905 (only_bind_behind_dot ? location_follows_dot(loc) :
true);
908 template<
typename LOC>
909 void announce_match_if_acceptable(
int centPos,
const LOC& loc) {
910 if (acceptable_location(loc)) {
911 uncond_announce_match(centPos, loc);
914 void announce_match_if_acceptable(
int centPos,
POS_TREE2 *pt) {
920 announce_match_if_acceptable(centPos, ptson);
926 announce_match_if_acceptable(centPos,
DataLoc(pt));
932 announce_match_if_acceptable(centPos, iter.
at());
940 template <
typename PT_OR_LOC>
941 void announce_possible_match(
const MatchingOligo& oligo, PT_OR_LOC pt_or_loc) {
946 if (centPos<PERC_SIZE) {
947 announce_match_if_acceptable(centPos, pt_or_loc);
951 bool might_reach_centigrade_pos(
const MatchingOligo& oligo)
const {
960 pt_assert(might_reach_centigrade_pos(oligo));
967 if (might_reach_centigrade_pos(more)) {
968 bind_rest(more, loc, height+1);
972 announce_possible_match(more, loc);
977 announce_possible_match(all, loc);
980 void bind_rest_if_outside_group(
const MatchingOligo& oligo,
const DataLoc& loc,
const int height) {
985 void bind_rest_if_outside_group(
const MatchingOligo& oligo,
const AbsLoc& loc,
const int height) {
996 if (might_reach_centigrade_pos(oligo)) {
1002 announce_possible_match(all, ptdotson);
1008 bind_rest(oligo.
bind_against(i, splits), ptson, height+1);
1014 bind_rest_if_outside_group(oligo,
DataLoc(pt), height);
1020 bind_rest_if_outside_group(oligo, iter.
at(), height);
1028 announce_possible_match(oligo, pt);
1035 pt_assert(might_reach_centigrade_pos(oligo));
1041 if (might_reach_centigrade_pos(more)) {
1042 if (more.
domainSeen()) bind_rest (more, loc, height+1);
1043 else if (more.
domainPossible()) bind_till_domain(more, loc, height+1);
1047 announce_possible_match(more, loc);
1051 void bind_till_domain_if_outside_group(
const MatchingOligo& oligo,
const DataLoc& loc,
const int height) {
1056 void bind_till_domain_if_outside_group(
const MatchingOligo& oligo,
const AbsLoc& loc,
const int height) {
1066 if (might_reach_centigrade_pos(oligo)) {
1074 if (sonOligo.
domainSeen()) bind_rest (sonOligo, ptson, height+1);
1075 else if (sonOligo.
domainPossible()) bind_till_domain(sonOligo, ptson, height+1);
1081 bind_till_domain_if_outside_group(oligo,
DataLoc(pt), height);
1087 bind_till_domain_if_outside_group(oligo, iter.
at(), height);
1102 only_bind_behind_dot(
false)
1117 only_bind_behind_dot =
false;
1118 bind_till_domain(fullProbe, ptroot, 0);
1123 only_bind_behind_dot =
true;
1124 for (
int off = 1; off<tprobe.seq_len; ++off) {
1125 MatchingOligo probeSuffix(fullProbe.get_oligo().suffix(off));
1126 if (!probeSuffix.domainPossible())
break;
1127 bind_till_domain(probeSuffix, ptroot, 0);
1150 const char *his = other.
sequence();
1153 for (
size_t i = 0; i<len && !
cmp; ++i) {
1154 cmp = mine[i]-his[i];
1167 bool has_only_std_bases()
const {
return (gc+at) == probelen; }
1169 bool at_end()
const {
return !rest; }
1191 void init_counts() {
1193 for (
size_t i = 0; i<probelen; ++i) {
1201 probelen(probelen_),
1202 rest(seqlen-probelen)
1209 if (at_end())
return false;
1213 count(base_at(probelen-1));
1220 return pdc->min_gc*probelen <= gc && gc <= pdc->max_gc*probelen;
1224 return pdc->mintemp <= temp && temp <= pdc->maxtemp;
1228 return has_only_std_bases() &&
1237 fprintf(out,
"probe='%s' probelen=%zu at=%zu gc=%zu\n", probe, probelen, at, gc);
1245 PO_Less(
size_t probelen_) : probelen(probelen_) {}
1250 bool operator()(
const SmartCharPtr& p1,
const SmartCharPtr& p2) {
return &*p1 < &*p2; }
1254 typedef std::set<ProbeOccurrence, PO_Less> Candidates;
1255 typedef std::map<ProbeOccurrence, int, PO_Less> CandidateHits;
1256 typedef std::set<SmartCharPtr, SCP_Less> SeqData;
1259 CandidateHits candidateHits;
1264 : probelen(probelen_),
1265 candidateHits(probelen)
1270 if (bp >= probelen) {
1272 Candidates candidates(probelen);
1281 }
while (probe.
next());
1285 for (Candidates::iterator c = candidates.begin(); c != candidates.end(); ++c) {
1286 candidateHits[*c]++;
1290 base_progress.
done();
1295 int min_ingroup_hits = (ingroup_size * pdc->min_coverage + .5);
1296 int max_rej_ingroup_hits = 0;
1298 for (CandidateHits::iterator c = candidateHits.begin(); c != candidateHits.end(); ++c) {
1299 int ingroup_hits = c->second;
1300 if (ingroup_hits >= min_ingroup_hits) {
1303 PT_tprobes *tprobe = create_PT_tprobes();
1307 tprobe->groupsize = ingroup_hits;
1312 max_rej_ingroup_hits =
std::max(max_rej_ingroup_hits, ingroup_hits);
1316 double max_rejected_coverage = max_rej_ingroup_hits/double(ingroup_size);
1317 pdc->max_rj_coverage =
std::max(pdc->max_rj_coverage, max_rejected_coverage);
1330 int min_probe_length;
1336 void announce_seq_bp(
long bp) {
1338 if (bp<
long(min_probe_length)) {
1339 error =
GBS_global_string(
"Sequence contains only %lu bp. Impossible design request for", bp);
1343 if (datasize<bp) datasize = ULONG_MAX;
1347 void scan_added_targets() {
1349 for (PT_sequence *
seq = pdc->sequences;
seq && !error;
seq =
seq->next) {
1350 announce_seq_bp(
seq->seq.size);
1355 void scan_known_targets(
int expected_known_targets) {
1356 known2id =
new int[expected_known_targets];
1363 known2id[known_targets++] =
id;
1364 pt_assert(known_targets <= expected_known_targets);
1376 min_probe_length(pdc->min_probelen),
1379 scan_added_targets();
1381 scan_known_targets(expected_known_targets);
1382 targets = known_targets+added_targets;
1397 for (
int k = 0; k<known_targets; ++k) {
1402 for (PT_sequence *
seq = pdc->sequences;
seq;
seq =
seq->next) {
1409 #if defined(DUMP_DESIGNED_PROBES)
1410 static void dump_tprobe(PT_tprobes *tprobe,
int idx) {
1412 fprintf(stderr,
"tprobe='%s' idx=%i len=%i\n", readable, idx, tprobe->seq_len);
1415 static void DUMP_TPROBES(
const char *where, PT_pdc *pdc) {
1417 fprintf(stderr,
"dumping tprobes %s:\n", where);
1418 for (PT_tprobes *tprobe = pdc->tprobes; tprobe; tprobe = tprobe->next) {
1419 dump_tprobe(tprobe, idx++);
1423 #define DUMP_TPROBES(a,b)
1427 PT_local *
locs = (PT_local*)pdc->mh.parent->parent;
1430 while (pdc->tprobes) destroy_PT_tprobes(pdc->tprobes);
1432 for (PT_sequence *
seq = pdc->sequences;
seq;
seq =
seq->next) {
1437 int unknown_species_count = 0;
1439 char *unknown_names =
ptpd_read_names(locs, pdc->names.data, pdc->checksums.data, error);
1440 if (unknown_names) {
1444 unknown_species_count = names.
size();
1453 locs->group_count = targets.
get_count();
1454 if (locs->group_count <= 0) {
1460 error =
GBS_global_string(
"Cannot design probes for %i unknown marked genes", unknown_species_count);
1464 error =
GBS_global_string(
"Got %i unknown marked species, but %i custom sequence%s added (has to match)",
1465 unknown_species_count,
1467 added == 1 ?
" was" :
"s were");
1479 int min_probelen = pdc->min_probelen;
1482 arb_progress progress(
"Searching probe candidates",
long(max_probelen-min_probelen+1));
1483 for (
int len = min_probelen; len <= max_probelen; ++len) {
1494 while (pdc->sequences) destroy_PT_sequence(pdc->sequences);
1506 for (PT_tprobes *tprobe = pdc->tprobes; tprobe; tprobe = tprobe->next) {
1512 fputs(
"No probe candidates found\n", stdout);
1539 while (!prefix.
done()) {
1540 if (out.filled()) out.put(
',');
1549 return out.get_data();
1552 void TEST_PrefixIterator() {
1564 TEST_EXPECT_EQUAL(concat_iteration(p2),
"AA,AC,AG,AU,CA,CC,CG,CU,GA,GC,GG,GU,UA,UC,UG,UU");
1577 "N.,NN,NA,NC,NG,NU,"
1578 "A.,AN,AA,AC,AG,AU,"
1579 "C.,CN,CA,CC,CG,CU,"
1580 "G.,GN,GA,GC,GG,GU,"
1581 "U.,UN,UA,UC,UG,UU");
1585 "NN.,NNN,NNA,NNC,NNG,NNU,"
1586 "NA.,NAN,NAA,NAC,NAG,NAU,"
1587 "NC.,NCN,NCA,NCC,NCG,NCU,"
1588 "NG.,NGN,NGA,NGC,NGG,NGU,"
1589 "NU.,NUN,NUA,NUC,NUG,NUU,"
1591 "AN.,ANN,ANA,ANC,ANG,ANU,"
1592 "AA.,AAN,AAA,AAC,AAG,AAU,"
1593 "AC.,ACN,ACA,ACC,ACG,ACU,"
1594 "AG.,AGN,AGA,AGC,AGG,AGU,"
1595 "AU.,AUN,AUA,AUC,AUG,AUU,"
1597 "CN.,CNN,CNA,CNC,CNG,CNU,"
1598 "CA.,CAN,CAA,CAC,CAG,CAU,"
1599 "CC.,CCN,CCA,CCC,CCG,CCU,"
1600 "CG.,CGN,CGA,CGC,CGG,CGU,"
1601 "CU.,CUN,CUA,CUC,CUG,CUU,"
1603 "GN.,GNN,GNA,GNC,GNG,GNU,"
1604 "GA.,GAN,GAA,GAC,GAG,GAU,"
1605 "GC.,GCN,GCA,GCC,GCG,GCU,"
1606 "GG.,GGN,GGA,GGC,GGG,GGU,"
1607 "GU.,GUN,GUA,GUC,GUG,GUU,"
1609 "UN.,UNN,UNA,UNC,UNG,UNU,"
1610 "UA.,UAN,UAA,UAC,UAG,UAU,"
1611 "UC.,UCN,UCA,UCC,UCG,UCU,"
1612 "UG.,UGN,UGA,UGC,UGG,UGU,"
1613 "UU.,UUN,UUA,UUC,UUG,UUU");
1616 #endif // UNIT_TESTS
struct probe_input_data * data
const char * aisc_unlink(dllheader_ext *object)
long get_datasize() const
void calculate_outgroup_matches(PT_tprobes &tprobe)
bool less(const ProbeOccurrence &other, size_t len) const
static PD_Formatter4design format4design
void complement_probe(char *Probe, int len)
static int count_mishits_for_matched(char *probe, POS_TREE2 *pt, int height)
bool domainPossible() const
DesignTargets(PT_pdc *pdc_, int expected_known_targets)
void dump(FILE *out) const
std::map< const PT_pdc *const, PD_formatter > PD_Formatter4design
void pt_export_error_if(PT_local *locs, ARB_ERROR &error)
void generate(ProbeCandidates &candidates)
void GB_sort(void **array, size_t first, size_t behind_last, gb_compare_function compare, void *client_data)
bool centigrade_pos_out_of_reach(const PT_tprobes *tprobe, const PT_pdc *const pdc, const Splits &splits) const
int PT_forwhole_chain(PT *node, T &func)
static void clip_tprobes(PT_pdc *pdc, int count)
bool operator()(const SmartCharPtr &p1, const SmartCharPtr &p2)
PO_Less(size_t probelen_)
const probe_input_data & get_pid() const
char * ARB_strdup(const char *str)
const ProbeOccurrence & occurrence() const
MatchingOligo dont_bind_rest() const
const char * GBS_global_string(const char *templat,...)
static bool is_valid_pos(int pos)
ptnd_chain_count_mishits()
Oligo suffix(int skip) const
bool feasible(PT_pdc *pdc) const
int operator()(const AbsLoc &probeLoc)
int PT_start_design(PT_pdc *pdc, int)
char buffer[MESSAGE_BUFFERSIZE]
void summarize_centigrade_hits(int *centigrade_hits) const
int calc_centigrade_pos(const PT_tprobes *tprobe, const PT_pdc *const pdc) const
double get_max_bond(int base) const
int get_added_count() const
static void remove_tprobes_outside_ecoli_range(PT_pdc *pdc)
const probe_input_data & get_pid() const
Oligo(const char *data_, int length_)
ProbeIterator(const char *seq, size_t seqlen, size_t probelen_)
MatchingOligo(const Oligo &oligo_)
static size_t tprobes_calculate_bonds(PT_local *locs)
static int count_mishits_for_all(POS_TREE2 *pt)
void aisc_link(dll_public *dll, PT_tprobes *tprobe)
size_t probe_compress_sequence(char *seq, size_t seqsize)
bool more(const copy< T > &t1, const copy< T > &t2)
CONSTEXPR_INLINE int digits(int parts)
static void tprobes_sumup_perc_and_calc_quality(PT_pdc *pdc)
GB_BUFFER GB_give_buffer(size_t size)
char * readable_probe(const char *compressed_probe, size_t len, char T_or_U)
static void remove_tprobes_with_too_many_mishits(PT_pdc *pdc)
static void error(const char *msg)
char * get_design_hinfo(const PT_pdc *pdc)
long PT_abs_2_ecoli_rel(long pos)
int get_most_used() const
ProbeOccurrence(const char *seq_)
int get_known_count() const
const Oligo & get_oligo() const
ASSERTING_CONSTEXPR_INLINE int info2bio(int infopos)
static void sort_tprobes_by(PT_pdc *pdc, ProbeSortMode mode)
const AbsLoc & at() const
CONSTEXPR_INLINE bool is_std_base_or_N(char b)
int get_max_probelen(const PT_pdc *pdc)
int shown_apos(const PT_tprobes *tprobe)
bool gc_in_wanted_range(PT_pdc *pdc) const
void generate_for_sequence(PT_pdc *pdc, const SmartCharPtr &seq, size_t bp)
OutgroupMatcher(PT_local *locs_, PT_pdc *pdc_)
PT * PT_read_son(PT *node, PT_base base)
static char hitgroup_idx2char(int idx)
ptnd_chain_count_mishits(const char *probe_, int height_)
char at(int offset) const
fputs(TRACE_PREFIX, stderr)
int shown_qual(const PT_tprobes *tprobe)
int get_temperature() const
dt_bondssum(double dt_, double sum_bonds_)
str readable(const copy< T > &v)
char * ARB_strndup(const char *start, int len)
void set_pos_for(int name, int pos)
#define MIN_DESIGN_PROBE_LENGTH
GB_BUFFER GB_give_buffer2(long size)
ProbeCandidates(size_t probelen_)
void erase_formatter(const PT_pdc *pdc)
POS_TREE2 *& TREE_ROOT2()
char * probe_2_readable(char *id_string, int len)
void create_tprobes(PT_pdc *pdc, int ingroup_size)
#define DUMP_TPROBES(a, b)
double check(char base, char ref) const
static int ptnd_compare_sequence(const void *vtp1, const void *vtp2, void *)
char * ptpd_read_names(PT_local *locs, const char *names_list, const char *checksums, ARB_ERROR &error)
char dangling_char() const
static int ptnd_compare_quality(const void *vtp1, const void *vtp2, void *)
static int pt_get_gc_content(char *probe)
const char * sequence() const
int pt_init_bond_matrix(PT_local *THIS)
char * create_reversed_probe(char *probe, int len)
void GBT_splitNdestroy_string(ConstStrArray &names, char *&namelist, const char *separator, SplitMode mode)
bool temperature_in_wanted_range(PT_pdc *pdc) const
bool completely_bound() const
char * get_design_info(const PT_tprobes *tprobe)
bool operator()(const ProbeOccurrence &a, const ProbeOccurrence &b) const
#define TEST_EXPECT_EQUAL(expr, want)
static double pt_get_temperature(const char *probe)
char * GBS_global_string_copy(const char *templat,...)
MatchingOligo bind_against(char c, const Splits &splits) const
const PD_formatter & get_formatter(const PT_pdc *pdc)
int shown_ecoli(const PT_tprobes *tprobe)
GB_write_int const char s