diff -Nru seaview-4.6.1.2/csrc/misc_acnuc.c seaview-4.6.4/csrc/misc_acnuc.c --- seaview-4.6.1.2/csrc/misc_acnuc.c 2016-04-24 15:13:29.000000000 +0000 +++ seaview-4.6.4/csrc/misc_acnuc.c 2017-01-03 09:39:41.000000000 +0000 @@ -27,6 +27,7 @@ char complementer_base(char nucl); void complementer_seq(char *deb_ch, int l); char init_codon_to_aa(char *codon, int gc); +char stop_codon_to_aa(char *codon, int gc); int notrail2(char *chaine, int len); int prepch(char *chaine, char **posmot); int compch(char *cible, int lcible, char **posmot, int nbrmots); @@ -53,31 +54,36 @@ } -#define TOTCODES 20 /* nbre total de codes definis, 0 inclus */ +#define TOTCODES 25 /* nbre total de codes definis, 0 inclus */ int totcodes=TOTCODES; char aminoacids[]="RLSTPAGVKNQHEDYCFIMW*X"; struct genetic_code_libel { /* definition d'un code genetique */ char libel[61]; /* nom du code decrivant ses variants % code standard */ + char* target; int code[65]; /* tableau codon->acide amine */ int ncbi_gc; /* numero NCBI du meme code */ - int codon_init[64]; /* tableau codon initiateur -> acide amine */ + int codon_init[64]; /* tableau codon initiateur ou stop -> acide amine */ }; /* les codons sont numerotes de 1 a 64 selon ordre alphabetique; le numero 65 est attribue a tout codon avec base hors AcCcGgTtUu les acides amines sont numerotes selon l'ordre de la variable aminoacids -de un a 20 + * pour stop et X pour inconnu +de un a 20 + * pour stop et X pour inconnu. + Table codon_init gives 19 (=M) for initiation codons and 21 (=*) for stop codons. + In some genetic codes, the same codon corresponds to an aa in table code + and to a stop in table codon_init. */ /* initialisation de tous les codes genetiques */ struct genetic_code_libel genetic_code[TOTCODES] = { -{ /* 0: universel */ - {"Universal genetic code"}, +{ /* 0: standard */ + {"Standard genetic code"}, + "Standard", /*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, /*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, /*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -86,11 +92,12 @@ /*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* CUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0} /* UUG */ + 21,0,21,0,0,0,0,0,21,0,0,0,0,0,19,0} /* UUG */ } , { /* 1: yeast mt */ {"CUN=T AUA=M UGA=W"}, + "Yeast Mitochondrial", {9,10,9,10,4,4,4,4,1,3,1,3,19,18,19,18, 11,12,11,12,5,5,5,5,1,1,1,1,4,4,4,4, 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -99,23 +106,25 @@ {0,0,0,0,0,0,0,0,0,0,0,0,19,0,19,0, /* AUA, AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0} } , { /* 2: : MITOCHONDRIAL CODE OF VERTEBRATES */ {"AGR=* AUA=M UGA=W"}, + "Vertebrate Mitochondrial", {9,10,9,10,4,4,4,4,21,3,21,3,19,18,19,18,11,12,11,12, 5,5,5,5,1,1,1,1,2,2,2,2,13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8,21,15, 21,15,3,3,3,3,20,16,20,16,2,17,2,17,22}, 2, - {0,0,0,0,0,0,0,0,0,0,0,0,19,19,19,19, /* AUN */ + {0,0,0,0,0,0,0,0,21,0,21,0,19,19,19,19, /* AUN */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0} } , { /* 3: MITOCHONDRIAL CODE OF FILAMENTOUS FUNGI */ {"UGA=W"}, + "Mold Mitochondrial; Protozoan Mitochondrial; Coelenterate Mitochondrial; Mycoplasma; Spiroplasma", {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18,11,12,11,12,5,5,5, 5,1,1,1,1,2,2,2,2,13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8,21,15,21, 15,3,3,3,3,20,16,20,16,2,17,2,17,22}, @@ -123,11 +132,12 @@ {0,0,0,0,0,0,0,0,0,0,0,0,19,19,19,19, /* AUN */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* CUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,19,0,19,0} /* UUR */ + 21,0,21,0,0,0,0,0,0,0,0,0,19,0,19,0} /* UUR */ } , { /* 4: MITOCHONDRIAL CODE OF INSECT AND PLATYHELMINTHES */ {"AUA=M UGA=W AGR=S"}, + "Invertebrate Mitochondrial", {9,10,9,10,4,4,4,4,3,3,3,3,19,18,19,18,11,12,11,12,5,5,5, 5,1,1,1,1,2,2,2,2,13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8,21,15,21, 15,3,3,3,3,20,16,20,16,2,17,2,17,22}, @@ -135,11 +145,12 @@ {0,0,0,0,0,0,0,0,0,0,0,0,19,19,19,19, /* AUN */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0} /* UUG */ + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,19,0} /* UUG */ } , { /* 5: Nuclear code of Candida cylindracea (see nature 341:164) */ {"CUG=S"}, + "Alternative Yeast Nuclear", {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, 11,12,11,12,5,5,5,5,1,1,1,1,2,2,3,2, 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -148,11 +159,12 @@ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* CUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 21,0,21,0,0,0,0,0,21,0,0,0,0,0,0,0} } , { /* 6: NUCLEAR CODE OF CILIATA: UAR = Gln = Q */ {"UAR=Q"}, + "Ciliate Nuclear; Dasycladacean Nuclear; Hexamita Nuclear", {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18,11,12,11,12,5,5,5, 5,1,1,1,1,2,2,2,2,13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8,11,15,11, 15,3,3,3,3,21,16,20,16,2,17,2,17,22}, @@ -160,11 +172,12 @@ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0} } , { /* 7: NUCLEAR CODE OF EUPLOTES */ {"UGA=C"}, + "Euplotid Nuclear", {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18,11,12,11,12,5,5,5, 5,1,1,1,1,2,2,2,2,13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8,21,15,21, 15,3,3,3,3,16,16,20,16,2,17,2,17,22}, @@ -172,11 +185,12 @@ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0} } , { /* 8: MITOCHONDRIAL CODE OF ECHINODERMS */ {"UGA=W AGR=S AAA=N"}, + "Echinoderm Mitochondrial; Flatworm Mitochondrial", {10,10,9,10,4,4,4,4,3,3,3,3,18,18,19,18, 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -184,25 +198,27 @@ 9, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0} } , { /* 9: MITOCHONDRIAL CODE OF ASCIDIACEA */ {"UGA=W AGR=G AUA=M"}, + "Ascidian Mitochondrial", {9,10,9,10,4,4,4,4,7,3,7,3,19,18,19,18, 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, 21,15,21,15,3,3,3,3,20,16,20,16,2,17,2,17,22}, 13, - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + {0,0,0,0,0,0,0,0,0,0,0,0,19,0,19,0, /* AUA,AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,19,0} /* UUG */ } , { /* 10: MITOCHONDRIAL CODE OF PLATYHELMINTHES */ {"UGA=W AGR=S UAA=Y AAA=N"}, + "Alternative Flatworm Mitochondrial", {10,10,9,10,4,4,4,4,3,3,3,3,18,18,19,18, 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -211,11 +227,12 @@ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0} } , { /* 11: NUCLEAR CODE OF BLEPHARISMA */ {"UAG=Q"}, + "Blepharisma Macronuclear", /*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, /*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, /*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -224,11 +241,12 @@ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 21,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0} } , { /* 12: NUCLEAR CODE OF BACTERIA: differs only for initiation codons */ {"NUG=AUN=M when initiation codon"}, + "Bacterial, Archaeal and Plant Plastid", /*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, /*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, /*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -237,11 +255,12 @@ {0,0,0,0,0,0,0,0,0,0,0,0,19,19,19,19, /* AUN */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* CUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0} /* UUG */ + 21,0,21,0,0,0,0,0,21,0,0,0,0,0,19,0} /* UUG */ } , { /* 13: Chlorophycean Mitochondrial */ {"UAG=Leu"}, + "Chlorophycean Mitochondrial", /*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, /*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, /*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -250,11 +269,12 @@ /*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 21,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0} } , { /* 14: MITOCHONDRIAL CODE OF TREMATODE */ {"AUA=M UGA=W AGR=S AAA=N"}, + "Trematode Mitochondrial", {10,10,9,10,4,4,4,4,3,3,3,3,19,18,19,18,11,12,11,12,5,5,5, 5,1,1,1,1,2,2,2,2,13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8,21,15,21, 15,3,3,3,3,20,16,20,16,2,17,2,17,22}, @@ -262,11 +282,12 @@ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0} } , { /* 15: TAG-Leu,TCA-stop */ {"UAG=L UCA=*"}, + "Scenedesmus obliquus mitochondrial", /*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, /*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, /*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -275,11 +296,12 @@ /*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 21,0,0,0,21,0,0,0,21,0,0,0,0,0,0,0} } , { /* 16: Thraustochytrium-mt */ {"UUA=*"}, + "Thraustochytrium mitochondrial", /*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, /*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, /*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -288,11 +310,12 @@ /*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,19, /* AUG AUU */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + 21,0,21,0,0,0,0,0,21,0,0,0,21,0,0,0} } , { /* 17: MITOCHONDRIAL CODE OF Pterobranchia */ {"UGA=W AGA=S AGG=K"}, + "Pterobranchia Mitochondrial", /*ANN*/ {9,10,9,10,4,4,4,4,3,3,9,3,18,18,19,18, /*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, /*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -300,25 +323,27 @@ /*ncbi*/24, /*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* CUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0} /* UUG */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,19,0} /* UUG */ } , { /* 18: Candidate Division SR1 and Gracilibacteria */ {"UGA=G"}, + "Candidate Division SR1 and Gracilibacteria", /*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, /*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, /*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, /*TNN*/ 21,15,21,15,3,3,3,3,7,16,20,16,2,17,2,17,22}, /*ncbi*/25, /*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* CUG */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0} /* UUG */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* GUG */ + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,19,0} /* UUG */ } , { /* 19: Pachysolen tannophilus */ {"CUG=A"}, + "Pachysolen tannophilus Nuclear", /*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, /*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,6,2, /*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, @@ -327,9 +352,79 @@ /*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* CUG */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} /* UUG */ + 21,0,21,0,0,0,0,0,21,0,0,0,0,0,0,0} } - + , + { /* 20: Karyorelict Nuclear */ + {"UAR=Q, UGA=W, CUG=A"}, + "Karyorelict Nuclear", +/*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, +/*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,6,2, +/*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, +/*TNN*/ 11,15,11,15,3,3,3,3,20,16,20,16,2,17,2,17,22}, +/*ncbi*/27, +/*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0} + } + , + { /* 21: Condylostoma Nuclear */ + {"UAR=Q, UGA=W, CUG=A"}, + "Condylostoma Nuclear", +/*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, +/*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,6,2, +/*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, +/*TNN*/ 11,15,11,15,3,3,3,3,20,16,20,16,2,17,2,17,22}, +/*ncbi*/28, +/*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 21,0,21,0,0,0,0,0,21,0,0,0,0,0,0,0} + } + , + { /* 22: Mesodinium Nuclear */ + {"UAR=Y, CUG=A"}, + "Mesodinium Nuclear", +/*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, +/*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,6,2, +/*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, +/*TNN*/ 15,15,15,15,3,3,3,3,21,16,20,16,2,17,2,17,22}, +/*ncbi*/29, +/*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0} + } + , + { /* 23: Peritrich Nuclear */ + {"UAR=E, CUG=A"}, + "Peritrich Nuclear", +/*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, +/*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,6,2, +/*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, +/*TNN*/ 13,15,13,15,3,3,3,3,21,16,20,16,2,17,2,17,22}, +/*ncbi*/30, +/*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0} + } + , + { /* 24: Blastocrithidia Nuclear */ + {"UAR=E, UGA=W"}, + "Blastocrithidia Nuclear", +/*ANN*/ {9,10,9,10,4,4,4,4,1,3,1,3,18,18,19,18, +/*CNN*/ 11,12,11,12,5,5,5,5,1,1,1,1,2,2,2,2, +/*GNN*/ 13,14,13,14,6,6,6,6,7,7,7,7,8,8,8,8, +/*TNN*/ 13,15,13,15,3,3,3,3,20,16,20,16,2,17,2,17,22}, +/*ncbi*/31, +/*init*/{0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0, /* AUG */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 21,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0} + } + /* 1 2 1234567890123456789012 @@ -352,6 +447,19 @@ } +char *get_code_target(int code) +/* +get a description of target organisms of a variant genetic code +return value pointer to the description, not to be altered! +*/ +{ +if(code >= 0 && code < totcodes) + return genetic_code[code].target ; +else + return "Unknown genetic code. Standard code is used."; +} + + int calc_codon_number(char *codon) { static char nucleotides[] = "AaCcGgTtUu"; @@ -537,7 +645,6 @@ } - char init_codon_to_aa(char *codon, int gc) { int num, aa; @@ -550,7 +657,27 @@ pdata = &genetic_code[gc]; aa = pdata->codon_init[num]; /* if not listed in expected init codons */ -if(aa == 0) aa = pdata->code[num]; +if(aa == 0 || aa == 21) aa = pdata->code[num]; +return aminoacids[aa - 1]; +} + + +char stop_codon_to_aa(char *codon, int gc) +{ +int num, aa; +struct genetic_code_libel *pdata; + +num = calc_codon_number(codon); +if(num >= 64) return 'X'; +/* use regular code if unknown number */ +if(gc < 0 || gc >= totcodes) gc = 0; +pdata = &genetic_code[gc]; +aa = pdata->code[num]; +if (aa != 21) { + aa = pdata->codon_init[num]; + /* if not listed in expected stop codons */ + if (aa != 21) aa = pdata->code[num]; +} return aminoacids[aa - 1]; } diff -Nru seaview-4.6.1.2/debian/changelog seaview-4.6.4/debian/changelog --- seaview-4.6.1.2/debian/changelog 2017-02-01 11:54:56.000000000 +0000 +++ seaview-4.6.4/debian/changelog 2018-02-17 13:31:40.000000000 +0000 @@ -1,3 +1,11 @@ +seaview (1:4.6.4-1) unstable; urgency=medium + + * New upstream version + * Standards-Version: 4.1.3 + * debhelper 11 + + -- Andreas Tille Sat, 17 Feb 2018 14:31:40 +0100 + seaview (1:4.6.1.2-2) unstable; urgency=medium * Enable reading number of bootstraps from phyml runs diff -Nru seaview-4.6.1.2/debian/compat seaview-4.6.4/debian/compat --- seaview-4.6.1.2/debian/compat 2017-02-01 11:54:56.000000000 +0000 +++ seaview-4.6.4/debian/compat 2018-02-17 13:31:40.000000000 +0000 @@ -1 +1 @@ -10 +11 diff -Nru seaview-4.6.1.2/debian/control seaview-4.6.4/debian/control --- seaview-4.6.1.2/debian/control 2017-02-01 11:54:56.000000000 +0000 +++ seaview-4.6.4/debian/control 2018-02-17 13:31:40.000000000 +0000 @@ -4,14 +4,14 @@ Andreas Tille Section: science Priority: optional -Build-Depends: debhelper (>= 10), +Build-Depends: debhelper (>= 11~), libfltk1.3-dev, libpng-dev, libxft-dev, libxext-dev, libxinerama-dev, zlib1g-dev -Standards-Version: 3.9.8 +Standards-Version: 4.1.3 Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/seaview.git Vcs-Git: https://anonscm.debian.org/git/debian-med/seaview.git Homepage: http://doua.prabi.fr/software/seaview diff -Nru seaview-4.6.1.2/debian/patches/evaluate_phyml_bootstrap_number.patch seaview-4.6.4/debian/patches/evaluate_phyml_bootstrap_number.patch --- seaview-4.6.1.2/debian/patches/evaluate_phyml_bootstrap_number.patch 2017-02-01 11:54:56.000000000 +0000 +++ seaview-4.6.4/debian/patches/evaluate_phyml_bootstrap_number.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -Description: Enable reading number of bootstraps from phyml runs -Author: Manolo Gouy - Patch extracted from Upstream version 4.6.1.3 -Last-Update: Wed, 01 Feb 2017 08:51:09 +0100 - ---- a/trees.cxx -+++ b/trees.cxx -@@ -1201,6 +1201,24 @@ void run_phyml_callback(Fl_Widget *ob, v - display_tree = put_names_back_in_tree(display_tree, truenames); - //process bootstrap trees - char *bootstrap_trees = NULL; -+ if (replicates > 0) { -+ sprintf(input, "%s.phy_phyml_boot_stats.txt", base_fname); -+ in = fopen(input, "r"); -+ if (!in) { -+ sprintf(input, "%s.phy_phyml_boot_stats", base_fname); -+ in = fopen(input, "r"); -+ } -+ if (in) { // compute the true # of bootstrap replicates because parallelized phyML can compute a few more -+ char line[150]; -+ while ((p = fgets(line, sizeof(line), in))) { -+ while (*p == ' ') p++; -+ if (*p == '#') { -+ sscanf(p+1, "%d", &replicates); -+ } -+ } -+ fclose(in); -+ } -+ } - if (replicates > 0 && b_keep_trees->value()) { - sprintf(input, "%s.phy_phyml_boot_trees.txt", base_fname); - in = fopen(input, "r"); diff -Nru seaview-4.6.1.2/debian/patches/series seaview-4.6.4/debian/patches/series --- seaview-4.6.1.2/debian/patches/series 2017-02-01 11:54:56.000000000 +0000 +++ seaview-4.6.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -evaluate_phyml_bootstrap_number.patch diff -Nru seaview-4.6.1.2/FL/Fl_Native_File_Chooser.H seaview-4.6.4/FL/Fl_Native_File_Chooser.H --- seaview-4.6.1.2/FL/Fl_Native_File_Chooser.H 2014-09-23 14:56:18.000000000 +0000 +++ seaview-4.6.4/FL/Fl_Native_File_Chooser.H 2017-07-12 12:05:43.000000000 +0000 @@ -2,10 +2,6 @@ #define FL_NATIVE_FILE_CHOOSER_H #include -#if defined(USE_NEW_FLTK_FEATURES) && FL_PATCH_VERSION < 3 -#undef FL_PATCH_VERSION -#define FL_PATCH_VERSION 3 -#endif #define SEAVIEW_FLTK_VERSION 100*FL_MAJOR_VERSION + 10*FL_MINOR_VERSION + FL_PATCH_VERSION #if SEAVIEW_FLTK_VERSION < 133 && !(defined(__APPLE__) || defined(WIN32)) #define Fl_Native_File_Chooser mgFl_Native_File_Chooser diff -Nru seaview-4.6.1.2/macos_extras.mm seaview-4.6.4/macos_extras.mm --- seaview-4.6.1.2/macos_extras.mm 2016-09-15 16:29:31.000000000 +0000 +++ seaview-4.6.4/macos_extras.mm 2017-12-18 15:38:28.000000000 +0000 @@ -5,9 +5,6 @@ #include #include #include -#if 100*FL_MAJOR_VERSION + 10*FL_MINOR_VERSION + FL_PATCH_VERSION >= 140 -#include -#endif #include #include #include @@ -20,11 +17,13 @@ static void show_apropos(Fl_Widget *, void *unused); void MG_apple_inits(void); void set_seaview_modified(SEA_VIEW *view, int ismodified); -void windowmenuitem_callback(Fl_Widget *o, void *data); -int find_windowmenuitem(Fl_Window *w); -int add_windowmenuitem(const char *name, Fl_Window *w); -void rename_windowmenuitem(const char *name, int rank); -void delete_windowmenuitem(int rank); +#if 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 + void windowmenuitem_callback(Fl_Widget *o, void *data); + int find_windowmenuitem(Fl_Window *w); + int add_windowmenuitem(const char *name, Fl_Window *w); + void rename_windowmenuitem(const char *name, int rank); + void delete_windowmenuitem(int rank); +#endif char *mac_GetOutputFName_Plus(const char *dfault, const char *message, int, const char *directory); /* extern functions */ @@ -181,7 +180,7 @@ [key makeKeyWindow]; [preset release]; [dir release]; - if ( retval == NSOKButton ) {//read accessory view state + if ( retval == NSFileHandlingPanelOKButton ) {//read accessory view state printout_block = [blockview intValue]; printout_fontsize = [fontview intValue]; printout_black = [pdfmatrix selectedRow]; @@ -191,10 +190,11 @@ strcpy(pathname, [[[_panel URL] path] UTF8String]); } [_panel setAccessoryView:nil]; - if ( retval == NSCancelButton ) return NULL; + if ( retval == NSFileHandlingPanelCancelButton ) return NULL; return pathname; } +#if 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 void windowmenuitem_callback(Fl_Widget *o, void *data) { @@ -239,6 +239,9 @@ fl_sys_menu_bar->remove(rank); } +#endif + + static void file_receive_cb(const char *fname) { SEA_VIEW *view; @@ -293,10 +296,56 @@ about->show(); } +#if 100*FL_MAJOR_VERSION + FL_MINOR_VERSION >= 104 + +static Fl_Window *merged; + +static bool merge_windows_for_class(Fl_Window *first) +{ + bool retval = false; + Fl_Window *win = first; + NSWindow *nsw = (NSWindow*)fl_xid(first), *nsw2; + while ((win = Fl::next_window(win)) != NULL) { + int diff = strcmp(win->xclass(), first->xclass()); + if (win->parent() || diff) continue; + nsw2 = (NSWindow*)fl_xid(win); + [nsw2 addTabbedWindow:nsw ordered:NSWindowAbove]; + retval = true; + if (!merged) merged = win; + } + return retval; +} + +static void merge_windows_by_class_cb(Fl_Widget *, void *) +{ + merged = NULL; +more: + Fl_Window *win = Fl::first_window(); + NSWindow *nsw; + while (win) { + nsw = (NSWindow*)fl_xid(win); + if (!win->parent() && ![nsw tabbedWindows] && strcmp(win->xclass(), Fl_Window::default_xclass())) { + if (merge_windows_for_class(win)) goto more; + } + win = Fl::next_window(win); + } + if (merged) merged->show(); +} +#endif // FLTK ≥ 1.4 + void MG_apple_inits(void) { fl_open_callback(file_receive_cb); fl_mac_set_about(show_apropos, NULL, 0); +#if 100*FL_MAJOR_VERSION + FL_MINOR_VERSION >= 104 + Fl_Sys_Menu_Bar::create_window_menu(); + int merge = fl_sys_menu_bar->find_index("Window/Merge All Windows"); + if (merge >= 0) { + fl_sys_menu_bar->replace(merge, "Merge Windows by Class"); + Fl_Menu_Item *item = (Fl_Menu_Item*)fl_sys_menu_bar->menu() + merge; + item->callback(merge_windows_by_class_cb); + } +#endif Fl::set_font(FL_COURIER,"Courier"); Fl::set_font(FL_COURIER_BOLD, (fl_mac_os_version >= 100500 ? "Courier-Bold" : "Courier Bold") ); if (fl_mac_os_version >= 100500) { // it seems that Courier Oblique is not present on older OS @@ -463,9 +512,17 @@ } else { prepare_copy_pdf_and_pict(w, h); +#if 100*FL_MAJOR_VERSION + 10*FL_MINOR_VERSION + FL_PATCH_VERSION >= 140 + driver(Fl_Graphics_Driver::newMainGraphicsDriver()); +#else driver(new Fl_Quartz_Graphics_Driver()); +#endif oldgc = fl_gc; +#if 100*FL_MAJOR_VERSION + 10*FL_MINOR_VERSION + FL_PATCH_VERSION >= 140 + driver()->gc(gc); +#else fl_gc = gc; +#endif } } @@ -558,7 +615,7 @@ CGRect bounds = CGRectMake(0, 0, w, h ); pdfdata = CFDataCreateMutable(NULL, 0); CGDataConsumerRef myconsumer; - if (CGDataConsumerCreateWithCFData != NULL) { // true from 10.4 + if (CGDataConsumerCreateWithCFData) { // true from 10.4 myconsumer = CGDataConsumerCreateWithCFData (pdfdata); } else { diff -Nru seaview-4.6.1.2/pdf_or_ps.h seaview-4.6.4/pdf_or_ps.h --- seaview-4.6.1.2/pdf_or_ps.h 2016-09-15 16:29:50.000000000 +0000 +++ seaview-4.6.4/pdf_or_ps.h 2017-09-25 16:34:42.000000000 +0000 @@ -6,6 +6,10 @@ #include #endif +#if defined(WIN32) +#include +#endif + #if !(defined(__APPLE__) || defined(WIN32)) && 100*FL_MAJOR_VERSION + 10*FL_MINOR_VERSION + FL_PATCH_VERSION == 130 // for X11 under 1.3.0 only #include @@ -161,10 +165,8 @@ #endif #endif -#if (defined(__APPLE__) || defined(WIN32)) - +#if defined(__APPLE__) class Copy_Surface : public Fl_Surface_Device { -#ifdef __APPLE__ bool use_pict; CFMutableDataRef pdfdata; CGContextRef oldgc; @@ -178,18 +180,35 @@ void prepare_copy_pdf_and_pict(int w, int h); void complete_copy_pdf_and_pict(); void init_PDF_context(int w, int h); -#else - HDC oldflgc; -#endif public: -#ifdef __APPLE__ Copy_Surface(bool use_pict, int w, int h); + ~Copy_Surface(); +}; +#endif // __APPLE__ + +#if defined(WIN32) + +#if 100*FL_MAJOR_VERSION + 10*FL_MINOR_VERSION + FL_PATCH_VERSION >= 134 // FLTK after 1.3.4 + +#include +class Copy_Surface : public Fl_Copy_Surface { +public: + Copy_Surface(int w, int h) : Fl_Copy_Surface(w, h) {} + ~Copy_Surface() {} +}; + #else + +class Copy_Surface : public Fl_Surface_Device { + HDC oldflgc; +public: Copy_Surface(int w, int h); -#endif ~Copy_Surface(); }; -#endif + +#endif // FLTK after 1.4 + +#endif // WIN32 #endif // PDF_OR_PS_H diff -Nru seaview-4.6.1.2/seaview.cxx seaview-4.6.4/seaview.cxx --- seaview-4.6.1.2/seaview.cxx 2016-10-05 17:17:52.000000000 +0000 +++ seaview-4.6.4/seaview.cxx 2018-01-26 11:52:42.000000000 +0000 @@ -1,5 +1,5 @@ // -// Copyright 1996-2015 by Manolo Gouy. +// Copyright 1996-2018 by Manolo Gouy. // // This program, except where indicated, is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public @@ -182,10 +182,12 @@ #ifdef __APPLE__ extern char *mac_GetOutputFName_Plus(const char *dfault, const char *message, int use_only_button, const char *dirname); -extern int find_windowmenuitem(Fl_Window *w); -extern int add_windowmenuitem(const char *name, Fl_Window *w); -extern void rename_windowmenuitem(const char *name, int rank); -extern void delete_windowmenuitem(int rank); +#if 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 + extern int find_windowmenuitem(Fl_Window *w); + extern int add_windowmenuitem(const char *name, Fl_Window *w); + extern void rename_windowmenuitem(const char *name, int rank); + extern void delete_windowmenuitem(int rank); +#endif extern int set_res_value(const char *name, const char *value); extern void fl_mac_set_about( Fl_Callback *cb, void *user_data, int shortcut ); extern void MG_apple_inits(void); @@ -254,6 +256,8 @@ extern void printout_cmdline(int argc, char **argv); extern bool isarg(int argc, char *argv[], const char *arg); extern char *argname(int argc, char *argv[], const char *arg); + + int main(int argc, char *argv[]) { #if defined(WIN32) @@ -479,7 +483,18 @@ } clipboardfname = strdup( create_tmp_filename() ); atexit(to_do_at_exit); +#ifdef __APPLE__ + SEA_VIEW *view = NULL; + Fl::wait(0); // creates the windows related to files dropped at launch + if (Fl::first_window() == 0) { + // if there is no window already, create an empty one + view = create_the_form(!quick_and_dirty); + } else { // a window is created, do not process file in argument list + masename = 0; + } +#else SEA_VIEW *view = create_the_form(!quick_and_dirty); +#endif //Fl::add_timeout(0.5, fix_paste_timeout); if (masename != NULL) use_initial_file(view, masename, FALSE); Fl::lock(); @@ -487,12 +502,6 @@ return 0; } -#ifdef __APPLE__ -static void del_widget_callback(void *data) -{ - ((Fl_Widget*)data)->do_callback(); -} -#endif Fl_Window *use_initial_file(SEA_VIEW *view, char *masename, int doing_dnd) /* returns the window containing the loaded data (alignment or tree) or NULL @@ -520,11 +529,7 @@ fclose(in); w = treedraw(tree, view, extract_filename(masename), FALSE); if (view != NULL && view->tot_seqs == 0) { // closes an empty alignment window that opened the tree -#ifdef __APPLE__ // necessary ≥ 10.10 when dropping treefile to program icon, or the empty window does not close well - Fl::add_timeout(0.0, del_widget_callback, view->dnawin); -#else view->dnawin->do_callback(); -#endif } } else @@ -967,7 +972,7 @@ fl_font(ob->labelfont(), ob->labelsize()); fl_color(background); fl_rectf( x, y - view->line_height + fl_descent(), - view->char_width, + view->char_width +1, view->line_height); fl_color(foreground); fl_draw(lettre, 1, x, y); @@ -1017,6 +1022,7 @@ x = view->x_name; y = view->y_name; fl_font(FL_COURIER, ob->labelsize() ); +fl_push_clip(ob->x(), ob->y(), view->x_seq - ob->x(), ob->h() - 4); debut = view->first_seq - 1; fin = view->first_seq - 2 + view->tot_lines; if(fin >= view->tot_seqs) fin = view->tot_seqs - 1; @@ -1078,14 +1084,30 @@ if (view->sel_seqs[num]) couleur = FL_DARK2; fl_font(fl_font()|FL_BOLD, fl_size()); } - fl_color(couleur); - fl_draw(view->seqname[num], - FL_min((unsigned)view->wid_names, strlen(view->seqname[num])), x, y ); + fl_color(couleur); + int lbytes = strlen(view->seqname[num]); // length in bytes + int lc = fl_utf_nb_char((uchar*)view->seqname[num], lbytes); // length in UTF characters + int draw_bytes; // # of bytes of the name string to draw + if (lc == lbytes) draw_bytes = FL_min(view->wid_names, lbytes); + else if (lc <= view->wid_names) draw_bytes = lbytes; + else { // name contains non ASCII: count characters not bytes + lc = 0; + char *p = view->seqname[num], *last = view->seqname[num] + lbytes; + while (p < last && lc < view->wid_names) { + int len; + fl_utf8decode(p, last, &len); + lc++; + p += len; + } + draw_bytes = p - view->seqname[num]; + } + fl_draw(view->seqname[num], draw_bytes, x, y ); if (num == view->cursor_seq - 1) { fl_font(fl_font()&~FL_BOLD, fl_size()); } y += view->line_height; } + fl_pop_clip(); } @@ -1294,7 +1316,7 @@ if( (c = (int)view->col_rank[nline][pos]) != 0 ) { fl_color(view->curr_colors[c]); fl_rectf( xx, yy, - view->char_width, + view->char_width+1, view->line_height); } xx += view->char_width; @@ -1479,7 +1501,7 @@ if(view->masename == NULL) out_of_memory(); strcpy(view->masename, masename); view->dnawin->label(extract_filename(view->masename)); -#ifdef __APPLE__ +#if defined(__APPLE__) && 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 rename_windowmenuitem(view->dnawin->label(), find_windowmenuitem(view->dnawin)); #endif } @@ -2080,7 +2102,7 @@ delete win; Fl_Group::current(win_parent); if(view->double_buffer) - win = (Fl_Window *)new Fl_Double_Window(x, y, w, h ); + win = new Fl_Double_Window(x, y, w, h ); else win = new Fl_Window(x,y,w,h); win->box(FL_DOWN_BOX); win->resizable(win); @@ -2387,9 +2409,13 @@ Fl::copy("", 0, 1); } } -else if(reponse == PASTE_SEQS) { /* paste first from the selection buffer */ - pasted_from_what_source = 0; - Fl::paste(*(view->DNA_obj), 0 ); +else if(reponse == PASTE_SEQS) { +#ifdef WIN32 + pasted_from_what_source = 1; +#else + pasted_from_what_source = 0; /* paste first from the selection buffer */ +#endif + Fl::paste(*(view->DNA_obj), pasted_from_what_source); } else if(reponse == SELECT_ALL) { /* select all sequences */ if(view->multipl->argument() > 0) mod_multipl(view,0); @@ -2998,7 +3024,7 @@ view->DNA_obj->parent()->redraw(); return NULL; } -if(file_format != NEXUS_FORMAT) protein = is_a_protein_seq(view->sequence[0]); +if(file_format != NEXUS_FORMAT) protein = is_a_protein_alignment(view); if(view->menu_file != NULL) { Fl_Menu_Item *items = (Fl_Menu_Item *)view->menu_file; if(file_format == view->format_for_save) { @@ -3053,10 +3079,12 @@ "Do you want to close it anyway?", "Cancel", "Close", NULL, extract_filename(view->masename)) == 0) return; } free_alignment(view); -#ifdef __APPLE__ +#if defined(__APPLE__) char value[50]; sprintf(value, "%dx%d", view->dnawin->w(), view->dnawin->h() ); - delete_windowmenuitem(find_windowmenuitem(view->dnawin)); +# if 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 + delete_windowmenuitem(find_windowmenuitem(view->dnawin)); +# endif #endif //disconnect all tree windows pointing to the deleted seaview window disconnect_tree_windows(view); @@ -3219,7 +3247,7 @@ if(view->masename == NULL) out_of_memory(); strcpy(view->masename,filename); view->dnawin->label(extract_filename(filename)); -#ifdef __APPLE__ +#if defined(__APPLE__) && 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 rename_windowmenuitem(view->dnawin->label(), find_windowmenuitem(view->dnawin)); #endif Fl_Menu_Item *items = (Fl_Menu_Item *)view->menu_file; @@ -3975,6 +4003,14 @@ SEA_VIEW *view = (SEA_VIEW *)this->user_data(); if(view == NULL) return; //this is necessary after deletion of an alignment window +#if (100*FL_MAJOR_VERSION + FL_MINOR_VERSION >= 104) && !defined(__APPLE__) + if (view->scale != fl_graphics_driver->scale()) { + view->scale = fl_graphics_driver->scale(); + fl_font(view->DNA_obj->labelfont(), view->DNA_obj->labelsize()); + view->char_width = fl_width('W'); + } +#endif + /* returns TRUE if window size was changed by user */ if( compute_size_params( view, FALSE) ) { view->horsli->redraw(); @@ -4170,7 +4206,7 @@ } break; case FL_KEYBOARD: - if( Fl::event_state(FL_COMMAND) ) { /* vrai si touche ctrl */ + if( Fl::event_state(FL_CTRL) || Fl::event_state(FL_META)) { return 0; /* ne pas traiter ici car shortcut d'autres widgets */ } key = Fl::event_key(); @@ -4214,10 +4250,15 @@ fclose(out); count = read_fasta_align(fname, &seqs, &seqnames, &comments, &header, &err_message, false); delete_tmp_filename(fname); - if (count) { + if (count) { // caution here: fl_choice may change Fl::e_text which may be reused after return + char *save = Fl::e_text; + int savel = Fl::e_length; + Fl::e_text = NULL; i = fl_choice("You are about to add to this alignment %d sequence%s (%s) \n" "present in the clipboard.", "Cancel", "Confirm", NULL, count, (count > 1 ? "s" : ""), seqnames[0]); + Fl::e_text = save; + Fl::e_length = savel; if (!i) return; } } @@ -4235,7 +4276,7 @@ if(num != 0) view->comments[view->tot_seqs - 1] = comments[i]; } if (changedwname) { -#ifdef __APPLE__ +#if defined(__APPLE__) && 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 rename_windowmenuitem(view->dnawin->label(), find_windowmenuitem(view->dnawin)); #endif ((Fl_Menu_Item*)view->menu_file)[SAVE].deactivate(); @@ -5053,6 +5094,7 @@ /* menu Props */ view->inverted_colors = inverted; view->consensus_threshold = 60; + view->double_buffer = double_buffer; create_props_menu(view, curr_color_choice, view->inverted_colors, black_and_white, defaultfontsize); /* menu regions */ @@ -5205,13 +5247,14 @@ #if !(defined(__APPLE__) || defined(WIN32)) && SEAVIEW_FLTK_VERSION < 133 my_form->icon( (void*)seaview_X11_icon ); #endif +#if defined(__APPLE__) && 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 + add_windowmenuitem(NULL, my_form); +#endif my_form->show(); #ifndef MICRO my_form->hotspot(my_form); #endif -#ifdef __APPLE__ - add_windowmenuitem(NULL, my_form); -#elif ! defined(WIN32) //for X11 only +#if !(defined(__APPLE__) && !defined(WIN32)) //for X11 only my_form->make_current(); // 3 lines so the Fl_Pack gets its true width menus->damage(FL_DAMAGE_ALL); ((Fl_Widget*)menus)->draw(); diff -Nru seaview-4.6.1.2/seaview.h seaview-4.6.4/seaview.h --- seaview-4.6.1.2/seaview.h 2016-08-25 16:05:42.000000000 +0000 +++ seaview-4.6.4/seaview.h 2018-01-26 11:48:34.000000000 +0000 @@ -204,6 +204,9 @@ 0: normal; >= 1: 1 seul seq ecrite */ int mod_cursor; /* FALSE: cursor ancien ignore; TRUE: ancien efface */ +#if (100*FL_MAJOR_VERSION + FL_MINOR_VERSION >= 104) && !defined(__APPLE__) + float scale; /* scaling factor used to compute char_width */ +#endif float char_width; /* largeur en pixels des caracteres */ int line_height; /* hauteur en pixels des lignes */ int cursor_seq, cursor_site; /* position courante du curseur */ @@ -319,6 +322,7 @@ extern Fl_Window *load_alignment_file(SEA_VIEW *view, char *filename, const char *message, known_format file_format, int doing_dnd); extern int is_a_protein_seq(char *seq); +extern int is_a_protein_alignment(SEA_VIEW *view); extern char *get_full_path(const char *fname); extern void draw_region_background(SEA_VIEW *view, int f_seq0, int l_seq0); extern void load_seq_dialog(SEA_VIEW *view); diff -Nru seaview-4.6.1.2/seaview.html seaview-4.6.4/seaview.html --- seaview-4.6.1.2/seaview.html 2016-08-29 14:33:30.000000000 +0000 +++ seaview-4.6.4/seaview.html 2018-01-26 13:11:46.000000000 +0000 @@ -44,11 +44,11 @@ SEAVIEW and PHYLO_WIN: two graphic tools for sequence alignment and molecular phylogeny. Comput. Appl. Biosci., 12:543-548.

