Changeset 8301
- Timestamp:
- 13/12/11 13:30:13 (6 months ago)
- Location:
- branches/stable_5.0
- Files:
-
- 4 modified
-
AWT/AWT_translate.cxx (modified) (1 diff)
-
AWT/awt_codon_table.hxx (modified) (1 diff)
-
AWT/awt_translate.hxx (modified) (1 diff)
-
NTREE/ad_transpro.cxx (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/stable_5.0/AWT/AWT_translate.cxx
r7019 r8301 28 28 GB_ERROR error = GBT_write_string(gb_species, "transl_table", GBS_global_string("%i", embl_transl_table)); 29 29 if (!error) error = GBT_write_string(gb_species, "codon_start", GBS_global_string("%i", codon_start+1)); 30 31 return error; 32 } 33 34 GB_ERROR AWT_removeTranslationInfo(GBDATA *gb_species) { 35 GB_ERROR error = NULL; 36 37 GBDATA *gb_transl_table = GB_entry(gb_species, "transl_table"); 38 if (gb_transl_table) error = GB_delete(gb_transl_table); 39 40 if (!error) { 41 GBDATA *gb_codon_start = GB_entry(gb_species, "codon_start"); 42 if (gb_codon_start) error = GB_delete(gb_codon_start); 43 } 30 44 31 45 return error; -
branches/stable_5.0/AWT/awt_codon_table.hxx
r5968 r8301 71 71 } 72 72 } 73 74 int explicit_table() const { 75 // return explicit table number (or -1 if not exactly 1 table is allowed) 76 int table = -1; 77 for (int i = 0; i<AWT_CODON_TABLES; ++i) { 78 if (allowed[i]) { 79 if (table != -1) return -1; 80 table = i; 81 } 82 } 83 return table; 84 } 73 85 }; 74 86 -
branches/stable_5.0/AWT/awt_translate.hxx
r5817 r8301 14 14 GB_ERROR AWT_getTranslationInfo(GBDATA *gb_species, int& arb_transl_table, int &codon_start); 15 15 GB_ERROR AWT_saveTranslationInfo(GBDATA *gb_species, int arb_transl_table, int codon_start); 16 GB_ERROR AWT_removeTranslationInfo(GBDATA *gb_species); 16 17 17 18 int AWT_pro_a_nucs_convert(int arb_code_nr, char *data, size_t size, size_t pos, bool translate_all, bool create_start_codon, bool append_stop_codon, int *translatedSize); -
branches/stable_5.0/NTREE/ad_transpro.cxx
r6143 r8301 341 341 // before deciding "X was realigned correctly" 342 342 343 GB_ERROR arb_transdna(GBDATA *gb_main, char *ali_source, char *ali_dest, long *neededLength) 344 { 343 static GB_ERROR arb_transdna(GBDATA *gb_main, char *ali_source, char *ali_dest, long *neededLength) { 345 344 AWT_initialize_codon_tables(); 346 345 … … 353 352 354 353 aw_openstatus("Re-aligner"); 355 354 356 355 int no_of_marked_species = GBT_count_marked_species(gb_main); 357 356 int no_of_realigned_species = 0; … … 642 641 643 642 // re-alignment successful 644 error = GB_write_string(gb_dest_data, buffer); 645 if (!error) error = GBT_write_string(gb_species, "codon_start", "1"); // after re-alignment codon_start is always 1 643 error = GB_write_string(gb_dest_data, buffer); 644 645 if (!error) { 646 int explicit_table_known = allowed_code.explicit_table(); 647 648 if (explicit_table_known >= 0) { // we know the exact code -> write codon_start and transl_table 649 const int codon_start = 1; // by definition (after realignment) 650 error = AWT_saveTranslationInfo(gb_species, explicit_table_known, codon_start); 651 } 652 else { // we dont know the exact code -> delete codon_start and transl_table 653 error = AWT_removeTranslationInfo(gb_species); 654 } 655 } 646 656 } 647 657 … … 656 666 aw_closestatus(); 657 667 658 if (max_wanted_ali_len>0) {659 if (neededLength) *neededLength = max_wanted_ali_len; 660 }661 662 if (error) {663 return error;664 }665 666 error = GBT_check_data(gb_main,ali_dest); 667 668 *neededLength = max_wanted_ali_len; 669 670 if (!error) { 671 int not_realigned = no_of_marked_species - no_of_realigned_species; 672 if (not_realigned>0) { 673 aw_message(GBS_global_string("Did not try to realign %i species (source/dest alignment missing?)", not_realigned)); 674 } 675 } 676 677 if (!error) error = GBT_check_data(gb_main,ali_dest); 668 678 return error; 669 679 } … … 685 695 error = GB_end_transaction(GLOBAL_gb_main, error); 686 696 687 if ( neededLength) {697 if (!error && neededLength>0) { 688 698 if (retrying || !aw_ask_sure(GBS_global_string("Increase length of '%s' to %li?", ali_dest, neededLength))) { 689 699 error = GBS_global_string("Missing %li columns in alignment '%s'", neededLength, ali_dest); … … 698 708 "running re-aligner again!", 699 709 ali_dest, neededLength)); 700 retrying = true; 710 retrying = true; 711 neededLength = -1; 701 712 } 702 713 }
