- Timestamp:
- 26/05/10 19:01:23 (21 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
PROBE/PT_match.cxx (modified) (10 diffs)
-
PROBE_COM/PT.aisc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PROBE/PT_match.cxx
r6659 r6668 354 354 if (list_len <= 1) return; 355 355 my_list = (PT_probematch **)calloc(sizeof(void *), list_len); 356 for (i=0, match = locs->pm; 357 match; 358 i++, match=match->next) 359 { 356 for (i=0, match = locs->pm; match; i++, match=match->next) { 360 357 my_list[i] = match; 361 358 } … … 364 361 aisc_unlink((struct_dllheader_ext*)my_list[i]); 365 362 aisc_link(&locs->ppm, my_list[i]); 363 // printf("%i\t%i\t%s\n",my_list[i]->name,my_list[i]->b_pos,virt_name(my_list[i])); 366 364 } 367 365 free(my_list); … … 434 432 locs->matches_truncated = 0; 435 433 436 #if defined(DEBUG) 434 #if defined(DEBUG) && 0 437 435 PT_pdc *pdc = locs->pdc; 438 printf("Current bond values:\n"); 439 for (int y = 0; y<4; y++) { 440 for (int x = 0; x<4; x++) { 441 printf("%5.2f", pdc->bond[y*4+x].val); 442 } 443 printf("\n"); 436 if (pdc) { 437 printf("Current bond values:\n"); 438 for (int y = 0; y<4; y++) { 439 for (int x = 0; x<4; x++) { 440 printf("%5.2f", pdc->bond[y*4+x].val); 441 } 442 printf("\n"); 443 } 444 444 } 445 445 #endif // DEBUG … … 587 587 inline void cat_dashed_right(GBS_strstruct *memfile, const char *text, int width) { cat_internal(memfile, strlen(text), text, width, '-', false); } 588 588 589 static const char *get_match_info_formatted(PT_probematch *ml, const format_props& format)589 extern "C" char *get_match_overlay(PT_probematch *ml) 590 590 { 591 int pr_pos, al_pos;592 591 int pr_len = strlen(ml->sequence); 593 double wmis = 0.0;594 double h;595 int a, b;596 592 597 593 PT_local *locs = (PT_local *)ml->mh.parent->parent; … … 600 596 char *ref = (char *)calloc(sizeof(char), 21+pr_len); 601 597 memset(ref, '.', 10); 602 for ( pr_pos = 8, al_pos = ml->rpos-1;598 for (int pr_pos = 8, al_pos = ml->rpos-1; 603 599 pr_pos >= 0 && al_pos >= 0; 604 600 pr_pos--, al_pos--) … … 611 607 pt_build_pos_to_weight((PT_MATCH_TYPE)locs->sort_by, ml->sequence); 612 608 613 for ( pr_pos = 0, al_pos = ml->rpos;609 for (int pr_pos = 0, al_pos = ml->rpos; 614 610 pr_pos < pr_len && al_pos < psg.data[ml->name].size; 615 611 pr_pos++, al_pos++) 616 612 { 617 if ((a=ml->sequence[pr_pos]) == (b=psg.data[ml->name].data[al_pos])) { 613 int a = ml->sequence[pr_pos]; 614 int b = psg.data[ml->name].data[al_pos]; 615 if (a == b) { 618 616 ref[pr_pos+10] = '='; 619 617 } … … 621 619 ref[pr_pos+10] = b; 622 620 if (pdc && a >= PT_A && a <= PT_T && b >= PT_A && b<=PT_T) { 623 h = ptnd_check_split(pdc, ml->sequence, pr_pos, b); 624 if (h<0.0) { 625 h = -h; 626 } 627 else { 621 double h = ptnd_check_split(pdc, ml->sequence, pr_pos, b); 622 if (h>=0.0) { 628 623 ref[pr_pos+10] = " nacgu"[b]; 629 624 } 630 wmis += psg.pos_to_weight[pr_pos] * h; 631 } 632 } 633 634 } 635 636 for (pr_pos = 0, al_pos = ml->rpos+pr_len; 625 } 626 } 627 628 } 629 630 for (int pr_pos = 0, al_pos = ml->rpos+pr_len; 637 631 pr_pos < 9 && al_pos < psg.data[ml->name].size; 638 632 pr_pos++, al_pos++) … … 643 637 PT_base_2_string(ref, 0); 644 638 639 return ref; 640 } 641 642 static const char *get_match_info_formatted(PT_probematch *ml, const format_props& format) { 645 643 GBS_strstruct *memfile = GBS_stropen(256); 646 644 GBS_strcat(memfile, " "); … … 653 651 cat_spaced_right(memfile, GBS_global_string("%i", ml->N_mismatches), format.N_mis_width()); 654 652 } 655 cat_spaced_right(memfile, GBS_global_string("%.1f", wmis), format.wmis_width());653 cat_spaced_right(memfile, GBS_global_string("%.1f", ml->wmismatches), format.wmis_width()); 656 654 cat_spaced_right(memfile, GBS_global_string("%i", ml->b_pos), format.pos_width); 657 655 if (format.show_gpos) { … … 663 661 cat_spaced_left(memfile, GBS_global_string("%i", ml->reversed), format.rev_width()); 664 662 663 char *ref = get_match_overlay(ml); 665 664 GBS_strcat(memfile, ref); 666 667 665 free(ref); 668 666 -
trunk/PROBE_COM/PT.aisc
r6375 r6668 172 172 double, wmismatches, t, r, , WMISMATCHES, 16, , (~number of weighted mismatches~); 173 173 int, N_mismatches, t, r, , N_MISMATCHES, 17, , (~number of 'N' mismatches~); 174 int, is_member, t, r, , IS_MEMBER, 18, , (~member of group~);174 # int, is_member, t, r, , IS_MEMBER, 18, , (~member of group~); 175 175 double, dt, t, r, , DT, 19, , (~the dt of a probe~); 176 176 char, sequence, l, r, , SEQUENCE, 22, , (~path of probe~); … … 178 178 # aisc_string,get_match_hinfo,%, r, , INFO_HEADER, 26, , (~the combined info text of _one_ probe match (header)~); 179 179 # aisc_string,get_match_info, %, r, , INFO, 27, , (~the combined info text of _one_ probe match~); 180 aisc_string,get_match_overlay,%, r, , OVERLAY, 28, , (~ascii visualization of match~); 180 181 }; 181 182