-Version 4.6.1 +Version 4.6.4

Binaries and full source code available from http://doua.prabi.fr/software/seaview -

© 1996-2016 Manolo Gouy +

© 1996-2018 Manolo Gouy
Laboratoire de Biométrie et Biologie Evolutive
CNRS / Université de Lyon

Licensed under the GNU General Public Licence. @@ -270,7 +270,7 @@
Set genetic code: Allows to specify the genetic code used to translate to protein the selected sequence(s). Active only with nucleotide alignments. Genetic codes are saved if the - mase or NEXUS file formats are used. + mase, NEXUS, or FASTA file formats are used.


@@ -815,7 +815,10 @@ or nexus). The format of the input file is the default. -o fname use fname as name of the converted alignment (default is built from input filename) -o - write the output alignment to standard output --translate translate input sequences to protein before outputting them (don't use the -sites option) +-translate translate input sequences to protein before outputting them (don't use the -sites option) +
Add /transl_table=# (where # is a genetic code number) to sequence comments to use variant genetic codes. + If the input file is in FASTA format, put this after each sequence name. + -no_terminal_stop translate terminal stop codons as a gap (with -translate option) -del_gap_only_sites remove all gap-only sites from alignment (don't use the -sites option) -def_species_group group_name,group_members create a species group of given name and members @@ -852,7 +855,7 @@ -align_algo n rank (in seaview, from 0) of alignment algorithm. 0 is clustalo, 1 is muscle. Other algorithms can be used after having been added as external alignment method in seaview. Without this option, seaview's default alignment algorithm is used. This can be changed using seaview's GUI. --align_extra_opts "option1 ..."additional options to use when running the alignment algorithm +-align_extra_args "option1 ..."additional options to use when running the alignment algorithm -align_at_protein_level input sequences are translated to protein; those protein sequences are aligned; and the resulting alignment is reproduced at the DNA level. -o fname use fname as name of the output alignment diff -Nru seaview-4.6.1.2/seaview.svg seaview-4.6.4/seaview.svg --- seaview-4.6.1.2/seaview.svg 2014-09-11 14:03:56.000000000 +0000 +++ seaview-4.6.4/seaview.svg 2017-09-18 13:15:15.000000000 +0000 @@ -1,132 +1,4 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - S - E - A - - - + + + diff -Nru seaview-4.6.1.2/svg.cxx seaview-4.6.4/svg.cxx --- seaview-4.6.1.2/svg.cxx 2016-10-24 20:14:24.000000000 +0000 +++ seaview-4.6.4/svg.cxx 2017-05-25 05:36:46.000000000 +0000 @@ -84,8 +84,9 @@ // Caution: Internet Explorer ignores the xml:space="preserve" attribute // work-around: replace all spaces by no-break space = U+00A0 = 0xC2-0xA0 (UTF-8) before sending to IE fprintf(out_, "%.*s\n",x, y, family_, bold_, style_, size(), red_, green_, blue_, n, str); + "xml:space=\"preserve\" " + " fill=\"rgb(%u,%u,%u)\" textLength=\"%d\">%.*s\n",x, y, family_, bold_, style_, size(), red_, green_, blue_, (int)width(str, n), n, str); + } void Fl_SVG_Graphics_Driver::draw(const char* str, int n, float fx, float fy) { diff -Nru seaview-4.6.1.2/treedraw.cxx seaview-4.6.4/treedraw.cxx --- seaview-4.6.1.2/treedraw.cxx 2016-10-24 19:33:47.000000000 +0000 +++ seaview-4.6.4/treedraw.cxx 2017-12-18 15:38:05.000000000 +0000 @@ -72,7 +72,8 @@ const char *loadphylip(FD_nj_plot *fd_nj_plot, char *arbre, char *last_bootstrap); struct noeud *unrootedset(FD_nj_plot *fd_nj_plot, char *deb, char *fin, branche **p_int_br); char *nextpar(char *pospar); -const char *make_binary_or_unrooted(char *arbre); +const char *make_binary_or_unrooted_extra(char *arbre, bool *p_has_3_subtrees); +const char *make_binary_or_unrooted(char *arbre) {return make_binary_or_unrooted_extra(arbre, NULL); } int make_binary(char *arbre, char *debut, char *fin, int go_down); void mydrawstring(double x, double y, char *nom, char option, int height); void moveto(double x,double y); @@ -136,9 +137,9 @@ void replace_with_new_tree(FD_nj_plot *fd_nj_plot, char *newtree); void tree_counter_callback(Fl_Widget *, void *data); int calc_tree_count(char *tree); +void remove_parenth_no_comma(char *tree); //extern variables & functions -extern void help_callback(Fl_Widget *ob, void *data); extern Fl_Window *use_initial_file(SEA_VIEW *view, char *masename, int doing_dnd); extern void direct_help_callback(Fl_Widget *wgt, void *data); extern void rooted_unrooted_callback(Fl_Widget *o, void *data); @@ -150,11 +151,11 @@ extern void bit1(int *plist, int num); extern char *get_res_value(const char *name, const char *def_value); extern int set_res_value(const char *name, const char *value); -#ifdef __APPLE__ -extern int add_windowmenuitem(const char *name, Fl_Window *w); -extern void rename_windowmenuitem(const char *name, int rank); -extern void delete_windowmenuitem(int rank); -extern int find_windowmenuitem(Fl_Window *w); +#if defined(__APPLE__) && 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 + extern int add_windowmenuitem(const char *name, Fl_Window *w); + extern void rename_windowmenuitem(const char *name, int rank); + extern void delete_windowmenuitem(int rank); + extern int find_windowmenuitem(Fl_Window *w); #endif @@ -516,7 +517,7 @@ #ifndef MICRO w->hotspot(w); #endif -#ifdef __APPLE__ +#if defined(__APPLE__) && 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 add_windowmenuitem(w->label(), w); #endif return w; @@ -707,7 +708,7 @@ fd_nj_plot->tree_name = strdup("pasted tree"); w = fd_nj_plot->full->window(); w->copy_label(fd_nj_plot->tree_name); -#ifdef __APPLE__ +#if defined(__APPLE__) && 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 rename_windowmenuitem(w->label(), find_windowmenuitem(w)); #endif if (count > 1) { @@ -987,7 +988,7 @@ delete fd_nj_plot->menu_font; free(fd_nj_plot); } -#ifdef __APPLE__ +#if defined(__APPLE__) && 100*FL_MAJOR_VERSION + FL_MINOR_VERSION < 104 int rank = find_windowmenuitem((Fl_Window *)wgt); if(rank > 0) delete_windowmenuitem(rank); #endif @@ -1482,6 +1483,7 @@ int i, c, maxlname, v; char *arbre, *finarbre; char *last_bootstrap, *p, *q; +bool has_3_subtrees; arbre = strdup(fd_nj_plot->current_tree); /* lecture de l'arbre et de son label entre [] */ @@ -1528,7 +1530,9 @@ else last_bootstrap = NULL; arbre = (char *)realloc(arbre, strlen(arbre) + 4 * v + 5 ); /* worst case add 4 chars for each , */ -p = (char *)make_binary_or_unrooted(arbre); +p = (char *)make_binary_or_unrooted_extra(arbre, &has_3_subtrees); + if (has_3_subtrees && v + 2 == fd_nj_plot->notu) remove_parenth_no_comma(arbre); + if(p != NULL) { fd_nj_plot->notu = 0; free(arbre); @@ -1867,39 +1871,43 @@ } -const char *make_binary_or_unrooted(char *arbre) +const char *make_binary_or_unrooted_extra(char *arbre, bool *p_has_3_subtrees) //returns NULL iff OK { -char *finarbre, *deba, *debb, *debc; -int retval; - -finarbre= nextpar(arbre); -*(finarbre + 1) = 0; -deba=arbre+1; + char *finarbre, *deba, *debb, *debc; + int retval; + + finarbre= nextpar(arbre); + *(finarbre + 1) = 0; + deba=arbre+1; while (*deba == '(' && nextpar(deba) == finarbre - 1) { // remove extra enclosing parentheses *finarbre = 0; memmove(arbre, deba, finarbre - arbre); finarbre -= 2; } -debb=deba; -while(*debb != ',') { - if(*debb == 0) return("Incorrect tree file"); - if(*debb == '(')debb=nextpar(debb); - debb++; - } -debb++; -debc=debb; -while(*debc != ',' && debc it has 3 subtrees or more at its bottommost level */ - retval = make_binary(arbre , debb, finarbre - 1, TRUE); - if(retval != -1) retval = make_binary(arbre , deba, debb - 2, TRUE); - } -else retval = make_binary(arbre , deba, finarbre - 1, TRUE); - return (retval >= 0 ? NULL : "Cannot process multibranched tree without branch lengths"); + debb=deba; + while(*debb != ',') { + if(*debb == 0) return("Incorrect tree file"); + if(*debb == '(')debb=nextpar(debb); + debb++; + } + debb++; + debc=debb; + while(*debc != ',' && debc it has 3 subtrees or more at its bottommost level */ + retval = make_binary(arbre , debb, finarbre - 1, TRUE); + if(retval != -1) retval = make_binary(arbre , deba, debb - 2, TRUE); + if (p_has_3_subtrees) *p_has_3_subtrees = TRUE; + } + else { + retval = make_binary(arbre , deba, finarbre - 1, TRUE); + if (p_has_3_subtrees) *p_has_3_subtrees = FALSE; + } + return (retval >= 0 ? NULL : "Cannot process multibranched tree without branch lengths"); } @@ -2569,7 +2577,7 @@ p3 = ecrit_arbre_parenth(fd_nj_plot, t3); *(p3 + strlen(p3) - 1) = 0; l = strlen(p1) + strlen(p2)+ strlen(p3) + 150; p = (char *)check_alloc(l, 1); -if(fd_nj_plot->has_br_length) sprintf(p, "(%s:%.5f,%s:%.5f,%s%s:%.5f);", p1, l1, p2, l2, p3, bootstrap, l3); +if(fd_nj_plot->has_br_length) sprintf(p, "(%s:%g,%s:%g,%s%s:%g);", p1, l1, p2, l2, p3, bootstrap, l3); else sprintf(p, "(%s,%s,%s%s);", p1, p2, p3, bootstrap); free(p1); free(p2); free(p3); return p; @@ -2623,7 +2631,7 @@ if(arbre==NULL) return NULL; if(fd_nj_plot->has_br_length) { if(arbre+10>=finarbre) return NULL; - sprintf(++arbre,":%.5f",centre->l1); + sprintf(++arbre,":%g",centre->l1); while(*arbre!=0) arbre++; } else arbre++; @@ -2632,7 +2640,7 @@ if(arbre==NULL) return NULL; if(fd_nj_plot->has_br_length) { if(arbre+10>=finarbre) return NULL; - sprintf(++arbre,":%.5f",centre->l2); + sprintf(++arbre,":%g",centre->l2); while(*arbre!=0) arbre++; } else arbre++; @@ -4031,6 +4039,56 @@ return count; } +/* Remove parentheses around comma-free blocks + ( name-or-block : length1 ) bootstrap : length2 + that occur with IQtree. This substring is replaced by : + name-or-block : length1+length2 + */ +void remove_parenth_no_comma(char *tree) +{ + char *close, *p; + int found = FALSE; + if (*tree != '(') return; + close = nextpar(tree); + p = tree; + while (++p < close) { + if (*p == '(') { + char *q = nextpar(p); + remove_parenth_no_comma(p); + p = q; + } + else if(*p == ',') { + found = TRUE; + } + } + if (!found) { + char *q, *r, length_value[20]; + int len; + double l2, l3; + p = close-1; + while (*p != ':') { + p--; + if (p <= tree) return; + } + sscanf(p+1, "%lf", &l2); + q = close + 1; + while (*q != ':') { + if (*q == 0 || *q == ')') return; + q++; + } + sscanf(q+1, "%lf", &l3); + q = strchr(q, ')'); + if (q == NULL) return; + *tree = ' '; + r = p+1; + do *r++ = ' '; while (r < q); + sprintf(length_value, "%f", l2+l3); + len = strlen(length_value); + if (p + len >= q) len = q - p - 1; + memcpy(p + 1, length_value, len); + } +} + /* void check_tree(struct noeud *from, struct noeud *parent) { diff -Nru seaview-4.6.1.2/trees.cxx seaview-4.6.4/trees.cxx --- seaview-4.6.1.2/trees.cxx 2016-11-17 19:59:01.000000000 +0000 +++ seaview-4.6.4/trees.cxx 2017-11-23 12:38:20.000000000 +0000 @@ -612,7 +612,7 @@ fprintf(out, "%d\n", mat->n_otu); for( i = 0; i < mat->n_otu - 1; i++) { for( j = i + 1; j < mat->n_otu; j++) { - fprintf(out, "%.6f ", mat->dist[i][j]); + fprintf(out, "%g ", mat->dist[i][j]); } fputs("\n", out); } @@ -626,7 +626,7 @@ char *n1 = mat->name[i]; char *n2 = mat->name[j]; if (strcmp(n1, n2) > 0) { char *p = n1; n1 = n2; n2 = p; } - fprintf(out, "%s,%s: %f\n", n1, n2, mat->dist[i][j]); + fprintf(out, "%s,%s: %g\n", n1, n2, mat->dist[i][j]); } } fclose(out); @@ -1201,6 +1201,24 @@ display_tree = put_names_back_in_tree(display_tree, truenames); //process bootstrap trees char *bootstrap_trees = NULL; + if (replicates > 0) { + sprintf(input, "%s.phy_phyml_boot_stats.txt", base_fname); + in = fopen(input, "r"); + if (!in) { + sprintf(input, "%s.phy_phyml_boot_stats", base_fname); + in = fopen(input, "r"); + } + if (in) { // compute the true # of bootstrap replicates because parallelized phyML can compute a few more + char line[150]; + while ((p = fgets(line, sizeof(line), in))) { + while (*p == ' ') p++; + if (*p == '#') { + sscanf(p+1, "%d", &replicates); + } + } + fclose(in); + } + } if (replicates > 0 && b_keep_trees->value()) { sprintf(input, "%s.phy_phyml_boot_trees.txt", base_fname); in = fopen(input, "r"); diff -Nru seaview-4.6.1.2/unrooted.cxx seaview-4.6.4/unrooted.cxx --- seaview-4.6.1.2/unrooted.cxx 2016-03-31 14:24:09.000000000 +0000 +++ seaview-4.6.4/unrooted.cxx 2017-09-14 08:33:21.000000000 +0000 @@ -392,6 +392,12 @@ int char_width, char_height, num, dernier, encore = FALSE, ascend, descend; hit result; hits_field hits; +#if !(defined(__APPLE__) || defined(WIN32)) + if (fl_display && Fl::event() != FL_DRAG) { + ob->unrooted_plot->window()->cursor(FL_CURSOR_WAIT); + Fl::flush(); + } +#endif char_width = myrint(fl_width("M")); char_height = my_get_char_height(&ascend, &descend); dernier = 2*ob->notu-3; @@ -424,6 +430,9 @@ descend, ascend); } if(ob->has_br_length) draw_scale(ob, char_height, ascend); +#if !(defined(__APPLE__) || defined(WIN32)) + if (fl_display && Fl::event() != FL_DRAG) ob->unrooted_plot->window()->cursor(FL_CURSOR_DEFAULT); +#endif } @@ -613,17 +622,6 @@ if(radians < 0) radians += 2 * M_PI; float cosa = cos(radians); float sina = sin(radians); - if(radians > M_PI/2 && radians < 3*M_PI/2 ) {//draw string so its end is at position x,y - x1 += (int)( w * cosa ); - y1 -= (int)( w * sina ); - radians += M_PI; - degrees -= 180;/* clockwise degrees */ - if(radians >= 2*M_PI) radians -= 2 * M_PI; - if(degrees <= 0) degrees += 360; - cosa = - cosa; sina = - sina; - } - x1 += (int)( (fl_size()/3) * sina );//position string midheight at position x,y - y1 += (int)( (fl_size()/3) * cosa ); const float ch = 0.7; x2 = x1 - (int)(ch * fl_size() * sina); @@ -652,15 +650,32 @@ int ascent) { int x, y; - float degrees = - radians * 180/M_PI; + float degrees = - int(radians * 180/M_PI); x = (int)phys_pos->x; y = (int)phys_pos->y; - float w = fl_width(nom); + int dx, dy; + fl_measure(nom, dx, dy); + float w = dx, l = dy/4., fdx; hit result = try_angle_draw(w, &x, &y, °rees, fd_unrooted->x, fd_unrooted->y, fd_unrooted->w, fd_unrooted->h); if( (!doit) && result != NO_HIT) return result; if( ! doit) return NO_HIT; if(color) fl_color(FL_RED); - fl_draw(-(int)degrees, nom, x, y); + int rt_angle = -(int)degrees; + if (rt_angle <= 90 || rt_angle >= 270) { + if (rt_angle >= 270) rt_angle -= 360; + fdx = l * sin(M_PI*rt_angle/180.); + dx = (int)fdx; + dy = sqrt(l*l - fdx*fdx); + fl_draw(rt_angle, nom, x + dx, y + dy); + } else { + rt_angle -= 180; + float ddy = -sin(M_PI*(rt_angle+180)/180.) * dx; + float ddx = cos(M_PI*(rt_angle+180)/180.) * dx; + fdx = l * sin(M_PI*rt_angle/180.); + dx = fdx + ddx; + dy = sqrt(l*l - fdx*fdx) + ddy; + fl_draw(rt_angle, nom, x + dx, y + dy); + } if(color) fl_color(FL_BLACK); return NO_HIT; } diff -Nru seaview-4.6.1.2/use_mase_files.cxx seaview-4.6.4/use_mase_files.cxx --- seaview-4.6.1.2/use_mase_files.cxx 2015-09-22 05:36:39.000000000 +0000 +++ seaview-4.6.4/use_mase_files.cxx 2018-01-26 11:49:27.000000000 +0000 @@ -773,6 +773,18 @@ } +int is_a_protein_alignment(SEA_VIEW *view) +/* returns TRUE if alignment looks like protein data (less than 80% ACGTU) */ +{ + char *seq; + for (int i = 0; i < view->tot_seqs; i++) { + seq = view->sequence[i]; + while (*seq == '-') seq++; + if (*seq != 0) return is_a_protein_seq(view->sequence[i]); + } + return false; +} + int save_phylip_file(const char *fname, char **seq, char **seqname, int totseqs, int *eachlength, region *region_used, int *sel_seqs, int tot_sel_seqs, int phylipwidnames) @@ -1109,6 +1121,11 @@ putc(' ', out); p = comments[num] + 1; while(*p != '\n' && *p != 0) putc(*(p++), out); + int gc = get_ncbi_gc_from_comment(comments[num]); + char *q = strstr(comments[num], "/transl_table="); + if (gc > 1 && q != NULL && q >= p) { + fprintf(out, " /transl_table=%d", gc); + } } } putc('\n', out); @@ -2054,7 +2071,10 @@ memset(view, 0, sizeof(SEA_VIEW)); view->menubar = new Fl_Menu_Bar(0,0, 30, 30); view->menu_trees = new vlength_menu(view->menubar, "Trees", NULL, 0); - + +#ifndef R_OK +#define R_OK 04 +#endif if (fl_access(infile, R_OK)) { fprintf(stderr, "File %s\nis not readable or does not exist", infile); return NULL; @@ -2108,7 +2128,7 @@ if(name_sp != NULL) free(name_sp); } if (view->tot_seqs == 0) return NULL; - if (file_format != NEXUS_FORMAT) view->protein = is_a_protein_seq(view->sequence[0]); + if (file_format != NEXUS_FORMAT) view->protein = is_a_protein_alignment(view); view->each_length = new int[view->tot_seqs]; for (i = 0; i < view->tot_seqs; i++) { view->each_length[i] = strlen(view->sequence[i]); diff -Nru seaview-4.6.1.2/viewasprots.cxx seaview-4.6.4/viewasprots.cxx --- seaview-4.6.1.2/viewasprots.cxx 2014-09-11 14:03:56.000000000 +0000 +++ seaview-4.6.4/viewasprots.cxx 2017-05-19 07:47:35.000000000 +0000 @@ -14,7 +14,8 @@ char codaa(char *codon, int code); int get_acnuc_gc_number(int ncbi_gc); int get_ncbi_gc_number(int ncbi_gc); - char *get_code_descr(int code); + char *get_code_descr(int code); + char *get_code_target(int code); } extern int totcodes; extern void set_and_show_new_cursor_seq(SEA_VIEW *view, int new_pos); @@ -191,7 +192,7 @@ } *pd = 0; while(memcmp(dna, "---", 3) == 0) dna += 3; - if (*dna != 0) {//if a partial codon remains at end + if (*dna != 0 && *dna != '-') {//if a partial codon remains at end while (*(pd-1) == '-') pd--; ld = pd - newdna; q = dna + strlen(dna); @@ -253,27 +254,21 @@ int gc = 1, num; char line[170]; int status; -static char codencbinames[19][60] = { "Standard", "Yeast mt", "Vertebrate mt", - "Mold+Protozoan+Coelentarate mt, Mycoplasma Spiroplasma", "Invertebrate mt", "Alternative Yeast Nuclear", - "Ciliate+Dasycladacean+Hexamita Nuclear", "Euplotid Nuclear", "Echinoderm+Flatworm mt", - "Ascidian mt", "Alternative Flatworm mt", "Blepharisma Macronuclear", - "Bacterial and Plant Plastid", "Chlorophycean mt", "Trematode mt", - "Scenedesmus obliquus mt", "Thraustochytrium mt", "Pterobranchia mt", "Candidate Division SR1"}; if(view->comments == NULL) view->comments = (char **)calloc(view->tot_seqs, sizeof(char *)); if(view->comments == NULL) return; -Fl_Window *win = new Fl_Window(750,390); +Fl_Window *win = new Fl_Window(850,400); win->label("Genetic code selection"); for(num = 0; num < view->tot_seqs; num++) if(view->sel_seqs[num]) break; gc = get_ncbi_gc_from_comment(view->comments[num]); -Fl_Hold_Browser *obj = new Fl_Hold_Browser(5, 25, 740, 340); +Fl_Hold_Browser *obj = new Fl_Hold_Browser(5, 25, 840, 350); obj->textfont(FL_COURIER); sprintf(line, "Set genetic code for %s", view->tot_sel_seqs > 1 ? "selected sequences" : view->seqname[num]); obj->copy_label(line); obj->align(FL_ALIGN_TOP); for(num = 0; num < totcodes; num++) { - sprintf(line, "%45.45s|%2d| %s", codencbinames[num], get_ncbi_gc_number(num), get_code_descr(num)); + sprintf(line, "%65.65s|%2d| %s", get_code_target(num), get_ncbi_gc_number(num), get_code_descr(num)); obj->add(line); } obj->value(get_acnuc_gc_number(gc) + 1); diff -Nru seaview-4.6.1.2/win32_extras.cxx seaview-4.6.4/win32_extras.cxx --- seaview-4.6.1.2/win32_extras.cxx 2015-11-26 17:41:08.000000000 +0000 +++ seaview-4.6.4/win32_extras.cxx 2017-07-07 14:49:57.000000000 +0000 @@ -1,12 +1,13 @@ #ifdef WIN32 + +#include #include "pdf_or_ps.h" -#include #include #include #include -#ifndef NO_PDF -#include -#endif +# ifndef NO_PDF +# include +# endif /* included functions */ void my_bell(void); @@ -14,6 +15,7 @@ char **getutf8args(int *pargc); int mysystem(const char *cmd); +#if 100*FL_MAJOR_VERSION + 10*FL_MINOR_VERSION + FL_PATCH_VERSION < 134 // FLTK before 1.3.4 Copy_Surface::Copy_Surface(int w, int h) : Fl_Surface_Device(new Fl_GDI_Graphics_Driver()) { @@ -57,6 +59,8 @@ delete driver(); } +#endif // FLTK before 1.3.4 + char *get_prog_dir(void) /* returns path of dir where calling program was launched */ diff -Nru seaview-4.6.1.2/xfmatpt.cxx seaview-4.6.4/xfmatpt.cxx --- seaview-4.6.1.2/xfmatpt.cxx 2014-09-11 14:03:56.000000000 +0000 +++ seaview-4.6.4/xfmatpt.cxx 2017-11-25 07:23:03.000000000 +0000 @@ -90,12 +90,12 @@ void my_watch_cursor(Fl_Window *win) { -win->default_cursor(FL_CURSOR_WAIT); +if (win) win->default_cursor(FL_CURSOR_WAIT); } void fl_reset_cursor(Fl_Window *win) { -win->default_cursor(FL_CURSOR_DEFAULT); +if (win) win->default_cursor(FL_CURSOR_DEFAULT); }