NCBI C++ Toolkit Cross Reference

  C++/src/gui/packages/pkg_sequence_edit/dll_register.cpp


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674
/* $Id: dll_register.cpp 32160 2015-01-12 16:01:36Z filippov $ * ========================================================================= * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * ========================================================================= * * Authors: Andrey Yazhuk, Igor Filippov, Jie Chen * * File Description: * Defines "Sequence Editing" package for GBENCH. */ #include <ncbi_pch.hpp> #include <objects/seqtable/SeqTable_column.hpp> #include <objects/seqtable/SeqTable_multi_data.hpp> #include <objects/submit/Seq_submit.hpp> #include <objtools/edit/autodef.hpp> #include <objtools/edit/cds_fix.hpp> #include <objtools/edit/mail_report.hpp> #include <objtools/edit/struc_comm_field.hpp> #include <objtools/cleanup/cleanup.hpp> #include <gui/framework/gui_package.hpp> #include <gui/framework/pkg_wb_connect.hpp> #include <gui/framework/workbench_impl.hpp> #include <gui/core/selection_service_impl.hpp> #include <gui/widgets/wx/ui_command.hpp> #include <gui/utils/extension_impl.hpp> #include <gui/objutils/cmd_change_seq_feat.hpp> #include <gui/objutils/cmd_change_align.hpp> #include <gui/objutils/cmd_insert_bioseq_set.hpp> #include <gui/objutils/util_cmds.hpp> #include <gui/objutils/utils.hpp> #include <gui/objutils/macro_engine.hpp> #include <gui/objutils/table_data_base.hpp> #include <gui/objutils/macro_fn_do.hpp> #include <gui/objects/GBWorkspace.hpp> #include <gui/objects/WorkspaceFolder.hpp> #include <gui/widgets/edit/init.hpp> #include <gui/widgets/edit/edit_object.hpp> #include <gui/widgets/edit/edit_object_dlg.hpp> #include <gui/widgets/edit/edit_object_seq_feat.hpp> #include <gui/widgets/edit/edit_object_seq_desc.hpp> #include <gui/widgets/loaders/open_objects_dlg.hpp> #include <gui/widgets/loaders/file_load_wizard.hpp> #include "open_data_source_object_dlg.hpp" #include <gui/utils/object_loader.hpp> #include <gui/utils/execute_unit.hpp> #include <gui/utils/app_popup.hpp> #include <gui/utils/event_handler.hpp> #include <gui/widgets/wx/async_call.hpp> #include <gui/widgets/wx/sys_path.hpp> #include <gui/packages/pkg_sequence_edit/autodef_tool_manager.hpp> #include <gui/packages/pkg_sequence_edit/subprep_tool.hpp> #include <gui/packages/pkg_sequence_edit/srcedit_tool.hpp> #include <gui/packages/pkg_sequence_edit/subprep_view.hpp> #include <gui/packages/pkg_sequence_edit/seq_tree_view.hpp> #include <gui/packages/pkg_sequence_edit/edit_table_views.hpp> #include <gui/packages/pkg_sequence_edit/seqid_fix_dlg.hpp> #include <gui/widgets/edit/edit_object_dlg.hpp> #include <gui/widgets/edit/edit_table_event.hpp> #include <gui/widgets/edit/table_data_suc.hpp> #include <gui/widgets/edit/table_data_validate.hpp> #include <gui/packages/pkg_sequence_edit/remove_desc_dlg.hpp> #include <gui/packages/pkg_sequence_edit/remove_sequences_from_alignments.hpp> #include <gui/packages/pkg_sequence_edit/remove_features_dlg.hpp> #include <gui/packages/pkg_sequence_edit/remove_structured_comment.hpp> #include <gui/packages/pkg_sequence_edit/remove_annot.hpp> #include <gui/packages/pkg_sequence_edit/remove_genomeprojectdb.hpp> #include <gui/packages/pkg_sequence_edit/add_citsubupdate.hpp> #include <gui/packages/pkg_sequence_edit/pubdesc_editor.hpp> #include <gui/packages/pkg_sequence_edit/modify_structured_comment.hpp> #include <gui/packages/pkg_sequence_edit/remove_bankit_comment.hpp> #include <gui/packages/pkg_sequence_edit/remove_structuredcomment_keyword.hpp> #include <gui/packages/pkg_sequence_edit/reorder_sequences_dlg.hpp> #include <gui/packages/pkg_sequence_edit/convert_comment.hpp> #include <gui/packages/pkg_sequence_edit/modify_feature_id.hpp> #include <gui/packages/pkg_sequence_edit/remove_sequences.hpp> #include <gui/packages/pkg_sequence_edit/pcr-primers-edit.hpp> #include <gui/packages/pkg_sequence_edit/fix_orgmod_institution.hpp> #include <gui/packages/pkg_sequence_edit/append_mod_to_org_dlg.hpp> #include <gui/packages/pkg_sequence_edit/parse_collectiondate_formats.hpp> #include <gui/packages/pkg_sequence_edit/country_fixup.hpp> #include <gui/packages/pkg_sequence_edit/bulkfeatureadddlg.hpp> #include <gui/packages/pkg_sequence_edit/AECRdlg.hpp> #include <gui/packages/pkg_sequence_edit/parse_record_dlg.hpp> #include <gui/packages/pkg_sequence_edit/srceditdialog.hpp> #include <gui/packages/pkg_sequence_edit/molinfo_edit_dlg.hpp> #include <gui/packages/pkg_sequence_edit/miscedit_util.hpp> #include <gui/packages/pkg_sequence_edit/featedit_util.hpp> #include <gui/packages/pkg_sequence_edit/autodef_dlg.hpp> #include <gui/packages/pkg_sequence_edit/autodef_params.hpp> #include <gui/packages/pkg_sequence_edit/strain_serotype_influenza.hpp> #include <gui/packages/pkg_sequence_edit/qual_table_load_manager.hpp> #include <gui/packages/pkg_sequence_edit/vectortrimdlg.hpp> #include <gui/packages/pkg_sequence_edit/citem_util.hpp> #include <gui/packages/pkg_sequence_edit/remove_unverified.hpp> #include <gui/packages/pkg_sequence_edit/add_deflinedlg.hpp> #include <gui/packages/pkg_sequence_edit/bulk_edit_feat_dlg.hpp> #include <gui/packages/pkg_sequence_edit/convert_feat_dlg.hpp> #include <gui/packages/pkg_sequence_edit/prefix_deflinedlg.hpp> #include <gui/packages/pkg_sequence_edit/disc_report_dlg.hpp> #include <gui/packages/pkg_sequence_edit/edit_pub_dlg.hpp> #include <gui/packages/pkg_sequence_edit/global_author_replace_dlg.hpp> #include <gui/packages/pkg_sequence_edit/makebadspecifichost_dlg.hpp> #include <gui/packages/pkg_sequence_edit/editingbtnspanel.hpp> #include <gui/packages/pkg_sequence_edit/correct_rna_strand_dlg.hpp> #include <gui/packages/pkg_sequence_edit/apply_rna_its_dlg.hpp> #include <gui/packages/pkg_sequence_edit/trim_n.hpp> #include <gui/packages/pkg_sequence_edit/label_rna.hpp> #include <gui/packages/pkg_sequence_edit/rem_prot_titles.hpp> #include <gui/packages/pkg_sequence_edit/add_transl_except_dlg.hpp> #include <gui/packages/pkg_sequence_edit/bulk_cds_edit.hpp> #include <gui/packages/pkg_sequence_edit/bulk_gene_edit.hpp> #include <gui/packages/pkg_sequence_edit/bulk_rna_edit.hpp> #include <gui/packages/pkg_sequence_edit/display_macro_dlg.hpp> #include <gui/packages/pkg_sequence_edit/choose_set_class_dlg.hpp> #include "test_dialog_view.hpp" #include <gui/widgets/seq/text_panel.hpp> #include <gui/packages/pkg_sequence_edit/retranslate_cds.hpp> #include <gui/packages/pkg_sequence_edit/generic_report_dlg.hpp> #include <gui/packages/pkg_sequence_edit/segregate_sets.hpp> #include <gui/packages/pkg_sequence_edit/sequester_sets.hpp> #include <gui/packages/pkg_sequence_edit/macroedit_dlg.hpp> #include <gui/packages/pkg_sequence_edit/suc_refresh_cntrl.hpp> #include <gui/packages/pkg_sequence_edit/revcomp_sequences.hpp> #include <gui/packages/pkg_sequence_edit/select_target_dlg.hpp> #include <gui/packages/pkg_sequence_edit/withdraw_sequences.hpp> #include <gui/packages/pkg_sequence_edit/uncul_tax_tool.hpp> #include <gui/packages/pkg_sequence_edit/apply_indexer_comments.hpp> #include <gui/packages/pkg_sequence_edit/correct_genes_dialog.hpp> #include <gui/packages/pkg_sequence_edit/extend_partial_features.hpp> #include <gui/packages/pkg_sequence_edit/convert_cds_to_misc_feat.hpp> #include <gui/packages/pkg_sequence_edit/add_flu_comments.hpp> #include <gui/packages/pkg_sequence_edit/lowercase_qualifiers.hpp> #include <gui/packages/pkg_sequence_edit/add_sequences.hpp> #include <gui/packages/pkg_sequence_edit/convert_set_type_dlg.hpp> #include <gui/packages/pkg_sequence_edit/gene_features_from_other_features.hpp> #include <gui/packages/pkg_sequence_edit/latlon_tool.hpp> #include <gui/packages/pkg_sequence_edit/export_table.hpp> #include <gui/packages/pkg_sequence_edit/edit_sequence.hpp> #include <gui/packages/pkg_sequence_edit/raw_seq_to_delta_by_n.hpp> #include <gui/core/simple_project_view.hpp> #include <gui/widgets/edit/edit_obj_view_dlg.hpp> #ifdef _DEBUG #include <gui/packages/pkg_sequence_edit/debug_macro_tool.hpp> #endif #include <wx/msgdlg.h> #include <wx/statline.h> #include <wx/clipbrd.h> #include "test_discrep_diavw.hpp" BEGIN_NCBI_SCOPE /////////////////////////////////////////////////////////////////////////////// /// Declare the Package Object class CSeqEditPackage : public IGuiPackage , public IUICommandContributor , public IMenuContributor , public IPackageWorkbenchConnector { public: CSeqEditPackage(); virtual string GetName() const { return "Sequence Editing"; } virtual void GetVersion(size_t& verMajor, size_t& verMinor, size_t& verPatch) const { verMajor = 1; verMinor = 0; verPatch = 0; } virtual bool Init(); virtual void Shut() {} // IUICommandContributor virtual vector<CUICommand*> GetCommands(); virtual wxEvtHandler* GetEventHandler(); // IPackageWorkbenchConnector virtual void SetWorkbench(IWorkbench* wb); protected: // IMenuContributor virtual const SwxMenuItemRec* GetMenuDef() const; IWorkbench* m_Workbench; }; CSeqEditPackage::CSeqEditPackage() { m_Workbench = NULL; } bool CSeqEditPackage::Init() { // Declare you extension here // Examples: //CExtensionDeclaration("view_manager_service::view_factory", // new CTextViewFactory()); //CExtensionDeclaration("ui_data_source_type", // new CGenBankUIDataSourceType()); //CExtensionDeclaration ("file_format_loader_manager", // new CFASTAFormatLoadManager()); //CExtensionDeclaration("data_mining_tool", new CEntrezSearchTool()); init_w_edit(); CExtensionDeclaration("ui_algo_tool_manager", new CAutodefToolManager()); // Edit tools #ifdef _DEBUG CExtensionDeclaration("ui_algo_tool_manager", new CSubPrepTool()); #endif // CExtensionDeclaration("ui_algo_tool_manager", new CEditingBtnsTool()); CExtensionDeclaration("ui_algo_tool_manager", new CSrcEditTool()); #ifdef _DEBUG CExtensionDeclaration("ui_algo_tool_manager", new CDebugMacroTool()); #endif CExtensionDeclaration("view_manager_service::view_factory", new CSubPrepViewFactory()); // CExtensionDeclaration("view_manager_service::view_factory", // new CEditingBtnsViewFactory()); // CExtensionDeclaration("view_manager_service::view_factory", // new CSeqTreeViewFactory()); CExtensionDeclaration("view_manager_service::view_factory", new CValidateTableViewFactory()); CExtensionDeclaration("view_manager_service::view_factory", new CSUCTableViewFactory()); CExtensionDeclaration ("file_format_loader_manager", new CQualTableLoadManager()); // IFileLoadPanelClient CExtensionDeclaration ("file_load_panel_client", new CFileLoadPanelClientFactory<CQualTableLoadManager>()); wxString path = CSysPath::ResolvePathExisting( wxT("<std>/etc/list_of_macros.txt")); if (!path.IsEmpty()) { CMacroLib::GetInstance().Build_Lib( ToStdString(path) ); wxString path_syn = CSysPath::ResolvePathExisting( wxT("<std>/etc/synonyms.txt")); if (!path_syn.IsEmpty()) CMacroLib::GetInstance().Store_SynonymList( ToStdString(path_syn) ); } //! Please don't register commands twice. Either you register them directly //! with x_RegisterCommands(), or you use the interface IUICommandContributor. //! Please never do both! //! //x_RegisterCommands(); return true; } void CSeqEditPackage::SetWorkbench(IWorkbench* wb) { m_Workbench = wb; } /////////////////////////////////////////////////////////////////////////////// /// Declare Package Entry Point extern "C" { NCBI_PACKAGEENTRYPOINT_EXPORT IGuiPackage* NCBIGBenchGetPackage() { return new CSeqEditPackage(); } } class CSequenceEditingEventHandler : public wxEvtHandler, public CEventHandler { DECLARE_EVENT_TABLE(); DECLARE_EVENT_MAP(); public: CSequenceEditingEventHandler(IWorkbench* wb = NULL); void IsObjectSelected(wxUpdateUIEvent& event); void IsLocationSelected(wxUpdateUIEvent& event); void ItemAction(wxCommandEvent& event, CRef <CItem> item, const string& title); ~CSequenceEditingEventHandler(); // methods void RemoveDescriptors(wxCommandEvent& evt); void RemoveFeatures(wxCommandEvent& evt); void ApplyIndexerComments(wxCommandEvent& evt); void RemoveSeqAnnotIds( wxCommandEvent& event ); void RemoveBankitComment( wxCommandEvent& event ); void RemoveDuplicateStructuredComments( wxCommandEvent& event ); void RemoveSequencesFromAlignments( wxCommandEvent& event ); void RemoveSequences( wxCommandEvent& event ); void RevCompSequences( wxCommandEvent& event ); void BioseqFeatsRevComp( wxCommandEvent& event ); void UnculTaxTool( wxCommandEvent& event ); void EditSequence( wxCommandEvent& event ); void RemoveSeqAnnotAlign( wxCommandEvent& event ); void RemoveSeqAnnotGraph( wxCommandEvent& event ); void RemoveGenomeProjectsDB( wxCommandEvent& event ); void RemoveEmptyGenomeProjectsDB( wxCommandEvent& event ); void TaxFixCleanup( wxCommandEvent& event ); void DisableStrainForwarding( wxCommandEvent& event ); void EditPubs( wxCommandEvent& event ); void GlobalAuthorReplace( wxCommandEvent& event ); void FixCapitalizationAll( wxCommandEvent& event ); void FixCapitalizationAuthors( wxCommandEvent& event ); void FixCapitalizationTitles( wxCommandEvent& event ); void FixCapitalizationAffiliation( wxCommandEvent& event ); void FixCapitalizationCountry( wxCommandEvent& event ); void RemoveUnpublishedPublications( wxCommandEvent& event ); void RemovePublishedPublications( wxCommandEvent& event ); void RemoveCollidingPublications( wxCommandEvent& event ); void RemoveAllPublications( wxCommandEvent& event ); void RemoveAuthorConsortiums( wxCommandEvent& event ); void ReverseAuthorNames( wxCommandEvent& event ); void StripAuthorSuffixes( wxCommandEvent& event ); void TruncateAuthorMiddleInitials( wxCommandEvent& event ); void ConvertAuthorToConstortiumWhereLastName( wxCommandEvent& event ); void ConvertAuthorToConsortiumAll( wxCommandEvent& event ); void AddCitSubForUpdate( wxCommandEvent& event ); void FixUsaAndStates( wxCommandEvent& event ); void RetranslateCDS( wxCommandEvent& event ); void ResynchronizePartials( wxCommandEvent& event ); void AddTranslExcept( wxCommandEvent& event ); void RemoveAllStructuredComments( wxCommandEvent& event ); void RemoveEmptyStructuredComments( wxCommandEvent& event ); void ModifyStructuredComment( wxCommandEvent& event ); void RemoveStructuredCommentKeyword( wxCommandEvent& event ); void AddStructuredCommentKeyword( wxCommandEvent& event ); void AddGenomeAssemblyStructuredComment( wxCommandEvent& event ); void ReorderStructuredComment( wxCommandEvent& event ); void ConvertComment( wxCommandEvent& event ); void ParseComment( wxCommandEvent& event ); void LowercaseQuals( wxCommandEvent& event ); void AssignFeatureIds( wxCommandEvent& event ); void ClearFeatureIds( wxCommandEvent& event ); void ReassignFeatureIds( wxCommandEvent& event ); void UniqifyFeatureIds( wxCommandEvent& event ); void TrimJunkInPrimerSeqs( wxCommandEvent& event ); void FixiInPrimerSeqs( wxCommandEvent& event ); // J. Chen begin void RemoveCddFeatDbxref(wxCommandEvent& event ); void PrefixAuthWithTax(wxCommandEvent& event ); void FocusSet( wxCommandEvent& event ); void FocusClear( wxCommandEvent& event ); void SetTransgSrcDesc( wxCommandEvent& event ); void SplitDblinkQuals(wxCommandEvent& evt); // J. Chen end void FixOrgModInstitution( wxCommandEvent& event ); void SwapPrimerSeqName( wxCommandEvent& event ); void MergePrimerSets( wxCommandEvent& event ); void SplitPrimerSets( wxCommandEvent& event ); void AppendModToOrg( wxCommandEvent& event ); void ParseCollectionDateMonthFirst( wxCommandEvent& event ); void ParseCollectionDateDayFirst( wxCommandEvent& event ); void CountryFixupCap( wxCommandEvent& event ); void CountryFixupNoCap( wxCommandEvent& event ); void VectorTrim( wxCommandEvent& event ); void SelectTarget( wxCommandEvent& event ); void AddCDS( wxCommandEvent& event ); void AddRNA( wxCommandEvent& event ); void AddOtherFeature( wxCommandEvent& event ); void Validate( wxCommandEvent& event ); void SortUniqueCount( wxCommandEvent& event ); void MegaReport( wxCommandEvent& event ); // J. Chen void DiscrepancyReport( wxCommandEvent& event ); // J. Chen void OnCallerTool ( wxCommandEvent& event); // J. Chen void RemoveAllFeatures ( wxCommandEvent& event ); void AddSequences ( wxCommandEvent& event ); void ApplyEditConvertRemove ( wxCommandEvent& event ); void ParseText ( wxCommandEvent& event ); void ConvertFeatures ( wxCommandEvent& event ); void ConvertCdsToMiscFeat( wxCommandEvent& evt ); void ConvertCdsWithInternalStopToMiscFeat( wxCommandEvent& evt ); void ConvertCdsWithInternalStopToMiscFeatViral( wxCommandEvent& evt ); void ConvertCdsWithInternalStopToMiscFeatUnverified( wxCommandEvent& evt ); void TableReader ( wxCommandEvent& event ); void TableReaderClipboard ( wxCommandEvent& event ); void BulkEdit ( wxCommandEvent& event ); void MolInfoEdit ( wxCommandEvent& event ); void ExportTable ( wxCommandEvent& event ); void Autodef ( wxCommandEvent& event ); void PT_Cleanup ( wxCommandEvent& event ); void ParseStrainSerotypeFromNames ( wxCommandEvent& event); void AddStrainSerotypeToNames ( wxCommandEvent& event); void FixupOrganismNames ( wxCommandEvent& event); void SplitQualifiersAtCommas ( wxCommandEvent& event); void SplitStructuredCollections ( wxCommandEvent& event); void TrimOrganismNames ( wxCommandEvent& event); void RemoveUnverified( wxCommandEvent& event ); void AddNamedrRNA ( wxCommandEvent& event); void AddControlRegion ( wxCommandEvent& event); void AddMicrosatellite ( wxCommandEvent& event); void CreateFeature ( wxCommandEvent& event); void CreateDescriptor ( wxCommandEvent& event); void EditFeature ( wxCommandEvent& evt); void ExtendPartialsConstr( wxCommandEvent& evt); void ExtendPartialsAll( wxCommandEvent& evt); void AddDefLine ( wxCommandEvent& evt); void RemoveDefLines ( wxCommandEvent& event); void PrefixDefLines ( wxCommandEvent& event); void EditingButtons ( wxCommandEvent& event); void MakeBadSpecificHostTable ( wxCommandEvent& event); void CorrectRNAStrand ( wxCommandEvent& event); void ApplyRNA_ITS ( wxCommandEvent& event); void TrimNs( wxCommandEvent& event ); void AddFluComments( wxCommandEvent& event ); void LabelRna( wxCommandEvent& event ); void RemProtTitles( wxCommandEvent& event ); void BulkCdsEdit ( wxCommandEvent& event ); void BulkGeneEdit ( wxCommandEvent& event ); void BulkRnaEdit ( wxCommandEvent& event ); void CorrectGenes ( wxCommandEvent& event ); void SegregateSets ( wxCommandEvent& event ); void SequesterSets ( wxCommandEvent& event ); void WithdrawSequences ( wxCommandEvent& event ); void AddSet ( wxCommandEvent& event ); void PropagateDBLink ( wxCommandEvent& event ); void ConvertSetType ( wxCommandEvent& event ); void ListMacroButtonNames ( wxCommandEvent& event ); void TestDialogView( wxCommandEvent& event ); void TestFormView( wxCommandEvent& event ); void MacroEditor( wxCommandEvent& event ); void AdjustForConsensusSpliceSites( wxCommandEvent& event ); void CombineSelectedGenesIntoPseudogenes( wxCommandEvent& evt ); void GeneFromOtherFeat( wxCommandEvent& evt ); void LatLonTool ( wxCommandEvent& event ); void CDSGeneRangeErrorSuppress( wxCommandEvent& event ); void CDSGeneRangeErrorRestore( wxCommandEvent& event ); void RemoveSegGaps( wxCommandEvent& event ); void RawSeqToDeltaByNs( wxCommandEvent& event ); void RmCultureNotes( wxCommandEvent& event ); // for shared functions void DoExtendedCleanup(); protected: void x_OnSelectionEvent(CEvent*); private: // CDiscRepDlgVw *m_discrep_dlg, *m_mega_dlg, *m_oncaller_dlg; ICommandProccessor* m_CmdProccessor; CSeq_entry_Handle m_TopSeqEntry; CConstRef<objects::CSeq_submit> m_SeqSubmit; IWorkbench* m_Workbench; TConstScopedObjects m_SelObjects; vector<CRef<CSeq_loc> > m_CachedSelectedLocations; bool m_attached; map<CRef<CSeq_loc>,bool> m_CachedLocationIsAa; void x_SetUpTSEandUnDoManager(IWorkbench* wb); vector<CRef<CSeq_loc> > &x_GetSelectedLocations(); void x_CacheSelectedLocations(); void x_HandleBulkCmdDlg (CBulkCmdDlg& dlg); bool x_IsLocationOkForFeatCmd(int cmd, CRef<CSeq_loc> loc); void x_TableReaderCommon(CIRef<IObjectLoader> object_loader, CQualTableLoadManager& qual_mgr, const wxString& msg); }; wxEvtHandler* CSeqEditPackage::GetEventHandler() { return new CSequenceEditingEventHandler(m_Workbench); } CSequenceEditingEventHandler::CSequenceEditingEventHandler(IWorkbench* wb) { m_TopSeqEntry.Reset(); m_CmdProccessor = NULL; m_Workbench = wb; m_attached = false; // m_discrep_dlg = m_mega_dlg = m_oncaller_dlg = NULL; } CSequenceEditingEventHandler::~CSequenceEditingEventHandler() { if (m_Workbench && m_attached) { CSelectionService* service = m_Workbench->GetServiceByType<CSelectionService>(); if (service) { service->RemoveListener(this); m_attached = false; } } } void CSequenceEditingEventHandler::x_OnSelectionEvent(CEvent*) { CSelectionService* service = m_Workbench->GetServiceByType<CSelectionService>(); if (service) { m_SelObjects.clear(); service->GetActiveObjects(m_SelObjects); x_CacheSelectedLocations(); } } void CSequenceEditingEventHandler::x_SetUpTSEandUnDoManager(IWorkbench* wb) { m_TopSeqEntry.Reset(); m_SeqSubmit.Reset(NULL); m_CmdProccessor = NULL; if (!wb) return; if (!m_attached) { CSelectionService* service = wb->GetServiceByType<CSelectionService>(); if (service) { service->AddListener(this); m_SelObjects.clear(); service->GetActiveObjects(m_SelObjects); x_CacheSelectedLocations(); m_attached = true; } } TConstScopedObjects &objects = m_SelObjects; if (objects.empty()) return; NON_CONST_ITERATE (TConstScopedObjects, it, objects) { const CSeq_submit* sub = dynamic_cast<const CSeq_submit*>((*it).object.GetPointer()); if (sub) { m_SeqSubmit.Reset(sub); } if (!m_TopSeqEntry) { CSeq_entry_Handle seh = GetTopSeqEntryFromScopedObject(*it); if (seh) { m_TopSeqEntry = seh; if (m_SeqSubmit) { break; } } } } if (!m_TopSeqEntry) return; CIRef<CProjectService> srv = wb->GetServiceByType<CProjectService>(); if (srv) { CRef<CGBWorkspace> ws = srv->GetGBWorkspace(); if (!ws) return; CGBDocument* doc = dynamic_cast<CGBDocument*>(ws->GetProjectFromScope(m_TopSeqEntry.GetScope())); if (doc) m_CmdProccessor = &doc->GetUndoManager(); } } vector<CRef<CSeq_loc> >& CSequenceEditingEventHandler::x_GetSelectedLocations() { return m_CachedSelectedLocations; } void CSequenceEditingEventHandler::x_CacheSelectedLocations() { m_CachedSelectedLocations.clear(); m_CachedLocationIsAa.clear(); if (!m_Workbench) { return; } TConstScopedObjects &objects = m_SelObjects; if (objects.empty()) return; NON_CONST_ITERATE (TConstScopedObjects, it, objects) { const CObject* ptr = it->object.GetPointer(); /// CSeq_entry const objects::CSeq_feat* seqfeat = dynamic_cast<const objects::CSeq_feat*>(ptr); const objects::CSeq_loc* seqloc = dynamic_cast<const objects::CSeq_loc*>(ptr); const objects::CBioseq* bioseq = dynamic_cast<const objects::CBioseq*>(ptr); const objects::CSeqdesc* seqdesc = dynamic_cast<const objects::CSeqdesc*>(ptr); const objects::CPubdesc* pubdesc = dynamic_cast<const objects::CPubdesc*>(ptr); // Seq-annot, Bioseq-set const objects::CSeq_annot* annot = dynamic_cast<const objects::CSeq_annot*>(ptr); const objects::CBioseq_set* bioseqset = dynamic_cast<const objects::CBioseq_set*>(ptr); if (seqfeat) { if (seqfeat->IsSetLocation()) { CRef<CSeq_loc> loc(new CSeq_loc()); loc->Assign(seqfeat->GetLocation()); m_CachedSelectedLocations.push_back(loc); } } else if (seqloc) { if (seqloc->IsWhole()) { CRef<CSeq_id> new_id(new CSeq_id()); new_id->Assign(seqloc->GetWhole()); CBioseq_Handle bsh = it->scope->GetBioseqHandle(*new_id); if (bsh) { CRef<CSeq_loc> loc(new CSeq_loc(*new_id, 0, bsh.GetInst_Length() - 1)); m_CachedSelectedLocations.push_back(loc); } } else { CRef<CSeq_loc> loc(new CSeq_loc()); loc->Assign(*seqloc); m_CachedSelectedLocations.push_back(loc); } } else if (bioseq) { CRef<CSeq_loc> loc(new CSeq_loc()); loc->SetInt().SetId().Assign(*(bioseq->GetId().front())); loc->SetInt().SetFrom(0); loc->SetInt().SetTo(bioseq->GetLength() - 1); m_CachedSelectedLocations.push_back(loc); } else if (seqdesc) { CSeq_entry_Handle seh = edit::GetSeqEntryForSeqdesc(it->scope, *seqdesc); CBioseq_CI bi(seh); while (bi) { CRef<CSeq_loc> loc(new CSeq_loc()); loc->SetInt().SetId().Assign(*(bi->GetId().front().GetSeqId())); loc->SetInt().SetFrom(0); loc->SetInt().SetTo(bi->GetInst_Length() - 1); m_CachedSelectedLocations.push_back(loc); ++bi; } } else if (pubdesc) { CSeq_entry_Handle seh = GetSeqEntryForPubdesc(it->scope, *pubdesc); CBioseq_CI bi(seh); while (bi) { CRef<CSeq_loc> loc(new CSeq_loc()); loc->SetInt().SetId().Assign(*(bi->GetId().front().GetSeqId())); loc->SetInt().SetFrom(0); loc->SetInt().SetTo(bi->GetInst_Length() - 1); m_CachedSelectedLocations.push_back(loc); ++bi; } } else if (annot) { if (annot->IsSetData() && annot->GetData().IsFtable() && !annot->GetData().GetFtable().empty() && annot->GetData().GetFtable().front()->IsSetLocation()) { CRef<CSeq_loc> loc(new CSeq_loc()); loc->Assign(annot->GetData().GetFtable().front()->GetLocation()); m_CachedSelectedLocations.push_back(loc); } } else if (bioseqset) { if (bioseqset->IsSetClass() && bioseqset->GetClass() == CBioseq_set::eClass_nuc_prot) { const CBioseq& bseq = bioseqset->GetNucFromNucProtSet(); CRef<CSeq_loc> loc(new CSeq_loc()); loc->SetInt().SetId().Assign(*(bseq.GetId().front())); loc->SetInt().SetFrom(0); loc->SetInt().SetTo(bseq.GetLength() - 1); m_CachedSelectedLocations.push_back(loc); } else { CSeq_entry* seq = bioseqset->GetParentEntry(); if (seq) { m_CachedSelectedLocations.clear(); } } } } if (!m_TopSeqEntry && !m_CachedSelectedLocations.empty()) { CBioseq_Handle bsh = objects.front().scope->GetBioseqHandle(*(m_CachedSelectedLocations.front()->GetId())); m_TopSeqEntry = bsh.GetTopLevelEntry(); } if (m_TopSeqEntry) { CScope& scope = m_TopSeqEntry.GetScope(); ITERATE(vector<CRef<CSeq_loc> >, lit, m_CachedSelectedLocations) { CBioseq_Handle bsh = scope.GetBioseqHandle(**lit); if (bsh && bsh.IsAa()) m_CachedLocationIsAa[*lit] = true; } } } void CSequenceEditingEventHandler::IsObjectSelected(wxUpdateUIEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); event.Enable(m_TopSeqEntry && m_CmdProccessor); } void CSequenceEditingEventHandler::IsLocationSelected(wxUpdateUIEvent& evt) { vector<CRef<CSeq_loc> >& locs = x_GetSelectedLocations(); bool rval = false; ITERATE(vector<CRef<CSeq_loc> >, lit, locs) { if (x_IsLocationOkForFeatCmd(evt.GetId(), *lit)) { rval = true; break; } } evt.Enable(rval); } // Implementation enum ESequenceEditingCommands { eCmdRemoveDescriptors = eBaseCmdLast + 1000, eCmdRemoveFeatures, eCmdApplyIndexerComments, eCmdRemoveSeqAnnotIds, eCmdRemoveCddFeatDbxref, eCmdRemoveBankitComment, eCmdRemoveUnverified, eCmdRemoveDuplicateStructuredComments, eCmdRemoveSequencesFromAlignments, eCmdRemoveSequences, eCmdRevCompSequences, eCmdBioseqFeatsRevComp, eCmdUnculTaxTool, eCmdEditSequence, eCmdRemoveAlignments, eCmdRemoveGraphs, eCmdRemoveGenomeProjectId, eCmdRemoveEmptyGenomeProjectId, eCmdTaxFixCleanup, eCmdExtendedCleanup, eCmdDisableStrainForwarding, eCmdEditPubs, eCmdGlobalAuthorReplace, eCmdFixCapitalizationAll, eCmdFixCapitalizationAuthors, eCmdFixCapitalizationTitles, eCmdFixCapitalizationAffiliation, eCmdFixCapitalizationCountry, eCmdRemoveUnpublishedPublications, eCmdRemovePublishedPublications, eCmdRemoveCollidingPublications, eCmdRemoveAllPublications, eCmdRemoveAuthorConsortiums, eCmdReverseAuthorNames, eCmdStripAuthorSuffixes, eCmdTruncateAuthorMiddleInitials, eCmdConvertAuthorToConstortiumWhereLastName, eCmdConvertAuthorToConsortiumAll, eCmdAddCitSubForUpdate, eCmdFixUsaAndStates, eCmdRetranslateCDSObeyStop, eCmdRetranslateCDSIgnoreStopExceptEnd, eCmdRetranslateCDSChooseFrame, eCmdResynchronizePartialsCDS, eCmdAddTranslExcept, eCmdRemoveAllStructuredComments, eCmdRemoveEmptyStructuredComments, eCmdModifyStructuredComment, eCmdRemoveStructuredCommentKeyword, eCmdAddStructuredCommentKeyword, eCmdAddGenomeAssemblyStructuredComment, eCmdReorderStructuredComment, eCmdConvertComment, eCmdParseComment, eCmdLowercaseQuals, eCmdAssignFeatureIds, eCmdClearFeatureIds, eCmdReassignFeatureIds, eCmdUniqifyFeatureIds, eCmdTrimJunkInPrimerSeqs, eCmdFixiInPrimerSeqs, eCmdPrefixAuthWithTax, eCmdFocusSet, eCmdFocusClear, eCmdSetTransgSrcDesc, eCmdSplitDblinkQuals, eCmdFixOrgModInstitution, eCmdSwapPrimerSeqName, eCmdMergePrimerSets, eCmdSplitPrimerSets, eCmdAppendModToOrg, eCmdParseCollectionDateMonthFirst, eCmdParseCollectionDateDayFirst, eCmdCountryFixupCap, eCmdCountryFixupNoCap, eCmdVectorTrim, eCmdSelectTarget, eCmdApplyCDS, eCmdApplyAddRNA, eCmdApplyAddOther, eCmdValidate, eCmdValidateNoAlignments, eCmdValidateCheckInferences, eCmdSortUniqueCount, eCmdSortUniqueCountText, eCmdMegaReport, eCmdOnCallerTool, eCmdDiscReport, eCmdRemoveAllFeatures, eCmdAutodefDefaultOptions, eCmdAutodefOptions, eCmdAutodefMisc, eCmdAutodefId, eCmdAutodefNoMods, eCmdAutodefPopset, eCmdInstantiateProteinTitles, eCmdAddSequences, eCmdApplySourceQual, eCmdEditSourceQual, eCmdConvertSourceQual, eCmdSwapSourceQual, eCmdRemoveSourceQual, eCmdApplyRNAQual, eCmdEditRNAQual, eCmdConvertRNAQual, eCmdSwapRNAQual, eCmdRemoveRNAQual, eCmdApplyCGPQual, eCmdEditCGPQual, eCmdConvertCGPQual, eCmdSwapCGPQual, eCmdRemoveCGPQual, eCmdApplyFeatQual, eCmdEditFeatQual, eCmdConvertFeatQual, eCmdSwapFeatQual, eCmdRemoveFeatQual, eCmdRemoveTextOutsideString, eCmdEditFeatEv, eCmdEditFeatLoc, eCmdEditFeatStrand, eCmdEditFeatRevInt, eCmdExtendPartialsConstr, eCmdExtendPartialsAll, eCmdGeneFromOtherFeat, eCmdParseText, eCmdParseTextFromDefline, eCmdParseLocalToSrc, eCmdConvertFeatures, eCmdConvertCdsToMiscFeat, eCmdConvertCdsWithInternalStopToMiscFeat, eCmdConvertCdsWithInternalStopToMiscFeatViral, eCmdConvertCdsWithInternalStopToMiscFeatUnverified, eCmdTableReader, eCmdTableReaderClipboard, eCmdMolInfoEdit, eCmdExportTable, eCmdBulkSourceEdit, eCmdBulkCdsEdit, eCmdLatLonTool, eCmdCDSGeneRangeErrorSuppress, eCmdCDSGeneRangeErrorRestore, eCmdBulkGeneEdit, eCmdBulkRnaEdit, eCmdCorrectGenes, eCmdSegregateSets, eCmdSequesterSets, eCmdCombineSelectedGenesIntoPseudogenes, eCmdWithdrawSequences, eCmdAddSet, eCmdPropagateDBLink, eCmdChangeSetClass, eCmdParseStrainSerotypeFromNames, eCmdAddStrainSerotypeToNames, eCmdFixupOrganismNames, eCmdSplitQualifiersAtCommas, eCmdSplitStructuredCollections, eCmdTrimOrganismNames, eCmdAddNamedrRNA12S, eCmdAddNamedrRNA16S, eCmdAddNamedrRNA23S, eCmdAddNamedrRNA18S, eCmdAddNamedrRNA28S, eCmdAddNamedrRNA26S, eCmdAddNamedrRNASmall, eCmdAddNamedrRNALarge, eCmdAddControlRegion, eCmdAddMicrosatellite, eCmdAdd16S, eCmdAdd18S, eCmdAdd23S, eCmdAddDefLine, eCmdRemoveDefLines, eCmdPrefixOrgToDefLine, eCmdPrefixStrainToDefLine, eCmdPrefixCloneToDefLine, eCmdPrefixIsolateToDefLine, eCmdPrefixHaplotToDefLine, eCmdPrefixCultivarToDefLine, eCmdPrefixListToDefLine, eCmdCreateDescTPAAssembly, eCmdCreateDescStructuredComment, eCmdCreateDescRefGeneTracking, eCmdCreateDescDBLink, eCmdCreateDescUnverified, eCmdCreateDescAuthorizedAccess, eCmdCreateDescGenomeAssemblyComment, eCmdCreateDescGenBankBlock, eCmdCreateDescComment, eCmdCreateDescTitle, eCmdCreateDescMolinfo, eCmdMakeBadSpecificHostTable, eCmdCorrectRNAStrand, eCmdTrimNs, eCmdAddFluComments, eCmdLabelRna, eCmdRemProtTitles, eCmdApplyRNA_ITS, eCmdListMacroButtonNames, eCmdMacroEditor, eCmdAdjustConsensusSpliceSitesStrict, eCmdAdjustConsensusSpliceSitesRelaxed, eCmdRemoveSegGaps, eCmdRawSeqToDeltaByNs, eCmdRmCultureNotes, eCmdCreateDescSource, // Most of the new stuff can be added above, unless it expects a non-TSE type selection eCmdCreateDescPub, eCmdCreateFeatureGene, // NOTE: This section of commands is covered by the update range for IsLocationSelected. eCmdCreateFeatureLTR, // Add new commands for bulk editing before this section eCmdCreateStemLoop, eCmdCreateSTS, eCmdCreateCodingRegion, eCmdCreateRepeatRegion, eCmdCreateVariation, eCmdCreateOperon, eCmdCreateMobileElement, eCmdCreateCentromere, eCmdCreateTelomere, eCmdCreatePreRNA, eCmdCreateMRNA, eCmdCreateExon, eCmdCreateIntron, eCmdCreate3UTR, eCmdCreate5UTR, eCmdCreatetRNA, eCmdCreaterRNA, eCmdCreateRNA, eCmdCreatencRNA, eCmdCreatetmRNA, eCmdCreatePolyASite, eCmdCreatePrimerBind, eCmdCreateProteinBind, eCmdCreateRepOrigin, eCmdCreateOriT, eCmdCreateCRegion, eCmdCreateDLoop, eCmdCreateDSegment, eCmdCreateiDNA, eCmdCreateJSegment, eCmdCreateMiscBinding, eCmdCreateMiscDifference, eCmdCreateMiscFeature, eCmdCreateMiscRecomb, eCmdCreateMiscStructure, eCmdCreateModifiedBase, eCmdCreateNRegion, eCmdCreatePrimTranscript, eCmdCreateRegulatory, eCmdCreateSRegion, eCmdCreateSatellite, eCmdCreateUnsure, eCmdCreateVRegion, eCmdCreateVSegment, eCmdCreateAssemblyGap, eCmdCreateFeatureProt, // Start of protein-location only feature commands eCmdCreateProprotein, eCmdCreateMatPeptide, eCmdCreateSigPeptide, eCmdCreateTransitPeptide, eCmdCreateSecondaryStructure, eCmdCreateBond, eCmdCreateRegion, // Start of nucleotide or protein location feature commands eCmdCreatePubFeat, eCmdCreateSite, // DO NOT ADD ANYTHING BELOW UNLESS YOU REALLY UNDERSTAND WHAT UPDATE_UI_RANGE YOUR COMMAND WILL FALL INTO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! eCmdEditingButtons, // This can be shown regardless of selection - buttons do their own selection search eCmdMakeToolBarWindow, eCmdTestDialogView, eCmdTestFormView }; static const ESequenceEditingCommands kStartNucOnly = eCmdCreateFeatureGene; static const ESequenceEditingCommands kEndNucOnly = eCmdCreateAssemblyGap; static const ESequenceEditingCommands kStartProtOnly = eCmdCreateFeatureProt; static const ESequenceEditingCommands kEndProtOnly = eCmdCreateBond; static const ESequenceEditingCommands kStartAnyLoc = eCmdCreateRegion; static const ESequenceEditingCommands kEndAnyLoc = eCmdCreateSite; typedef struct featcmd { ESequenceEditingCommands cmd; CSeqFeatData::ESubtype subtype; } FeatCmd; static const FeatCmd feat_cmds[] = { { eCmdCreateFeatureGene, CSeqFeatData::eSubtype_gene } , { eCmdCreateCodingRegion, CSeqFeatData::eSubtype_cdregion }, { eCmdCreateFeatureProt, CSeqFeatData::eSubtype_prot }, { eCmdCreateFeatureLTR, CSeqFeatData::eSubtype_LTR }, { eCmdCreateRepeatRegion, CSeqFeatData::eSubtype_repeat_region }, { eCmdCreateStemLoop, CSeqFeatData::eSubtype_stem_loop }, { eCmdCreateSTS, CSeqFeatData::eSubtype_STS }, { eCmdCreateRegion, CSeqFeatData::eSubtype_region }, { eCmdCreatePubFeat, CSeqFeatData::eSubtype_pub }, { eCmdCreateSecondaryStructure, CSeqFeatData::eSubtype_psec_str }, { eCmdCreateProprotein, CSeqFeatData::eSubtype_preprotein }, { eCmdCreateMatPeptide, CSeqFeatData::eSubtype_mat_peptide_aa }, { eCmdCreateSigPeptide, CSeqFeatData::eSubtype_sig_peptide_aa }, { eCmdCreateTransitPeptide, CSeqFeatData::eSubtype_transit_peptide_aa }, { eCmdCreateOperon, CSeqFeatData::eSubtype_operon }, { eCmdCreateMobileElement, CSeqFeatData::eSubtype_mobile_element }, { eCmdCreateCentromere, CSeqFeatData::eSubtype_centromere }, { eCmdCreateTelomere, CSeqFeatData::eSubtype_telomere }, { eCmdCreatePreRNA, CSeqFeatData::eSubtype_preRNA }, { eCmdCreateMRNA, CSeqFeatData::eSubtype_mRNA }, { eCmdCreateExon, CSeqFeatData::eSubtype_exon }, { eCmdCreateIntron, CSeqFeatData::eSubtype_intron }, { eCmdCreate3UTR, CSeqFeatData::eSubtype_3UTR }, { eCmdCreate5UTR, CSeqFeatData::eSubtype_5UTR }, { eCmdCreatetRNA, CSeqFeatData::eSubtype_tRNA }, { eCmdCreaterRNA, CSeqFeatData::eSubtype_rRNA }, { eCmdCreateRNA, CSeqFeatData::eSubtype_misc_RNA }, { eCmdCreatencRNA, CSeqFeatData::eSubtype_ncRNA }, { eCmdCreatetmRNA, CSeqFeatData::eSubtype_tmRNA }, { eCmdCreatePolyASite, CSeqFeatData::eSubtype_polyA_site }, { eCmdCreatePrimerBind, CSeqFeatData::eSubtype_primer_bind } , { eCmdCreateProteinBind, CSeqFeatData::eSubtype_protein_bind }, { eCmdCreateRepOrigin, CSeqFeatData::eSubtype_rep_origin }, { eCmdCreateBond, CSeqFeatData::eSubtype_bond }, { eCmdCreateSite, CSeqFeatData::eSubtype_site }, { eCmdCreateOriT, CSeqFeatData::eSubtype_oriT }, { eCmdCreateCRegion, CSeqFeatData::eSubtype_C_region }, { eCmdCreateDLoop, CSeqFeatData::eSubtype_D_loop }, { eCmdCreateDSegment, CSeqFeatData::eSubtype_D_segment }, { eCmdCreateiDNA, CSeqFeatData::eSubtype_iDNA }, { eCmdCreateJSegment, CSeqFeatData::eSubtype_J_segment }, { eCmdCreateMiscBinding, CSeqFeatData::eSubtype_misc_binding }, { eCmdCreateMiscDifference, CSeqFeatData::eSubtype_misc_difference }, { eCmdCreateMiscFeature, CSeqFeatData::eSubtype_misc_feature }, { eCmdCreateMiscRecomb, CSeqFeatData::eSubtype_misc_recomb }, { eCmdCreateMiscStructure, CSeqFeatData::eSubtype_misc_structure }, { eCmdCreateModifiedBase, CSeqFeatData::eSubtype_modified_base }, { eCmdCreateNRegion, CSeqFeatData::eSubtype_N_region } , { eCmdCreatePrimTranscript, CSeqFeatData::eSubtype_prim_transcript }, { eCmdCreateRegulatory, CSeqFeatData::eSubtype_regulatory }, { eCmdCreateSRegion, CSeqFeatData::eSubtype_S_region }, { eCmdCreateSatellite, CSeqFeatData::eSubtype_satellite }, { eCmdCreateUnsure, CSeqFeatData::eSubtype_unsure }, { eCmdCreateVRegion, CSeqFeatData::eSubtype_V_region }, { eCmdCreateVSegment, CSeqFeatData::eSubtype_V_segment }, { eCmdCreateVariation, CSeqFeatData::eSubtype_variation }, { eCmdCreateAssemblyGap, CSeqFeatData::eSubtype_assembly_gap }, }; static const int num_feat_cmds = sizeof (feat_cmds) / sizeof (FeatCmd); static CSeqFeatData::ESubtype GetKeyFromCmdID (int cmd_id) { for (int i = 0; i < num_feat_cmds; i++) { if (feat_cmds[i].cmd == cmd_id) { return feat_cmds[i].subtype; } } return CSeqFeatData::eSubtype_bad; } vector<CUICommand*> CSeqEditPackage::GetCommands() { vector<CUICommand*> commands; commands.push_back(new CUICommand(eCmdRemoveDescriptors, "Remove Descriptors", "Remove Descriptors from Selected Object", "RDSO")); commands.push_back(new CUICommand(eCmdRemoveFeatures, "Remove Features", "Remove Features from Selected Object", "RFSO")); commands.push_back(new CUICommand(eCmdApplyIndexerComments, "Apply Indexer Comments", "Apply Indexer Comments", "AICS")); commands.push_back(new CUICommand(eCmdRemoveSeqAnnotIds, "Remove Seq-annot IDs", "Remove Seq-annot IDs from Selected Object", "RSAID")); commands.push_back(new CUICommand(eCmdRemoveCddFeatDbxref, "Remove All CDD Features and DBxrefs", "Remove All CDD Features and Dbxrefs", "RACFAD")); commands.push_back(new CUICommand(eCmdRemoveBankitComment, "Remove Bankit Comments", "Remove Bankit Comments from Selected Object", "RBC")); commands.push_back(new CUICommand(eCmdRemoveDuplicateStructuredComments, "Remove Duplicate Structured Comments", "Remove Duplicate Structured Comments from Selected Object", "RDSC")); commands.push_back(new CUICommand(eCmdRemoveSequencesFromAlignments, "Remove Sequences From Alignments", "Remove Sequences From Alignments from Selected Object", "RSFASO")); commands.push_back(new CUICommand(eCmdRemoveSequences, "Remove Sequences From Record", "Remove Sequences from Selected Object", "RSSO")); commands.push_back(new CUICommand(eCmdRevCompSequences, "Bioseq RevComp by ID", "Reverse Complement Sequences from Selected Object", "RVCS")); commands.push_back(new CUICommand(eCmdBioseqFeatsRevComp, "BioseqFeatsRevComp", "Reverse Complement Sequences and Features", "RVCSF")); commands.push_back(new CUICommand(eCmdUnculTaxTool,"Uncul Tax Tool", "Uncul Tax Tool", "UCTT")); commands.push_back(new CUICommand(eCmdEditSequence, "Edit Sequence", "Edit Sequence", "EDSEQ")); commands.push_back(new CUICommand(eCmdRemoveAlignments, "Remove Alignments", "Remove Alignments from Selected Object", "RASO")); commands.push_back(new CUICommand(eCmdRemoveGraphs, "Remove Graphs", "Remove Graphs from Selected Object", "RGSO")); commands.push_back(new CUICommand(eCmdRemoveGenomeProjectId, "Remove All Genome Project Ids", "Remove All Genome Project Ids from Selected Object", "RGPIDSO")); commands.push_back(new CUICommand(eCmdRemoveEmptyGenomeProjectId, "Remove Empty Genome Project Ids", "Remove Empty Genome Project Ids from Selected Object", "REGPIDSO")); commands.push_back(new CUICommand(eCmdTaxFixCleanup, "Tax_fix/Cleanup", "Fix Taxonomy and Perform Basic and Extended Cleanup", "TFCU")); commands.push_back(new CUICommand(eCmdExtendedCleanup, "SeriousSeqEntryCleanup", "Perform Basic and Extended Cleanup", "SSEC")); commands.push_back(new CUICommand(eCmdDisableStrainForwarding, "Globally Disable Strain Forwarding", "Globally Disable Strain Forwarding", "GDSF")); commands.push_back(new CUICommand(eCmdEditPubs, "Edit Publications", "Edit Publications", "EP")); commands.push_back(new CUICommand(eCmdGlobalAuthorReplace, "Global Author Replace", "Global Author Replace", "GAR")); commands.push_back(new CUICommand(eCmdFixCapitalizationAll, "Fix All Capitalization", "Fix All Capitalization for Selected Object", "FACSO")); commands.push_back(new CUICommand(eCmdFixCapitalizationAuthors, "Fix Capitalization in Authors", "Fix Capitalization in Authors for Selected Object", "FCASO")); commands.push_back(new CUICommand(eCmdFixCapitalizationTitles, "Fix Capitalization in Titles", "Fix Capitalization in Titles for Selected Object", "FCTSO")); commands.push_back(new CUICommand(eCmdFixCapitalizationAffiliation, "Fix Capitalization in Affiliations", "Fix Capitalization in Affiliations for Selected Object", "FCAfSO")); commands.push_back(new CUICommand(eCmdFixCapitalizationCountry, "Fix Capitalization in Countries", "Fix Capitalization in Countries for Selected Object", "FCCSO")); commands.push_back(new CUICommand(eCmdRemoveUnpublishedPublications, "Remove Unpublished Publications", "Remove Unpublished Publications from Selected Object", "RUPSO")); commands.push_back(new CUICommand(eCmdRemovePublishedPublications, "Remove Published Publications", "Remove Published Publications from Selected Object", "RPPSO")); commands.push_back(new CUICommand(eCmdRemoveCollidingPublications, "Remove Colliding Publications", "Remove Colliding Publications from Selected Object", "RCPSO")); commands.push_back(new CUICommand(eCmdRemoveAllPublications, "Remove All Publications", "Remove All Publications from Selected Object", "RAPSO")); commands.push_back(new CUICommand(eCmdRemoveAuthorConsortiums, "Remove Author Consortiums", "Remove Author Consortiums from Selected Object", "RACSO")); commands.push_back(new CUICommand(eCmdReverseAuthorNames, "Reverse Author Names", "Reverse Author Names for Selected Object", "RANSO")); commands.push_back(new CUICommand(eCmdStripAuthorSuffixes, "Strip Author Suffixes", "Strip Author Suffixes from Selected Object", "SASSO")); commands.push_back(new CUICommand(eCmdTruncateAuthorMiddleInitials, "Truncate Author Middle Initials", "Truncate Author Middle Initials from Selected Object", "TAMISO")); commands.push_back(new CUICommand(eCmdConvertAuthorToConstortiumWhereLastName, "Convert Author To Consortium Where Last Name Contains consortium", "Convert Author To Consortium Where Last Name Contains consortium for Selected Object", "CATCWLSO")); commands.push_back(new CUICommand(eCmdConvertAuthorToConsortiumAll, "Convert All Authors To Consortium", "Convert All Authors To Consortium for Selected Object", "CAATCSO")); commands.push_back(new CUICommand(eCmdAddCitSubForUpdate, "Add Cit-sub for Update", "Add Cit-sub For Update for Selected Object", "ACSFUSO")); commands.push_back(new CUICommand(eCmdFixUsaAndStates, "Fix USA and States", "Fix USA and States for Selected Object", "FUSSO")); commands.push_back(new CUICommand(eCmdRetranslateCDSObeyStop, "Obey Stop Codon", "Retranslate CDS, obey stop codon", "RCDSOSC")); commands.push_back(new CUICommand(eCmdRetranslateCDSIgnoreStopExceptEnd, "Ignore Stop Codon Except at End of Complete CDS", "Retranslate CDS, Ignore Stop Codon Except at End of Complete CDS", "RCDSISCEAE")); commands.push_back(new CUICommand(eCmdRetranslateCDSChooseFrame, "Choose Frame With No Stop Codon", "Retranslate CDS, Choose Frame With No Stop Codon", "RCDSCF")); commands.push_back(new CUICommand(eCmdResynchronizePartialsCDS, "Resynchronize CDS Partials", "Resynchronize CDS Partials", "RCDSP")); commands.push_back(new CUICommand(eCmdAddTranslExcept, "Add Transl Excepts with Comment", "Add Transl Excepts with Comment", "ATEWC")); commands.push_back(new CUICommand(eCmdRemoveAllStructuredComments,"Remove All Structured Comments","Remove All Structured Comments from Selected Object","RASCSO")); commands.push_back(new CUICommand(eCmdRemoveEmptyStructuredComments,"Remove Empty Structured Comments","Remove Empty Structured Comments from Selected Object","RESCSO")); commands.push_back(new CUICommand(eCmdModifyStructuredComment,"Remove Structured Comment Field","Remove Structured Comment Field from Selected Object","RSCFSO")); commands.push_back(new CUICommand(eCmdRemoveStructuredCommentKeyword,"Remove Structured Comment Keyword","Remove Structured Comment Keyword from Selected Object","RSCKSO")); commands.push_back(new CUICommand(eCmdAddStructuredCommentKeyword ,"Add Structured Comment Keyword","Add Structured Comment Keyword to Selected Object","ASCKSO")); commands.push_back(new CUICommand(eCmdAddGenomeAssemblyStructuredComment, "Add Genome Assembly Structured Comment", "Add Genome Assembly Structured Comment", "AGASC")); commands.push_back(new CUICommand(eCmdReorderStructuredComment,"Reorder Structured Comment","Reorder Structured Comment in Selected Object","RSCSO")); commands.push_back(new CUICommand(eCmdConvertComment,"Convert Structured Comment","Convert Structured Comment in Selected Object","CSCSO")); commands.push_back(new CUICommand(eCmdParseComment,"Parse Structured Comment","Parse Structured Comment in Selected Object","PSCSO")); commands.push_back(new CUICommand(eCmdAssignFeatureIds,"Assign Feature IDs", "Assign Feature IDs for Selected Object","AFIDSO")); commands.push_back(new CUICommand(eCmdClearFeatureIds,"Clear Feature IDs", "Clear Feature IDs for Selected Object","CFIDSO")); commands.push_back(new CUICommand(eCmdReassignFeatureIds,"Reassign Feature IDs", "Reassign Feature IDs for Selected Object","RFIDSO")); commands.push_back(new CUICommand(eCmdUniqifyFeatureIds,"Uniqify Feature IDs", "Uniqify Feature IDs for Selected Object","UFIDSO")); commands.push_back(new CUICommand(eCmdTrimJunkInPrimerSeqs,"Trim Junk In Primer Seqs","Trim Junk In Primer Seqs for Selected Object","TJIPSSO")); commands.push_back(new CUICommand(eCmdFixiInPrimerSeqs,"Fix i in Primer Seqs","Fix i in Primer Seqs for Selected Object","FIIPSSO")); commands.push_back(new CUICommand(eCmdPrefixAuthWithTax, "Prefix Authority With Organism", "Prefix Authority with Organism", "PAWO")); commands.push_back(new CUICommand(eCmdFocusSet, "Set", "BioSource is_focus is set", "SFSET")); commands.push_back(new CUICommand(eCmdFocusClear, "Clear", "BioSource is_focus is clear", "SFCLE")); commands.push_back(new CUICommand(eCmdSetTransgSrcDesc, "Set Transgenic on Source Desc", "Set Transgenic on Source Desc when Source Feat present", "STOSD")); commands.push_back(new CUICommand(eCmdSplitDblinkQuals, "Split DBLink Quals at Commas", "Split DBLink Quals at Commas", "SDQAC")); commands.push_back(new CUICommand(eCmdFixOrgModInstitution,"Fix OrgMod Institution Code","Fix OrgMod Institution Code for Selected Object","FOMICSO")); commands.push_back(new CUICommand(eCmdSwapPrimerSeqName,"Swap Primer Seq and Name","Swap Primer Seq and Name for Selected Object","SPSNSO")); commands.push_back(new CUICommand(eCmdMergePrimerSets,"Merge Primer Sets","Merge Primer Sets for Selected Object","MPSSO")); commands.push_back(new CUICommand(eCmdSplitPrimerSets,"Split Primer Sets by Position","Split Primer Sets by Position for Selected Object","SPSBPSO")); commands.push_back(new CUICommand(eCmdAppendModToOrg,"Append Mod To Org","Append Mod To Org for Selected Object","AMTOSO")); commands.push_back(new CUICommand(eCmdParseCollectionDateMonthFirst,"Parse Collection Date Month First","Parse Collection Date Month First for Selected Object","PCDMFSO")); commands.push_back(new CUICommand(eCmdParseCollectionDateDayFirst,"Parse Collection Date Day First","Parse Collection Date Day First for Selected Object","PCDDFSO")); commands.push_back(new CUICommand(eCmdCountryFixupCap,"Country Fixup Fix Capitalization After Colon","Country Fixup Fix Capitalization After Colon","CFFCAC")); commands.push_back(new CUICommand(eCmdCountryFixupNoCap,"Country Fixup Do Not Fix Capitalization After Colon","Country Fixup Do Not Fix Capitalization After Colon","CFDNFCAC")); commands.push_back(new CUICommand(eCmdVectorTrim, "Vector Search and Trim Tool", "Vector Search and Trim Tool", "VSTT")); commands.push_back(new CUICommand(eCmdSelectTarget, "Select Target", "Select Target", "ST")); commands.push_back(new CUICommand(eCmdApplyCDS, "Add CDS", "Add CDS", "AC")); commands.push_back(new CUICommand(eCmdApplyAddRNA, "Add RNA", "Add RNA", "AR")); commands.push_back(new CUICommand(eCmdApplyAddOther, "Add other Feature", "Add other Feature", "AOF")); commands.push_back(new CUICommand(eCmdValidate, "Validate", "Validate", "V")); commands.push_back(new CUICommand(eCmdValidateNoAlignments, "Validate no Alignments", "Validate no Alignments", "VNA")); commands.push_back(new CUICommand(eCmdValidateCheckInferences, "Validate Check Inferences", "Validate Check Inferences", "VCI")); commands.push_back(new CUICommand(eCmdSortUniqueCount, "cSUC", "Clickable Sort Unique Count", "SUC")); commands.push_back(new CUICommand(eCmdSortUniqueCountText, "SUC", "Sort Unique Count", "SUC")); commands.push_back(new CUICommand(eCmdMegaReport, "Mega Report", "Mega Report", "MR")); commands.push_back(new CUICommand(eCmdOnCallerTool, "On-Caller Tool", "On-Caller Tool", "OCT")); commands.push_back(new CUICommand(eCmdDiscReport, "Discrepancy Report", "Discrepancy Report", "DR")); commands.push_back(new CUICommand(eCmdAutodefDefaultOptions, "Autodef", "Autodef Default Options", "ADO")); commands.push_back(new CUICommand(eCmdAutodefOptions, "Autodef Select Options", "Autodef Select Options", "ADSO")); commands.push_back(new CUICommand(eCmdAutodefMisc, "Autodef Misc Feats", "Autodef Misc Feats", "ADMF")); commands.push_back(new CUICommand(eCmdAutodefId, "Autodef ID", "Autodef ID", "ADID")); commands.push_back(new CUICommand(eCmdAutodefNoMods, "Autodef No Modifiers", "Autodef No Modifiers", "ADNM")); commands.push_back(new CUICommand(eCmdAutodefPopset, "Add Popset Titles", "Add Popset Titles", "ADPT")); commands.push_back(new CUICommand(eCmdInstantiateProteinTitles, "PT_Cleanup", "PT_Cleanup Protein Titles", "PTCU")); commands.push_back(new CUICommand(eCmdRemoveAllFeatures, "Remove All Features", "Remove All Features", "RAF")); commands.push_back(new CUICommand(eCmdAddSequences, "Add Sequences", "Add Sequences", "AS")); commands.push_back(new CUICommand(eCmdApplySourceQual, "Apply Source Qual", "Apply Source Qual", "ASQ")); commands.push_back(new CUICommand(eCmdEditSourceQual, "Edit Source Qual", "Edit Source Qual", "ESQ")); commands.push_back(new CUICommand(eCmdConvertSourceQual, "Convert Source Qual", "Convert Source Qual", "CSQ")); commands.push_back(new CUICommand(eCmdSwapSourceQual, "Swap Source Qual", "Swap Source Qual", "SSQ")); commands.push_back(new CUICommand(eCmdRemoveSourceQual, "Remove Source Qual", "Remove Source Qual", "RSQ")); commands.push_back(new CUICommand(eCmdApplyRNAQual, "Apply RNA Qual", "Apply RNA Qual", "ARQ")); commands.push_back(new CUICommand(eCmdEditRNAQual, "Edit RNA Qual", "Edit RNA Qual", "ERQ")); commands.push_back(new CUICommand(eCmdConvertRNAQual, "Convert RNA Qual", "Convert RNA Qual", "CRQ")); commands.push_back(new CUICommand(eCmdSwapRNAQual, "Swap RNA Qual", "Swap RNA Qual", "SRQ")); commands.push_back(new CUICommand(eCmdRemoveRNAQual, "Remove RNA Qual", "Remove RNA Qual", "RRQ")); commands.push_back(new CUICommand(eCmdApplyCGPQual, "Apply CDS-Gene-Prot-mRNA Qual", "Apply CDS-Gene-Prot-mRNA Qual", "ACGPQ")); commands.push_back(new CUICommand(eCmdEditCGPQual, "Edit CDS-Gene-Prot-mRNA Qual", "Edit CDS-Gene-Prot-mRNA Qual", "ECGPQ")); commands.push_back(new CUICommand(eCmdConvertCGPQual, "Convert CDS-Gene-Prot-mRNA Qual", "Convert CDS-Gene-Prot-mRNA Qual", "CCGPQ")); commands.push_back(new CUICommand(eCmdSwapCGPQual, "Swap CDS-Gene-Prot-mRNA Qual", "Swap CDS-Gene-Prot-mRNA Qual", "SCGPQ")); commands.push_back(new CUICommand(eCmdRemoveCGPQual, "Remove CDS-Gene-Prot-mRNA Qual", "Remove CDS-Gene-Prot-mRNA Qual", "RCGPQ")); commands.push_back(new CUICommand(eCmdApplyFeatQual, "Apply Feature Qual", "Apply Feature Qual", "AFQ")); commands.push_back(new CUICommand(eCmdEditFeatQual, "Edit Feature Qual", "Edit Feature Qual", "EFQ")); commands.push_back(new CUICommand(eCmdConvertFeatQual, "Convert Feature Qual", "Convert Feature Qual", "CFQ")); commands.push_back(new CUICommand(eCmdSwapFeatQual, "Swap Feature Qual", "Swap Feature Qual", "SFQ")); commands.push_back(new CUICommand(eCmdRemoveFeatQual, "Remove Feature Qual", "Remove Feature Qual", "RFQ")); commands.push_back(new CUICommand(eCmdRemoveTextOutsideString, "Remove Text Outside String", "Remove Text Outside String", "RTOS")); commands.push_back(new CUICommand(eCmdParseText, "Parse Text", "Parse Text", "PT")); commands.push_back(new CUICommand(eCmdParseTextFromDefline, "Parse Text", "Parse Text", "PTDL")); commands.push_back(new CUICommand(eCmdParseLocalToSrc, "Parse Local ID to Src", "Parse Local ID to Src", "PLIDTS")); commands.push_back(new CUICommand(eCmdLowercaseQuals, "Lowercase Qualifiers", "Lowercase Qualifiers", "LQ")); commands.push_back(new CUICommand(eCmdConvertFeatures, "Convert Features", "Convert Features", "CF")); commands.push_back(new CUICommand(eCmdConvertCdsToMiscFeat, "Convert CDS to Misc_feat or Pseudogene", "Convert CDS to Misc_feat or Pseudogene", "CCDSMF")); commands.push_back(new CUICommand(eCmdConvertCdsWithInternalStopToMiscFeat, "to Misc_feat", "Convert CDS with Internal Stop Codon to Misc_feat", "CCDSWIMF")); commands.push_back(new CUICommand(eCmdConvertCdsWithInternalStopToMiscFeatViral, "to Misc_feat (Viral)", "Convert CDS with Internal Stop Codon to Misc_feat (Viral)", "CCDSWIMFV")); commands.push_back(new CUICommand(eCmdConvertCdsWithInternalStopToMiscFeatUnverified, "to Misc_feat with Unverified Comment", "Convert CDS with Internal Stop Codon to Misc_feat with Unverified Comment", "CCDSWIMFU")); commands.push_back(new CUICommand(eCmdTableReader, "Table Reader", "Table Reader", "TR")); commands.push_back(new CUICommand(eCmdTableReaderClipboard, "Table Reader from Clipboard", "Table Reader from Clipboard", "TRFC")); commands.push_back(new CUICommand(eCmdBulkSourceEdit, "Bulk Source Edit", "Bulk Source Edit", "BE")); commands.push_back(new CUICommand(eCmdBulkCdsEdit, "Bulk CDS Edit", "Bulk CDS Edit", "BCDSE")); commands.push_back(new CUICommand(eCmdBulkGeneEdit, "Bulk Gene Edit", "Bulk Gene Edit", "BGENEE")); commands.push_back(new CUICommand(eCmdBulkRnaEdit, "Bulk RNA Edit", "Bulk RNA Edit", "BRNAE")); commands.push_back(new CUICommand(eCmdCorrectGenes, "Correct Genes for CDSs or mRNAs", "Correct Genes for CDSs or mRNAs", "CGFCOM")); commands.push_back(new CUICommand(eCmdSegregateSets, "Segregate Sets", "Segregate Sets", "SEGSET")); commands.push_back(new CUICommand(eCmdSequesterSets, "Sequester Sets", "Sequester Sets", "SEQSET")); commands.push_back(new CUICommand(eCmdCombineSelectedGenesIntoPseudogenes,"Combine Selected Genes into Pseudogenes", "Combine selected genes into pseudogenes","CSGPG")); commands.push_back(new CUICommand(eCmdWithdrawSequences, "Withdraw Sequences", "Withdraw Sequences", "WSEQ")); commands.push_back(new CUICommand(eCmdAddSet, "Add Set", "Add Set", "AS")); commands.push_back(new CUICommand(eCmdPropagateDBLink, "Propagate DBLink Descriptors", "Propagate DBLink Descriptors", "PDBLD")); commands.push_back(new CUICommand(eCmdChangeSetClass, "Convert Set Type", "Convert Set Type", "CST")); commands.push_back(new CUICommand(eCmdMolInfoEdit, "MolInfo Edit", "MolInfo Edit", "MIE")); commands.push_back(new CUICommand(eCmdExportTable,"Export Table", "Export Table", "ETBL")); commands.push_back(new CUICommand(eCmdParseStrainSerotypeFromNames, "Parse Strain, Serotype from Names", "Parse Strain, Serotype from Names", "PSSFN")); commands.push_back(new CUICommand(eCmdAddStrainSerotypeToNames, "Add Strain, Serotype to Names", "Add Strain Serotype to Names", "ASSTN")); commands.push_back(new CUICommand(eCmdFixupOrganismNames, "Fixup Organism Names", "Fixup Organism Names", "FON")); commands.push_back(new CUICommand(eCmdSplitQualifiersAtCommas, "Split Quals at Commas", "Split Quals at Commas", "SQAC")); commands.push_back(new CUICommand(eCmdSplitStructuredCollections, "Split Structured Collections", "Split Structured Collections", "SSC")); commands.push_back(new CUICommand(eCmdTrimOrganismNames, "Trim Organism Names", "Trim Organism Names", "TON")); commands.push_back(new CUICommand(eCmdRemoveUnverified, "Remove Unverified", "Remove Unverified from Selected Object", "RU")); commands.push_back(new CUICommand(eCmdAddNamedrRNA12S, "12S", "Add Named rRNA 12S", "ANR12S")); commands.push_back(new CUICommand(eCmdAddNamedrRNA16S, "16S", "Add Named rRNA 16S", "ANR16S")); commands.push_back(new CUICommand(eCmdAddNamedrRNA23S, "23S", "Add Named rRNA 23S", "ANR23S")); commands.push_back(new CUICommand(eCmdAddNamedrRNA18S, "18S", "Add Named rRNA 18S", "ANR18S")); commands.push_back(new CUICommand(eCmdAddNamedrRNA28S, "28S", "Add Named rRNA 28S", "ANR28S")); commands.push_back(new CUICommand(eCmdAddNamedrRNA26S, "26S", "Add Named rRNA 26S", "ANR26S")); commands.push_back(new CUICommand(eCmdAddNamedrRNASmall, "Small", "Add Named rRNA Small", "ANRSmall")); commands.push_back(new CUICommand(eCmdAddNamedrRNALarge, "Large", "Add Named rRNA Large", "ANRLarge")); commands.push_back(new CUICommand(eCmdAddControlRegion, "Control region", "Add Control Region", "ACR")); commands.push_back(new CUICommand(eCmdAddMicrosatellite, "Microsatellite", "Add Microsatellite", "AM")); commands.push_back(new CUICommand(eCmdEditFeatEv, "Evidence", "Edit Feature Evidence", "EFE")); commands.push_back(new CUICommand(eCmdEditFeatLoc, "Location", "Edit Feature Location", "EFL")); commands.push_back(new CUICommand(eCmdEditFeatStrand, "Strand", "Edit Feature Location Strand", "EFLS")); commands.push_back(new CUICommand(eCmdEditFeatRevInt, "Reverse Location Interval Order", "Reverse Location Interval Order", "RLIO")); commands.push_back(new CUICommand(eCmdExtendPartialsConstr, "With Constraint", "Extend Partials With Constraint", "EPWC")); commands.push_back(new CUICommand(eCmdExtendPartialsAll, "All to Ends", "Extend Partials All to Ends", "EPAE")); commands.push_back(new CUICommand(eCmdGeneFromOtherFeat,"Gene Features From Other Features","Gene Features From Other Features","GFFOF")); commands.push_back(new CUICommand(eCmdMakeBadSpecificHostTable, "Make Bad Specific-Host Table", "Make Bad Specific-Host Table", "MBSHT")); commands.push_back(new CUICommand(eCmdCorrectRNAStrand, "Correct RNA strandedness (use SMART)", "Correct RNA strandedness", "CRSUS")); commands.push_back(new CUICommand(eCmdTrimNs, "Trim Ns", "Trim Ns", "TN")); commands.push_back(new CUICommand(eCmdAddFluComments, "Add Flu Comments", "Add Flu Comments", "AFC")); commands.push_back(new CUICommand(eCmdLabelRna, "Label RNA", "Label RNA", "LRNA")); commands.push_back(new CUICommand(eCmdRemProtTitles, "All but RefSeq", "All but ReqSeq", "ABRS")); commands.push_back(new CUICommand(eCmdApplyRNA_ITS, "Apply rRNA_ITS", "Apply rRNA_ITS", "ARNAITS")); commands.push_back(new CUICommand(eCmdListMacroButtonNames, "Display list of macros", "Display list of macros", "DLOM")); commands.push_back(new CUICommand(eCmdEditingButtons, "Sequin Special Editing Buttons", "Sequin Special Editing Buttons", "SSEB")); commands.push_back(new CUICommand(eCmdMakeToolBarWindow, "Make ToolBar Window", "Make ToolBar Window", "MTBW")); commands.push_back(new CUICommand(eCmdTestDialogView, "Open Test DialogView", "Test DialogView", kEmptyStr)); commands.push_back(new CUICommand(eCmdTestFormView, "Open Test FormView", "Test FormView", kEmptyStr)); commands.push_back(new CUICommand(eCmdMacroEditor, "Macro Editor", "Macro Editor", "MACROE")); commands.push_back(new CUICommand(eCmdAdjustConsensusSpliceSitesStrict, "Strict", "Adjust Consensus Splice Sites Strict", "ACSS")); commands.push_back(new CUICommand(eCmdAdjustConsensusSpliceSitesRelaxed, "Relaxed", "Adjust Consensus Splice Sites Relaxed", "ACSR")); commands.push_back(new CUICommand(eCmdLatLonTool, "Lat-Lon Tool", "Lat-Lon Tool", "LLT")); commands.push_back(new CUICommand(eCmdCDSGeneRangeErrorSuppress, "Suppress", "CDS Gene Range Error Suppress", "CDSGRES")); commands.push_back(new CUICommand(eCmdCDSGeneRangeErrorRestore, "Restore", "CDS Gene Range Error Restore", "CDSGRER")); commands.push_back(new CUICommand(eCmdRemoveSegGaps, "Remove Seg Gaps", "Remove Seg Gaps", "RSEGGAPS")); commands.push_back(new CUICommand(eCmdRawSeqToDeltaByNs, "By Ns", "Raw Sequence To Delta By Ns", "RSDN")); commands.push_back(new CUICommand(eCmdRmCultureNotes, "Remove Uncultured Notes", "Remove Uncultured Notes", "RUNN")); for (int i = 0; i < num_feat_cmds; i++) { if (feat_cmds[i].subtype == CSeqFeatData::eSubtype_pub) { commands.push_back(new CUICommand(eCmdCreatePubFeat, "Publication Feature", "Publication", "PF")); continue; } string key = CSeqFeatData::SubtypeValueToName(feat_cmds[i].subtype); if (NStr::IsBlank(key)) { if (feat_cmds[i].subtype == CSeqFeatData::eSubtype_misc_RNA) { key = "RNA"; } else { key = "misc_feat"; } } if (!NStr::IsBlank(key)) { string desc = "C" + key; commands.push_back(new CUICommand(feat_cmds[i].cmd, key, key, desc)); } } commands.push_back(new CUICommand(eCmdAdd16S, "Add 16S", "Add 16S", "A16S")); commands.push_back(new CUICommand(eCmdAdd18S, "Add 18S", "Add 18S", "A18S")); commands.push_back(new CUICommand(eCmdAdd23S, "Add 23S", "Add 23S", "A23S")); commands.push_back(new CUICommand(eCmdAddDefLine, "Add Definition Line", "Add Definition Line", "ADL")); commands.push_back(new CUICommand(eCmdRemoveDefLines, "Remove DefLines", "Remove DefLines", "RDL")); commands.push_back(new CUICommand(eCmdPrefixOrgToDefLine, "Organism", "Prefix Defline With Organism", "PDLORG")); commands.push_back(new CUICommand(eCmdPrefixStrainToDefLine, "Strain", "Prefix Defline With Strain", "PDLSTR")); commands.push_back(new CUICommand(eCmdPrefixCloneToDefLine, "Clone", "Prefix Defline With Clone", "PDLCLO")); commands.push_back(new CUICommand(eCmdPrefixIsolateToDefLine, "Isolate", "Prefix Defline With Isolate", "PDLISO")); commands.push_back(new CUICommand(eCmdPrefixHaplotToDefLine, "Haplotype", "Prefix Defline With Haplotype", "PDLH")); commands.push_back(new CUICommand(eCmdPrefixCultivarToDefLine, "Cultivar", "Prefix Defline With Cultivar", "PDLCULT")); commands.push_back(new CUICommand(eCmdPrefixListToDefLine, "List", "Prefix Defline From List", "PDLLIST")); // annotate descriptors commands commands.push_back(new CUICommand(eCmdCreateDescTPAAssembly, "TPA Assembly", "TPA Assembly", "TPAA")); commands.push_back(new CUICommand(eCmdCreateDescStructuredComment, "Structured Comment", "Structured Comment", "SCD")); commands.push_back(new CUICommand(eCmdCreateDescRefGeneTracking, "RefGene Tracking", "RefGene Tracking", "RGT")); commands.push_back(new CUICommand(eCmdCreateDescDBLink, "DBLink", "DBLink", "DBLD")); commands.push_back(new CUICommand(eCmdCreateDescUnverified, "Unverified", "Unverified", "UVD")); commands.push_back(new CUICommand(eCmdCreateDescAuthorizedAccess, "Authorized Access", "Authorized Access", "AAD")); commands.push_back(new CUICommand(eCmdCreateDescGenomeAssemblyComment, "Genome Assembly", "Genome Assembly", "GAD")); commands.push_back(new CUICommand(eCmdCreateDescGenBankBlock, "GenBank Block", "GenBank Block", "GBBD")); commands.push_back(new CUICommand(eCmdCreateDescComment, "Comment", "Comment", "CD")); commands.push_back(new CUICommand(eCmdCreateDescTitle, "Title", "Title", "TD")); commands.push_back(new CUICommand(eCmdCreateDescMolinfo, "Molecule Description", "Molinfo", "MIDD")); commands.push_back(new CUICommand(eCmdCreateDescSource, "Biological Source", "BioSource", "BSD")); commands.push_back(new CUICommand(eCmdCreateDescPub, "Publication Descriptor", "Publication", "PD")); return commands; } BEGIN_EVENT_TABLE(CSequenceEditingEventHandler, wxEvtHandler) EVT_MENU( eCmdRemoveDescriptors, CSequenceEditingEventHandler::RemoveDescriptors ) EVT_MENU( eCmdRemoveFeatures, CSequenceEditingEventHandler::RemoveFeatures ) EVT_MENU( eCmdApplyIndexerComments, CSequenceEditingEventHandler::ApplyIndexerComments ) EVT_MENU( eCmdRemoveSeqAnnotIds, CSequenceEditingEventHandler::RemoveSeqAnnotIds ) EVT_MENU( eCmdRemoveCddFeatDbxref, CSequenceEditingEventHandler::RemoveCddFeatDbxref ) EVT_MENU( eCmdRemoveBankitComment, CSequenceEditingEventHandler::RemoveBankitComment ) EVT_MENU( eCmdRemoveDuplicateStructuredComments, CSequenceEditingEventHandler::RemoveDuplicateStructuredComments ) EVT_MENU( eCmdRemoveSequencesFromAlignments, CSequenceEditingEventHandler::RemoveSequencesFromAlignments ) EVT_MENU( eCmdRemoveSequences, CSequenceEditingEventHandler::RemoveSequences ) EVT_MENU( eCmdRevCompSequences, CSequenceEditingEventHandler::RevCompSequences ) EVT_MENU( eCmdBioseqFeatsRevComp, CSequenceEditingEventHandler::BioseqFeatsRevComp) EVT_MENU( eCmdUnculTaxTool, CSequenceEditingEventHandler::UnculTaxTool ) EVT_MENU( eCmdEditSequence, CSequenceEditingEventHandler::EditSequence ) EVT_MENU( eCmdRemoveAlignments, CSequenceEditingEventHandler::RemoveSeqAnnotAlign ) EVT_MENU( eCmdRemoveGraphs, CSequenceEditingEventHandler::RemoveSeqAnnotGraph ) EVT_MENU( eCmdRemoveGenomeProjectId, CSequenceEditingEventHandler::RemoveGenomeProjectsDB ) EVT_MENU( eCmdRemoveEmptyGenomeProjectId, CSequenceEditingEventHandler::RemoveEmptyGenomeProjectsDB ) EVT_MENU( eCmdTaxFixCleanup, CSequenceEditingEventHandler::TaxFixCleanup ) EVT_MENU( eCmdExtendedCleanup, CSequenceEditingEventHandler::TaxFixCleanup ) EVT_MENU( eCmdDisableStrainForwarding, CSequenceEditingEventHandler::DisableStrainForwarding ) EVT_MENU( eCmdEditPubs, CSequenceEditingEventHandler::EditPubs ) EVT_MENU( eCmdGlobalAuthorReplace, CSequenceEditingEventHandler::GlobalAuthorReplace ) EVT_MENU( eCmdFixCapitalizationAll, CSequenceEditingEventHandler::FixCapitalizationAll ) EVT_MENU( eCmdFixCapitalizationAuthors, CSequenceEditingEventHandler::FixCapitalizationAuthors ) EVT_MENU( eCmdFixCapitalizationTitles, CSequenceEditingEventHandler::FixCapitalizationTitles ) EVT_MENU( eCmdFixCapitalizationAffiliation, CSequenceEditingEventHandler::FixCapitalizationAffiliation ) EVT_MENU( eCmdFixCapitalizationCountry, CSequenceEditingEventHandler::FixCapitalizationCountry ) EVT_MENU( eCmdRemoveUnpublishedPublications, CSequenceEditingEventHandler::RemoveUnpublishedPublications ) EVT_MENU( eCmdRemovePublishedPublications, CSequenceEditingEventHandler::RemovePublishedPublications ) EVT_MENU( eCmdRemoveCollidingPublications, CSequenceEditingEventHandler::RemoveCollidingPublications ) EVT_MENU( eCmdRemoveAllPublications, CSequenceEditingEventHandler::RemoveAllPublications ) EVT_MENU( eCmdRemoveAuthorConsortiums, CSequenceEditingEventHandler::RemoveAuthorConsortiums ) EVT_MENU( eCmdReverseAuthorNames, CSequenceEditingEventHandler::ReverseAuthorNames ) EVT_MENU( eCmdStripAuthorSuffixes, CSequenceEditingEventHandler::StripAuthorSuffixes ) EVT_MENU( eCmdTruncateAuthorMiddleInitials, CSequenceEditingEventHandler::TruncateAuthorMiddleInitials ) EVT_MENU( eCmdConvertAuthorToConstortiumWhereLastName, CSequenceEditingEventHandler::ConvertAuthorToConstortiumWhereLastName ) EVT_MENU( eCmdConvertAuthorToConsortiumAll, CSequenceEditingEventHandler::ConvertAuthorToConsortiumAll ) EVT_MENU( eCmdAddCitSubForUpdate, CSequenceEditingEventHandler::AddCitSubForUpdate ) EVT_MENU( eCmdFixUsaAndStates, CSequenceEditingEventHandler::FixUsaAndStates ) EVT_MENU( eCmdRetranslateCDSObeyStop, CSequenceEditingEventHandler::RetranslateCDS ) EVT_MENU( eCmdRetranslateCDSIgnoreStopExceptEnd, CSequenceEditingEventHandler::RetranslateCDS ) EVT_MENU( eCmdRetranslateCDSChooseFrame, CSequenceEditingEventHandler::RetranslateCDS ) EVT_MENU( eCmdResynchronizePartialsCDS, CSequenceEditingEventHandler::ResynchronizePartials ) EVT_MENU( eCmdAddTranslExcept, CSequenceEditingEventHandler::AddTranslExcept ) EVT_MENU( eCmdRemoveAllStructuredComments, CSequenceEditingEventHandler::RemoveAllStructuredComments ) EVT_MENU( eCmdRemoveEmptyStructuredComments, CSequenceEditingEventHandler::RemoveEmptyStructuredComments ) EVT_MENU( eCmdModifyStructuredComment, CSequenceEditingEventHandler::ModifyStructuredComment ) EVT_MENU( eCmdRemoveStructuredCommentKeyword, CSequenceEditingEventHandler::RemoveStructuredCommentKeyword ) EVT_MENU( eCmdAddStructuredCommentKeyword, CSequenceEditingEventHandler::AddStructuredCommentKeyword ) EVT_MENU( eCmdAddGenomeAssemblyStructuredComment, CSequenceEditingEventHandler::AddGenomeAssemblyStructuredComment ) EVT_MENU( eCmdReorderStructuredComment, CSequenceEditingEventHandler::ReorderStructuredComment ) EVT_MENU( eCmdConvertComment, CSequenceEditingEventHandler::ConvertComment ) EVT_MENU( eCmdParseComment, CSequenceEditingEventHandler::ParseComment ) EVT_MENU( eCmdAssignFeatureIds, CSequenceEditingEventHandler::AssignFeatureIds ) EVT_MENU( eCmdClearFeatureIds, CSequenceEditingEventHandler::ClearFeatureIds ) EVT_MENU( eCmdReassignFeatureIds, CSequenceEditingEventHandler::ReassignFeatureIds ) EVT_MENU( eCmdUniqifyFeatureIds, CSequenceEditingEventHandler::UniqifyFeatureIds ) EVT_MENU( eCmdTrimJunkInPrimerSeqs, CSequenceEditingEventHandler::TrimJunkInPrimerSeqs ) EVT_MENU( eCmdFixiInPrimerSeqs, CSequenceEditingEventHandler::FixiInPrimerSeqs ) EVT_MENU( eCmdPrefixAuthWithTax, CSequenceEditingEventHandler::PrefixAuthWithTax) EVT_MENU( eCmdFocusSet, CSequenceEditingEventHandler::FocusSet ) EVT_MENU( eCmdFocusClear, CSequenceEditingEventHandler::FocusClear ) EVT_MENU( eCmdSetTransgSrcDesc, CSequenceEditingEventHandler::SetTransgSrcDesc ) EVT_MENU( eCmdSplitDblinkQuals, CSequenceEditingEventHandler::SplitDblinkQuals ) EVT_MENU( eCmdFixOrgModInstitution, CSequenceEditingEventHandler::FixOrgModInstitution ) EVT_MENU( eCmdSwapPrimerSeqName, CSequenceEditingEventHandler::SwapPrimerSeqName ) EVT_MENU( eCmdMergePrimerSets, CSequenceEditingEventHandler::MergePrimerSets ) EVT_MENU( eCmdSplitPrimerSets, CSequenceEditingEventHandler::SplitPrimerSets ) EVT_MENU( eCmdAppendModToOrg, CSequenceEditingEventHandler::AppendModToOrg ) EVT_MENU( eCmdParseCollectionDateMonthFirst, CSequenceEditingEventHandler::ParseCollectionDateMonthFirst ) EVT_MENU( eCmdParseCollectionDateDayFirst, CSequenceEditingEventHandler::ParseCollectionDateDayFirst ) EVT_MENU( eCmdCountryFixupCap, CSequenceEditingEventHandler::CountryFixupCap ) EVT_MENU( eCmdCountryFixupNoCap, CSequenceEditingEventHandler::CountryFixupNoCap ) EVT_MENU( eCmdVectorTrim, CSequenceEditingEventHandler::VectorTrim ) EVT_MENU( eCmdSelectTarget, CSequenceEditingEventHandler::SelectTarget ) EVT_MENU( eCmdApplyCDS, CSequenceEditingEventHandler::AddCDS ) EVT_MENU( eCmdApplyAddRNA, CSequenceEditingEventHandler::AddRNA ) EVT_MENU( eCmdApplyAddOther, CSequenceEditingEventHandler::AddOtherFeature ) EVT_MENU( eCmdValidate, CSequenceEditingEventHandler::Validate ) EVT_MENU( eCmdValidateNoAlignments, CSequenceEditingEventHandler::Validate ) EVT_MENU( eCmdValidateCheckInferences, CSequenceEditingEventHandler::Validate ) EVT_MENU( eCmdSortUniqueCount, CSequenceEditingEventHandler::SortUniqueCount ) EVT_MENU( eCmdSortUniqueCountText, CSequenceEditingEventHandler::SortUniqueCount ) EVT_MENU( eCmdMegaReport, CSequenceEditingEventHandler::MegaReport ) EVT_MENU (eCmdOnCallerTool, CSequenceEditingEventHandler::OnCallerTool) EVT_MENU( eCmdDiscReport, CSequenceEditingEventHandler::DiscrepancyReport ) EVT_MENU( eCmdAutodefDefaultOptions, CSequenceEditingEventHandler::Autodef ) EVT_MENU( eCmdAutodefOptions, CSequenceEditingEventHandler::Autodef ) EVT_MENU( eCmdAutodefMisc, CSequenceEditingEventHandler::Autodef ) EVT_MENU( eCmdAutodefId, CSequenceEditingEventHandler::Autodef ) EVT_MENU( eCmdAutodefNoMods, CSequenceEditingEventHandler::Autodef ) EVT_MENU( eCmdAutodefPopset, CSequenceEditingEventHandler::Autodef ) EVT_MENU( eCmdInstantiateProteinTitles, CSequenceEditingEventHandler::PT_Cleanup ) EVT_MENU( eCmdRemoveAllFeatures, CSequenceEditingEventHandler::RemoveAllFeatures ) EVT_MENU( eCmdAddSequences, CSequenceEditingEventHandler::AddSequences ) EVT_MENU (eCmdApplySourceQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdEditSourceQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdConvertSourceQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdSwapSourceQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdRemoveSourceQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdApplyRNAQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdEditRNAQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdConvertRNAQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdSwapRNAQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdRemoveRNAQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdApplyCGPQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdEditCGPQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdConvertCGPQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdSwapCGPQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdRemoveCGPQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdApplyFeatQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdEditFeatQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdConvertFeatQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdSwapFeatQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdRemoveFeatQual, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdRemoveTextOutsideString, CSequenceEditingEventHandler::ApplyEditConvertRemove ) EVT_MENU (eCmdEditFeatEv, CSequenceEditingEventHandler::EditFeature ) EVT_MENU (eCmdEditFeatLoc, CSequenceEditingEventHandler::EditFeature ) EVT_MENU (eCmdEditFeatStrand, CSequenceEditingEventHandler::EditFeature ) EVT_MENU (eCmdEditFeatRevInt, CSequenceEditingEventHandler::EditFeature ) EVT_MENU (eCmdExtendPartialsConstr, CSequenceEditingEventHandler::ExtendPartialsConstr ) EVT_MENU (eCmdExtendPartialsAll, CSequenceEditingEventHandler::ExtendPartialsAll ) EVT_MENU (eCmdGeneFromOtherFeat, CSequenceEditingEventHandler::GeneFromOtherFeat ) EVT_MENU (eCmdParseText, CSequenceEditingEventHandler::ParseText ) EVT_MENU (eCmdParseTextFromDefline, CSequenceEditingEventHandler::ParseText ) EVT_MENU (eCmdParseLocalToSrc, CSequenceEditingEventHandler::ParseText ) EVT_MENU (eCmdLowercaseQuals, CSequenceEditingEventHandler::LowercaseQuals ) EVT_MENU (eCmdConvertFeatures, CSequenceEditingEventHandler::ConvertFeatures ) EVT_MENU (eCmdConvertCdsToMiscFeat, CSequenceEditingEventHandler::ConvertCdsToMiscFeat ) EVT_MENU (eCmdConvertCdsWithInternalStopToMiscFeat, CSequenceEditingEventHandler::ConvertCdsWithInternalStopToMiscFeat ) EVT_MENU (eCmdConvertCdsWithInternalStopToMiscFeatViral, CSequenceEditingEventHandler::ConvertCdsWithInternalStopToMiscFeatViral ) EVT_MENU (eCmdConvertCdsWithInternalStopToMiscFeatUnverified, CSequenceEditingEventHandler::ConvertCdsWithInternalStopToMiscFeatUnverified ) EVT_MENU (eCmdTableReader, CSequenceEditingEventHandler::TableReader ) EVT_MENU (eCmdTableReaderClipboard, CSequenceEditingEventHandler::TableReaderClipboard ) EVT_MENU (eCmdBulkSourceEdit, CSequenceEditingEventHandler::BulkEdit ) EVT_MENU (eCmdBulkCdsEdit, CSequenceEditingEventHandler::BulkCdsEdit ) EVT_MENU (eCmdBulkGeneEdit, CSequenceEditingEventHandler::BulkGeneEdit ) EVT_MENU (eCmdBulkRnaEdit, CSequenceEditingEventHandler::BulkRnaEdit ) EVT_MENU (eCmdLatLonTool, CSequenceEditingEventHandler::LatLonTool ) EVT_MENU (eCmdCDSGeneRangeErrorSuppress, CSequenceEditingEventHandler::CDSGeneRangeErrorSuppress ) EVT_MENU (eCmdCDSGeneRangeErrorRestore, CSequenceEditingEventHandler::CDSGeneRangeErrorRestore ) EVT_MENU (eCmdCorrectGenes, CSequenceEditingEventHandler::CorrectGenes ) EVT_MENU (eCmdSegregateSets, CSequenceEditingEventHandler::SegregateSets ) EVT_MENU (eCmdSequesterSets, CSequenceEditingEventHandler::SequesterSets ) EVT_MENU (eCmdCombineSelectedGenesIntoPseudogenes, CSequenceEditingEventHandler::CombineSelectedGenesIntoPseudogenes ) EVT_MENU (eCmdWithdrawSequences, CSequenceEditingEventHandler::WithdrawSequences ) EVT_MENU (eCmdAddSet, CSequenceEditingEventHandler::AddSet ) EVT_MENU (eCmdPropagateDBLink, CSequenceEditingEventHandler::PropagateDBLink ) EVT_MENU (eCmdChangeSetClass, CSequenceEditingEventHandler::ConvertSetType ) EVT_MENU (eCmdMolInfoEdit, CSequenceEditingEventHandler::MolInfoEdit ) EVT_MENU (eCmdExportTable, CSequenceEditingEventHandler::ExportTable ) EVT_MENU (eCmdParseStrainSerotypeFromNames, CSequenceEditingEventHandler::ParseStrainSerotypeFromNames) EVT_MENU (eCmdAddStrainSerotypeToNames, CSequenceEditingEventHandler::AddStrainSerotypeToNames ) EVT_MENU (eCmdFixupOrganismNames, CSequenceEditingEventHandler::FixupOrganismNames) EVT_MENU (eCmdSplitQualifiersAtCommas, CSequenceEditingEventHandler::SplitQualifiersAtCommas) EVT_MENU (eCmdSplitStructuredCollections, CSequenceEditingEventHandler::SplitStructuredCollections) EVT_MENU (eCmdTrimOrganismNames, CSequenceEditingEventHandler::TrimOrganismNames) EVT_MENU( eCmdRemoveUnverified, CSequenceEditingEventHandler::RemoveUnverified ) EVT_MENU (eCmdAddNamedrRNA12S, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAddNamedrRNA16S, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAddNamedrRNA23S, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAddNamedrRNA18S, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAddNamedrRNA28S, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAddNamedrRNA26S, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAddNamedrRNASmall, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAddNamedrRNALarge, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAddControlRegion, CSequenceEditingEventHandler::AddControlRegion) EVT_MENU (eCmdAddMicrosatellite, CSequenceEditingEventHandler::AddMicrosatellite) EVT_MENU (eCmdCreateFeatureGene, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateFeatureLTR, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateFeatureProt, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateSecondaryStructure, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateRegion, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreatePubFeat, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateStemLoop, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateSTS, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateCodingRegion, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateRepeatRegion, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateVariation, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateOperon, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateMobileElement, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateCentromere, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateTelomere, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreatePreRNA, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateMRNA, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateExon, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateIntron, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreate3UTR, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreate5UTR, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreatetRNA, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreaterRNA, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateRNA, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreatencRNA, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreatetmRNA, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreatePolyASite, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreatePrimerBind, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateProteinBind, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateRepOrigin, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateOriT, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateCRegion, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateDLoop, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateDSegment, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateiDNA, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateJSegment, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateMiscBinding, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateMiscDifference, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateMiscFeature, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateMiscRecomb, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateMiscStructure, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateModifiedBase, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateNRegion, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreatePrimTranscript, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateRegulatory, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateSRegion, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateSatellite, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateUnsure, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateVRegion, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateVSegment, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateProprotein, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateMatPeptide, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateSigPeptide, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateTransitPeptide, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateBond, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateSite, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdCreateAssemblyGap, CSequenceEditingEventHandler::CreateFeature) EVT_MENU (eCmdAdd16S, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAdd18S, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAdd23S, CSequenceEditingEventHandler::AddNamedrRNA) EVT_MENU (eCmdAddDefLine, CSequenceEditingEventHandler::AddDefLine) EVT_MENU (eCmdRemoveDefLines, CSequenceEditingEventHandler::RemoveDefLines) EVT_MENU (eCmdPrefixOrgToDefLine, CSequenceEditingEventHandler::PrefixDefLines) EVT_MENU (eCmdPrefixStrainToDefLine, CSequenceEditingEventHandler::PrefixDefLines) EVT_MENU (eCmdPrefixCloneToDefLine, CSequenceEditingEventHandler::PrefixDefLines) EVT_MENU (eCmdPrefixIsolateToDefLine, CSequenceEditingEventHandler::PrefixDefLines) EVT_MENU (eCmdPrefixHaplotToDefLine, CSequenceEditingEventHandler::PrefixDefLines) EVT_MENU (eCmdPrefixCultivarToDefLine, CSequenceEditingEventHandler::PrefixDefLines) EVT_MENU (eCmdPrefixListToDefLine, CSequenceEditingEventHandler::PrefixDefLines) EVT_MENU (eCmdCreateDescTPAAssembly, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescStructuredComment, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescRefGeneTracking, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescDBLink, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescUnverified, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescAuthorizedAccess, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescGenomeAssemblyComment, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescGenBankBlock, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescComment, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescTitle, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescMolinfo, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCreateDescSource, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdMakeBadSpecificHostTable, CSequenceEditingEventHandler::MakeBadSpecificHostTable) EVT_MENU (eCmdEditingButtons, CSequenceEditingEventHandler::EditingButtons) EVT_MENU (eCmdMakeToolBarWindow, CSequenceEditingEventHandler::EditingButtons) EVT_MENU (eCmdCreateDescPub, CSequenceEditingEventHandler::CreateDescriptor) EVT_MENU (eCmdCorrectRNAStrand, CSequenceEditingEventHandler::CorrectRNAStrand) EVT_MENU (eCmdTrimNs, CSequenceEditingEventHandler::TrimNs) EVT_MENU (eCmdAddFluComments, CSequenceEditingEventHandler::AddFluComments) EVT_MENU (eCmdLabelRna, CSequenceEditingEventHandler::LabelRna) EVT_MENU (eCmdRemProtTitles, CSequenceEditingEventHandler::RemProtTitles) EVT_MENU (eCmdApplyRNA_ITS, CSequenceEditingEventHandler::ApplyRNA_ITS) EVT_MENU (eCmdListMacroButtonNames, CSequenceEditingEventHandler::ListMacroButtonNames) EVT_MENU (eCmdTestDialogView, CSequenceEditingEventHandler::TestDialogView) EVT_MENU (eCmdTestFormView, CSequenceEditingEventHandler::TestFormView) EVT_MENU (eCmdMacroEditor, CSequenceEditingEventHandler::MacroEditor) EVT_MENU (eCmdAdjustConsensusSpliceSitesStrict, CSequenceEditingEventHandler::AdjustForConsensusSpliceSites) EVT_MENU (eCmdAdjustConsensusSpliceSitesRelaxed, CSequenceEditingEventHandler::AdjustForConsensusSpliceSites) EVT_MENU (eCmdRemoveSegGaps, CSequenceEditingEventHandler::RemoveSegGaps) EVT_MENU (eCmdRawSeqToDeltaByNs, CSequenceEditingEventHandler::RawSeqToDeltaByNs) EVT_MENU (eCmdRmCultureNotes, CSequenceEditingEventHandler::RmCultureNotes) // Please do not make overlapping UPDATE_UI_RANGEs. Every time there is an overlapping range here a cute kitten dies in horror!!! EVT_UPDATE_UI_RANGE(eCmdRemoveDescriptors, eCmdCreateDescPub, CSequenceEditingEventHandler::IsObjectSelected ) EVT_UPDATE_UI_RANGE(eCmdCreateFeatureGene, eCmdCreateAssemblyGap, CSequenceEditingEventHandler::IsLocationSelected ) EVT_UPDATE_UI_RANGE(eCmdCreateFeatureProt, eCmdCreateBond, CSequenceEditingEventHandler::IsLocationSelected ) EVT_UPDATE_UI_RANGE(eCmdCreateRegion, eCmdCreateSite, CSequenceEditingEventHandler::IsLocationSelected ) EVT_UPDATE_UI_RANGE(eCmdTestDialogView, eCmdTestFormView, CSequenceEditingEventHandler::IsObjectSelected ) END_EVENT_TABLE() BEGIN_EVENT_MAP(CSequenceEditingEventHandler, CEventHandler) ON_EVENT_RANGE(CSelectionServiceEvent, CSelectionServiceEvent::eClientAttached, CSelectionServiceEvent::eSelectionChanged, &CSequenceEditingEventHandler::x_OnSelectionEvent) END_EVENT_MAP() static WX_DEFINE_MENU(kEditingMenu) WX_SUBMENU("&Edit") WX_MENU_ITEM(eCmdRemoveSequences) WX_MENU_ITEM(eCmdAddSequences) WX_END_SUBMENU() WX_MENU_SEPARATOR_L("Contribs") WX_SUBMENU("Search") WX_SUBMENU("Validate") WX_MENU_ITEM(eCmdValidate) WX_MENU_ITEM(eCmdValidateNoAlignments) WX_MENU_ITEM(eCmdValidateCheckInferences) WX_END_SUBMENU() WX_MENU_ITEM(eCmdVectorTrim) WX_MENU_ITEM(eCmdSelectTarget) WX_END_SUBMENU() WX_SUBMENU("&Special") WX_SUBMENU("Def Line") WX_SUBMENU("Automatic Def Line") WX_MENU_ITEM(eCmdAutodefDefaultOptions) WX_MENU_ITEM(eCmdAutodefNoMods) WX_MENU_ITEM(eCmdAutodefOptions) WX_MENU_ITEM(eCmdAutodefMisc) WX_MENU_ITEM(eCmdAutodefId) WX_MENU_ITEM(eCmdAutodefPopset) WX_END_SUBMENU() WX_MENU_ITEM(eCmdAddDefLine) WX_SUBMENU("Prefix Def Line With") WX_MENU_ITEM(eCmdPrefixOrgToDefLine) WX_MENU_ITEM(eCmdPrefixStrainToDefLine) WX_MENU_ITEM(eCmdPrefixCloneToDefLine) WX_MENU_ITEM(eCmdPrefixIsolateToDefLine) WX_MENU_ITEM(eCmdPrefixHaplotToDefLine) WX_MENU_ITEM(eCmdPrefixCultivarToDefLine) WX_MENU_ITEM(eCmdPrefixListToDefLine) WX_END_SUBMENU() WX_MENU_ITEM(eCmdParseTextFromDefline) WX_END_SUBMENU() WX_SUBMENU("Organism") WX_MENU_ITEM(eCmdPrefixAuthWithTax) WX_MENU_ITEM(eCmdAppendModToOrg) WX_MENU_ITEM(eCmdCountryFixupCap) WX_MENU_ITEM(eCmdCountryFixupNoCap) WX_MENU_ITEM(eCmdParseCollectionDateMonthFirst) WX_MENU_ITEM(eCmdParseCollectionDateDayFirst) WX_MENU_ITEM(eCmdMakeBadSpecificHostTable) WX_MENU_SEPARATOR() WX_SUBMENU("Source Focus") WX_MENU_ITEM(eCmdFocusSet) WX_MENU_ITEM(eCmdFocusClear) WX_END_SUBMENU() WX_MENU_ITEM(eCmdSetTransgSrcDesc) WX_MENU_ITEM(eCmdFixOrgModInstitution) WX_MENU_ITEM(eCmdTrimOrganismNames) WX_MENU_ITEM(eCmdSplitStructuredCollections) WX_MENU_ITEM(eCmdSplitQualifiersAtCommas) WX_MENU_ITEM(eCmdSplitDblinkQuals) WX_SUBMENU("PCR Fixes") WX_MENU_ITEM(eCmdSwapPrimerSeqName) WX_MENU_ITEM(eCmdTrimJunkInPrimerSeqs) WX_MENU_ITEM(eCmdSplitPrimerSets) WX_MENU_ITEM(eCmdMergePrimerSets) WX_MENU_ITEM(eCmdFixiInPrimerSeqs) WX_END_SUBMENU() WX_SUBMENU("Influenza Virus Names") WX_MENU_ITEM(eCmdParseStrainSerotypeFromNames) WX_MENU_ITEM(eCmdAddStrainSerotypeToNames) WX_MENU_ITEM(eCmdFixupOrganismNames) WX_END_SUBMENU() WX_MENU_ITEM(eCmdDisableStrainForwarding) WX_MENU_ITEM(eCmdUnculTaxTool) WX_MENU_ITEM(eCmdLatLonTool) WX_SUBMENU("Parse Organism Modifiers") WX_MENU_ITEM(eCmdExportTable) WX_END_SUBMENU() WX_END_SUBMENU() WX_SUBMENU("Apply") WX_MENU_ITEM(eCmdApplyCDS) WX_MENU_ITEM(eCmdApplyAddRNA) WX_SUBMENU("Add Named rRNA") WX_MENU_ITEM(eCmdAddNamedrRNA12S) WX_MENU_ITEM(eCmdAddNamedrRNA16S) WX_MENU_ITEM(eCmdAddNamedrRNA23S) WX_MENU_ITEM(eCmdAddNamedrRNA18S) WX_MENU_ITEM(eCmdAddNamedrRNA28S) WX_MENU_ITEM(eCmdAddNamedrRNA26S) WX_MENU_ITEM(eCmdAddNamedrRNASmall) WX_MENU_ITEM(eCmdAddNamedrRNALarge) WX_END_SUBMENU() WX_MENU_ITEM(eCmdApplyRNA_ITS) WX_MENU_ITEM(eCmdApplyAddOther) WX_SUBMENU("Add Common Feature") WX_MENU_ITEM(eCmdAddMicrosatellite) WX_MENU_ITEM(eCmdAddControlRegion) WX_END_SUBMENU() WX_MENU_ITEM(eCmdApplyFeatQual) WX_MENU_ITEM(eCmdApplySourceQual) WX_MENU_ITEM(eCmdApplyCGPQual) WX_MENU_ITEM(eCmdApplyRNAQual) WX_MENU_ITEM(eCmdTableReader) WX_MENU_ITEM(eCmdTableReaderClipboard) WX_MENU_ITEM(eCmdMolInfoEdit) WX_MENU_ITEM(eCmdLabelRna) WX_MENU_ITEM(eCmdPropagateDBLink) WX_MENU_ITEM(eCmdApplyIndexerComments) WX_MENU_ITEM(eCmdExportTable) WX_END_SUBMENU() WX_SUBMENU("Remove") WX_MENU_ITEM(eCmdRemoveDescriptors) WX_MENU_ITEM(eCmdRemoveFeatures) WX_MENU_ITEM(eCmdRemoveAllFeatures) WX_MENU_ITEM(eCmdRemoveFeatQual) WX_MENU_ITEM(eCmdRemoveSourceQual) WX_MENU_ITEM(eCmdRemoveCGPQual) WX_MENU_ITEM(eCmdRemoveRNAQual) WX_MENU_ITEM(eCmdRemoveSeqAnnotIds) WX_MENU_ITEM(eCmdRemoveCddFeatDbxref) WX_MENU_ITEM(eCmdRemoveBankitComment) WX_MENU_ITEM(eCmdRemoveUnverified) WX_SUBMENU("Remove Text") WX_MENU_ITEM(eCmdRemoveTextOutsideString) WX_END_SUBMENU() WX_SUBMENU("Remove Duplicate") WX_MENU_ITEM(eCmdRemoveDuplicateStructuredComments) WX_END_SUBMENU() WX_MENU_ITEM(eCmdRemoveSequencesFromAlignments) WX_MENU_ITEM(eCmdRemoveSequences) WX_MENU_ITEM(eCmdRemoveAlignments) WX_MENU_ITEM(eCmdRemoveGraphs) WX_MENU_ITEM(eCmdRemoveGenomeProjectId) WX_MENU_ITEM(eCmdRemoveEmptyGenomeProjectId) WX_SUBMENU("Remove Titles") WX_SUBMENU("Protein") WX_MENU_ITEM(eCmdRemProtTitles) WX_END_SUBMENU() WX_END_SUBMENU() WX_MENU_ITEM(eCmdWithdrawSequences) WX_MENU_ITEM(eCmdRmCultureNotes) WX_END_SUBMENU() WX_SUBMENU("Convert") WX_MENU_ITEM(eCmdConvertFeatures) WX_MENU_ITEM(eCmdConvertCdsToMiscFeat) WX_SUBMENU("Convert CDS with Internal Stop Codon") WX_MENU_ITEM(eCmdConvertCdsWithInternalStopToMiscFeat) WX_MENU_ITEM(eCmdConvertCdsWithInternalStopToMiscFeatViral) WX_MENU_ITEM(eCmdConvertCdsWithInternalStopToMiscFeatUnverified) WX_END_SUBMENU() WX_MENU_ITEM(eCmdConvertFeatQual) WX_MENU_ITEM(eCmdConvertSourceQual) WX_MENU_ITEM(eCmdConvertCGPQual) WX_MENU_ITEM(eCmdConvertRNAQual) WX_MENU_ITEM(eCmdSwapFeatQual) WX_MENU_ITEM(eCmdSwapSourceQual) WX_MENU_ITEM(eCmdSwapCGPQual) WX_MENU_ITEM(eCmdSwapRNAQual) WX_MENU_ITEM(eCmdParseText) WX_END_SUBMENU() WX_SUBMENU("Edit") WX_MENU_ITEM(eCmdEditFeatQual) WX_MENU_ITEM(eCmdEditSourceQual) WX_MENU_ITEM(eCmdEditCGPQual) WX_MENU_ITEM(eCmdEditRNAQual) WX_MENU_ITEM(eCmdMolInfoEdit) WX_MENU_ITEM(eCmdTrimNs) WX_SUBMENU("Edit Feature") WX_MENU_ITEM(eCmdEditFeatEv) WX_MENU_ITEM(eCmdEditFeatLoc) WX_MENU_ITEM(eCmdEditFeatStrand) WX_MENU_ITEM(eCmdEditFeatRevInt) WX_END_SUBMENU() WX_SUBMENU("Bulk Edit") WX_MENU_ITEM(eCmdBulkSourceEdit) WX_MENU_ITEM(eCmdBulkCdsEdit) WX_MENU_ITEM(eCmdBulkGeneEdit) WX_MENU_ITEM(eCmdBulkRnaEdit) WX_END_SUBMENU() WX_SUBMENU("Extend Partial Features") WX_MENU_ITEM(eCmdExtendPartialsConstr) WX_MENU_ITEM(eCmdExtendPartialsAll) WX_END_SUBMENU() WX_MENU_ITEM(eCmdCorrectGenes) WX_MENU_ITEM(eCmdLowercaseQuals) WX_MENU_ITEM(eCmdEditSequence) WX_END_SUBMENU() WX_SUBMENU("Authors and Publications") WX_MENU_ITEM(eCmdEditPubs) WX_MENU_ITEM(eCmdGlobalAuthorReplace) WX_SUBMENU("Fix Capitalization") WX_MENU_ITEM(eCmdFixCapitalizationAll) WX_MENU_ITEM(eCmdFixCapitalizationAuthors) WX_MENU_ITEM(eCmdFixCapitalizationTitles) WX_MENU_ITEM(eCmdFixCapitalizationAffiliation) WX_MENU_ITEM(eCmdFixCapitalizationCountry) WX_END_SUBMENU() WX_SUBMENU("Remove Publications") WX_MENU_ITEM(eCmdRemoveUnpublishedPublications) WX_MENU_ITEM(eCmdRemovePublishedPublications) WX_MENU_ITEM(eCmdRemoveCollidingPublications) WX_MENU_ITEM(eCmdRemoveAllPublications) WX_END_SUBMENU() WX_MENU_ITEM(eCmdRemoveAuthorConsortiums) WX_MENU_ITEM(eCmdReverseAuthorNames) WX_MENU_ITEM(eCmdStripAuthorSuffixes) WX_MENU_ITEM(eCmdTruncateAuthorMiddleInitials) WX_SUBMENU("Convert Author to Consortium") WX_MENU_ITEM(eCmdConvertAuthorToConstortiumWhereLastName) WX_MENU_ITEM(eCmdConvertAuthorToConsortiumAll) WX_END_SUBMENU() WX_MENU_ITEM(eCmdAddCitSubForUpdate) WX_MENU_ITEM(eCmdFixUsaAndStates) WX_END_SUBMENU() WX_SUBMENU("CDS, Protein, and RNA") WX_SUBMENU("Retranslate Coding Regions") WX_MENU_ITEM(eCmdRetranslateCDSObeyStop) WX_MENU_ITEM(eCmdRetranslateCDSIgnoreStopExceptEnd) WX_MENU_ITEM(eCmdRetranslateCDSChooseFrame) WX_END_SUBMENU() WX_MENU_ITEM(eCmdResynchronizePartialsCDS) WX_MENU_ITEM(eCmdAddTranslExcept) WX_SUBMENU("Adjust CDS for Consensus Splice Sites") WX_MENU_ITEM(eCmdAdjustConsensusSpliceSitesStrict) WX_MENU_ITEM(eCmdAdjustConsensusSpliceSitesRelaxed) WX_END_SUBMENU() WX_END_SUBMENU() WX_SUBMENU("Structured Comments") WX_MENU_ITEM(eCmdRemoveDuplicateStructuredComments) WX_MENU_ITEM(eCmdRemoveAllStructuredComments) WX_MENU_ITEM(eCmdRemoveEmptyStructuredComments) WX_MENU_ITEM(eCmdModifyStructuredComment) WX_MENU_ITEM(eCmdRemoveStructuredCommentKeyword) WX_MENU_ITEM(eCmdAddStructuredCommentKeyword) WX_MENU_ITEM(eCmdAddGenomeAssemblyStructuredComment) WX_MENU_ITEM(eCmdReorderStructuredComment) WX_MENU_ITEM(eCmdConvertComment) WX_MENU_ITEM(eCmdParseComment) WX_END_SUBMENU() WX_SUBMENU("Cleanup and Fixup") WX_MENU_ITEM(eCmdTaxFixCleanup) WX_MENU_ITEM(eCmdExtendedCleanup) WX_MENU_ITEM(eCmdInstantiateProteinTitles) WX_END_SUBMENU() WX_SUBMENU("Display") WX_MENU_ITEM(eCmdOnCallerTool) WX_MENU_ITEM(eCmdListMacroButtonNames) WX_MENU_ITEM(eCmdMakeToolBarWindow) WX_END_SUBMENU() WX_SUBMENU("Desktop") WX_MENU_ITEM(eCmdCorrectRNAStrand) WX_MENU_ITEM(eCmdSegregateSets) WX_MENU_ITEM(eCmdSequesterSets) WX_MENU_ITEM(eCmdAddSet) WX_MENU_ITEM(eCmdRemoveSegGaps) WX_MENU_ITEM(eCmdRevCompSequences) WX_MENU_ITEM(eCmdChangeSetClass) WX_SUBMENU("Filter") WX_SUBMENU("Utilities") WX_MENU_ITEM(eCmdBioseqFeatsRevComp) WX_END_SUBMENU() WX_END_SUBMENU() WX_END_SUBMENU() WX_SUBMENU("Link") WX_MENU_ITEM(eCmdAssignFeatureIds) WX_MENU_ITEM(eCmdClearFeatureIds) WX_MENU_ITEM(eCmdReassignFeatureIds) WX_MENU_ITEM(eCmdUniqifyFeatureIds) WX_END_SUBMENU() WX_SUBMENU("Projects") WX_MENU_ITEM(eCmdAddFluComments) WX_END_SUBMENU() WX_SUBMENU("Make Features and Fuse") WX_MENU_ITEM(eCmdCombineSelectedGenesIntoPseudogenes) WX_MENU_ITEM(eCmdGeneFromOtherFeat) WX_END_SUBMENU() WX_SUBMENU("Normalize, Map, Package") WX_SUBMENU("CDSGeneRangeError") WX_MENU_ITEM(eCmdCDSGeneRangeErrorSuppress) WX_MENU_ITEM(eCmdCDSGeneRangeErrorRestore) WX_END_SUBMENU() WX_END_SUBMENU() WX_SUBMENU("Gap Sequences") WX_SUBMENU("Raw Sequence To Delta") WX_MENU_ITEM(eCmdRawSeqToDeltaByNs) WX_END_SUBMENU() WX_END_SUBMENU() WX_MENU_ITEM(eCmdSortUniqueCount) WX_MENU_ITEM(eCmdSortUniqueCountText) WX_MENU_ITEM(eCmdMegaReport) WX_MENU_ITEM(eCmdDiscReport) WX_MENU_ITEM(eCmdValidate) WX_MENU_ITEM(eCmdMacroEditor) #ifdef _DEBUG WX_MENU_ITEM(eCmdTestDialogView) WX_MENU_ITEM(eCmdTestFormView) #endif WX_SUBMENU("Custom") WX_MENU_ITEM(eCmdAdd16S) WX_MENU_ITEM(eCmdAdd18S) WX_MENU_ITEM(eCmdAdd23S) WX_MENU_ITEM(eCmdRemoveDefLines) WX_MENU_ITEM(eCmdParseLocalToSrc) WX_END_SUBMENU() WX_MENU_ITEM(eCmdEditingButtons) WX_END_SUBMENU() WX_SUBMENU("&Annotate") WX_SUBMENU("Genes and Named Regions") WX_MENU_ITEM(eCmdCreateFeatureGene) WX_MENU_ITEM(eCmdCreateFeatureProt) WX_MENU_ITEM(eCmdCreateFeatureLTR) WX_MENU_ITEM(eCmdCreateRepeatRegion) WX_MENU_ITEM(eCmdCreateStemLoop) WX_MENU_ITEM(eCmdCreateSTS) WX_MENU_ITEM(eCmdCreateRegion) WX_MENU_ITEM(eCmdCreateSecondaryStructure) WX_MENU_ITEM(eCmdCreateProprotein) WX_MENU_ITEM(eCmdCreateMatPeptide) WX_MENU_ITEM(eCmdCreateSigPeptide) WX_MENU_ITEM(eCmdCreateTransitPeptide) WX_MENU_ITEM(eCmdCreateOperon) WX_MENU_ITEM(eCmdCreateMobileElement) WX_MENU_ITEM(eCmdCreateCentromere) WX_MENU_ITEM(eCmdCreateTelomere) WX_END_SUBMENU() WX_SUBMENU("Coding Regions and Transcripts") WX_MENU_ITEM(eCmdCreateCodingRegion) WX_MENU_ITEM(eCmdCreatePreRNA) WX_MENU_ITEM(eCmdCreateMRNA) WX_MENU_ITEM(eCmdCreateExon) WX_MENU_ITEM(eCmdCreateIntron) WX_MENU_ITEM(eCmdCreate3UTR) WX_MENU_ITEM(eCmdCreate5UTR) WX_END_SUBMENU() WX_SUBMENU("Structural RNAs") WX_MENU_ITEM(eCmdCreatetRNA) WX_MENU_ITEM(eCmdCreaterRNA) WX_MENU_ITEM(eCmdCreateRNA) WX_MENU_ITEM(eCmdCreatencRNA) WX_MENU_ITEM(eCmdCreatetmRNA) WX_END_SUBMENU() WX_SUBMENU("Sites and Bonds") WX_MENU_ITEM(eCmdCreatePolyASite) WX_MENU_ITEM(eCmdCreatePrimerBind) WX_MENU_ITEM(eCmdCreateProteinBind) WX_MENU_ITEM(eCmdCreateRepOrigin) WX_MENU_ITEM(eCmdCreateBond) WX_MENU_ITEM(eCmdCreateSite) WX_MENU_ITEM(eCmdCreateOriT) WX_END_SUBMENU() WX_SUBMENU("Remaining Features") WX_MENU_ITEM(eCmdCreateCRegion) WX_MENU_ITEM(eCmdCreateDLoop) WX_MENU_ITEM(eCmdCreateDSegment) WX_MENU_ITEM(eCmdCreateiDNA) WX_MENU_ITEM(eCmdCreateJSegment) WX_MENU_ITEM(eCmdCreateMiscBinding) WX_MENU_ITEM(eCmdCreateMiscDifference) WX_MENU_ITEM(eCmdCreateMiscFeature) WX_MENU_ITEM(eCmdCreateMiscRecomb) WX_MENU_ITEM(eCmdCreateMiscStructure) WX_MENU_ITEM(eCmdCreateModifiedBase) WX_MENU_ITEM(eCmdCreateNRegion) WX_MENU_ITEM(eCmdCreatePrimTranscript) WX_MENU_ITEM(eCmdCreateRegulatory) WX_MENU_ITEM(eCmdCreateSRegion) WX_MENU_ITEM(eCmdCreateSatellite) WX_MENU_ITEM(eCmdCreateUnsure) WX_MENU_ITEM(eCmdCreateVRegion) WX_MENU_ITEM(eCmdCreateVSegment) WX_MENU_ITEM(eCmdCreateVariation) WX_MENU_ITEM(eCmdCreateAssemblyGap) WX_END_SUBMENU() WX_SUBMENU("Batch Feature Apply") WX_MENU_ITEM(eCmdApplyCDS) WX_MENU_ITEM(eCmdApplyAddRNA) WX_MENU_ITEM(eCmdApplyAddOther) WX_MENU_ITEM(eCmdApplyFeatQual) WX_MENU_ITEM(eCmdApplySourceQual) WX_MENU_ITEM(eCmdApplyCGPQual) WX_MENU_ITEM(eCmdApplyRNAQual) WX_END_SUBMENU() WX_SUBMENU("Batch Feature Edit") WX_MENU_ITEM(eCmdEditFeatQual) WX_MENU_ITEM(eCmdEditSourceQual) WX_MENU_ITEM(eCmdEditCGPQual) WX_MENU_ITEM(eCmdEditRNAQual) WX_END_SUBMENU() WX_SUBMENU("Publications") WX_MENU_ITEM(eCmdCreateDescPub) WX_MENU_ITEM(eCmdCreatePubFeat) WX_END_SUBMENU() WX_SUBMENU("Descriptors") WX_MENU_ITEM(eCmdCreateDescTPAAssembly) WX_MENU_ITEM(eCmdCreateDescStructuredComment) WX_MENU_ITEM(eCmdCreateDescRefGeneTracking) WX_MENU_ITEM(eCmdCreateDescDBLink) WX_MENU_ITEM(eCmdCreateDescUnverified) WX_MENU_ITEM(eCmdCreateDescAuthorizedAccess) WX_MENU_ITEM(eCmdCreateDescGenomeAssemblyComment) WX_MENU_ITEM(eCmdCreateDescGenBankBlock) WX_MENU_ITEM(eCmdCreateDescComment) WX_MENU_ITEM(eCmdCreateDescTitle) WX_MENU_ITEM(eCmdCreateDescMolinfo) WX_MENU_ITEM(eCmdCreateDescSource) WX_END_SUBMENU() WX_MENU_ITEM(eCmdSortUniqueCountText) WX_END_SUBMENU() WX_END_MENU() const SwxMenuItemRec* CSeqEditPackage::GetMenuDef() const { return kEditingMenu; } void CSequenceEditingEventHandler::RemoveDescriptors(wxCommandEvent& evt) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveDescDlg dlg(NULL, m_TopSeqEntry); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) m_CmdProccessor->Execute(cmd); dlg.Close(); } } void CSequenceEditingEventHandler::RemoveFeatures(wxCommandEvent& evt) { if (!m_Workbench) return; wxWindow* main_window = NULL; CWorkbench* wb_frame = dynamic_cast<CWorkbench*>(m_Workbench); if (wb_frame) main_window = wb_frame->GetMainWindow(); CRemoveFeaturesDlg *dlg = new CRemoveFeaturesDlg(main_window, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::ApplyIndexerComments(wxCommandEvent& evt) { if (!m_Workbench) return; wxWindow* main_window = NULL; CWorkbench* wb_frame = dynamic_cast<CWorkbench*>(m_Workbench); if (wb_frame) main_window = wb_frame->GetMainWindow(); CApplyIndexerComments *dlg = new CApplyIndexerComments(main_window, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::RemoveAllFeatures(wxCommandEvent& evt) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; size_t count = 0; CRef<CCmdComposite> cmd = GetDeleteAllFeaturesCommand (m_TopSeqEntry, count); if (count > 0) { if (wxMessageBox(ToWxString("Are you sure you want to remove " + NStr::NumericToString(count) + " features?"), wxT("Are you sure?"), wxOK | wxCANCEL, NULL) == wxOK) { m_CmdProccessor->Execute(cmd); } } else { wxMessageBox(_("No features found!"), wxT("Error"), wxOK | wxICON_ERROR, NULL); } } void CSequenceEditingEventHandler::RemoveSeqAnnotIds( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveSeqAnnot worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Seq-Annot Ids",CSeq_annot::C_Data::e_Ids)) event.Skip(); } void CSequenceEditingEventHandler::RemoveBankitComment( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveBankitComment worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Bankit Comment")) event.Skip(); } void CSequenceEditingEventHandler::RemoveDuplicateStructuredComments( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveDuplicateStructuredComment worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Duplicate Structured Comment")) event.Skip(); } void CSequenceEditingEventHandler::RemoveSequencesFromAlignments( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveSeqFromAlignDlg dlg(NULL, m_TopSeqEntry); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) m_CmdProccessor->Execute(cmd); dlg.Close(); } } void CSequenceEditingEventHandler::RemoveSequences( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveSequencesCommandConverter* sequence_remover = new CRemoveSequencesCommandConverter(); CTblEditDlg dlg(NULL, m_TopSeqEntry, sequence_remover, NULL, SYMBOL_CTBLEDITDLG_IDNAME, SYMBOL_CTBLEDITDLG_TITLE, SYMBOL_CTBLEDITDLG_POSITION, SYMBOL_CTBLEDITDLG_SIZE, SYMBOL_CTBLEDITDLG_STYLE, wxT("Please select the sequences you would like to remove")); bool done = false; while (!done) { if (dlg.ShowModal() == wxID_OK) { sequence_remover->SetGrid(dlg.GetGrid()); CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); dlg.Close(); done = true; } else { wxString error = ToWxString(dlg.GetErrorMessage()); wxMessageBox(error, wxT("Error"), wxOK | wxICON_ERROR, NULL); } } else { done = true; } } } void CSequenceEditingEventHandler::RemoveSeqAnnotAlign( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveSeqAnnot worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Alignments",CSeq_annot::C_Data::e_Align)) event.Skip(); } void CSequenceEditingEventHandler::RemoveSeqAnnotGraph( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveSeqAnnot worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Graphs",CSeq_annot::C_Data::e_Graph)) event.Skip(); } void CSequenceEditingEventHandler::RemoveGenomeProjectsDB( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveGenomeProjectsDB worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove GenomeProjectsDB")) event.Skip(); } void CSequenceEditingEventHandler::RemoveEmptyGenomeProjectsDB( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveEmptyGenomeProjectsDB worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Empty GenomeProjectsDB")) event.Skip(); } void CSequenceEditingEventHandler::DoExtendedCleanup() { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CConstRef<CSeq_entry> entry = m_TopSeqEntry.GetCompleteSeq_entry(); CRef<CSeq_entry> copy(new CSeq_entry()); copy->Assign(*entry); CRef<CObjectManager> objmgr = CObjectManager::GetInstance(); CScope scope2(*objmgr); scope2.AddDefaults(); \ CSeq_entry_Handle seh = scope2.AddTopLevelSeqEntry(*copy); CCleanup cleanup; cleanup.SetScope(&scope2); // perform BasicCleanup and ExtendedCleanup try { CConstRef<CCleanupChange> changes = cleanup.BasicCleanup (const_cast<CSeq_entry& >(*copy), CCleanup::eClean_SyncGenCodes); changes = cleanup.ExtendedCleanup(seh, CCleanup::eClean_SyncGenCodes); } catch (CException& e) { LOG_POST(Error << "error in cleanup: " << e.GetMsg()); } CSeq_entry_EditHandle edit_handle = m_TopSeqEntry.GetEditHandle(); edit_handle.SelectNone(); if( copy->IsSeq() ) { edit_handle.SelectSeq( copy->SetSeq() ); } else if( copy->IsSet() ) { edit_handle.SelectSet( copy->SetSet() ); } } void CSequenceEditingEventHandler::TaxFixCleanup( wxCommandEvent& evt ) { DoExtendedCleanup(); if (evt.GetId() == eCmdTaxFixCleanup) { CRef<CCmdComposite> cmd = TaxonomyLookupCommand(m_TopSeqEntry); if (cmd) { m_CmdProccessor->Execute(cmd); } } } void CSequenceEditingEventHandler::DisableStrainForwarding( wxCommandEvent& evt ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> cmd = GetDisableStrainForwardingCommand(m_TopSeqEntry); if (cmd) { m_CmdProccessor->Execute(cmd); } } void CSequenceEditingEventHandler::EditPubs( wxCommandEvent& evt ) { CEditPubDlg * dlg = new CEditPubDlg(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::GlobalAuthorReplace( wxCommandEvent& evt ) { CGlobalAuthorReplaceDlg * dlg = new CGlobalAuthorReplaceDlg(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::FixCapitalizationAll( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CFixAllCap worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Fix All Capitalization")) event.Skip(); } void CSequenceEditingEventHandler::FixCapitalizationAuthors( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CFixAuthorCap worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Fix Author Capitalization")) event.Skip(); } void CSequenceEditingEventHandler::FixCapitalizationTitles( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CFixTitleCap worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Fix Title Capitalization")) event.Skip(); } void CSequenceEditingEventHandler::FixCapitalizationAffiliation( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CFixAffilCap worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Fix Affiliation Capitalization")) event.Skip(); } void CSequenceEditingEventHandler::FixCapitalizationCountry( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CFixCountryCap worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Fix Country Capitalization")) event.Skip(); } void CSequenceEditingEventHandler::RemoveUnpublishedPublications( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveUnpublishedPubs worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Delete Unpublished Publications")) event.Skip(); } void CSequenceEditingEventHandler::RemovePublishedPublications( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemovePublishedPubs worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Delete Published Publications")) event.Skip(); } void CSequenceEditingEventHandler::RemoveCollidingPublications( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveCollidingPubs worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Delete Colliding Publications")) event.Skip(); } void CSequenceEditingEventHandler::RemoveAllPublications( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveAllPubs worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Delete Colliding Publications")) event.Skip(); } void CSequenceEditingEventHandler::RemoveAuthorConsortiums( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveAuthorConsortium worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Author Consortiums")) event.Skip(); } void CSequenceEditingEventHandler::ReverseAuthorNames( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CReverseAuthorNames worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Reverse Author Last and First Name")) event.Skip(); } void CSequenceEditingEventHandler::StripAuthorSuffixes( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CStripAuthorSuffix worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Strip Author Suffixes")) event.Skip(); } void CSequenceEditingEventHandler::TruncateAuthorMiddleInitials( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CFixAuthorInitials worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Truncate Author Middle Initials")) event.Skip(); } void CSequenceEditingEventHandler::ConvertAuthorToConstortiumWhereLastName( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CConvertAuthorToConsortiumWhereConstraint worker; worker.SetConstraint("consortium"); if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Convert Author to Consortiums Where Last Name Contains Consortium")) event.Skip(); } void CSequenceEditingEventHandler::ConvertAuthorToConsortiumAll( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CConvertAllAuthorToConsortium worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Convert All Authors To Consortiums")) event.Skip(); } void CSequenceEditingEventHandler::AddCitSubForUpdate( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CAddCitSubForUpdate worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Add Cit-sub for update")) event.Skip(); } void CSequenceEditingEventHandler::FixUsaAndStates( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CFixUSA worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Fix USA and States")) event.Skip(); } void CSequenceEditingEventHandler::ResynchronizePartials( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CMiscSeqTableColumn> col(new CMiscSeqTableColumn("CDS comment")); vector<CConstRef<CObject> > objs = col->GetObjects(m_TopSeqEntry, "", CRef<edit::CStringConstraint>(NULL)); if (objs.size() == 0) { wxMessageBox(wxT("No coding regions found!"), wxT("Error"), wxOK | wxICON_ERROR, NULL); return; } bool any_change = false; CRef<CCmdComposite> cmd(new CCmdComposite("Resynch partials")); ITERATE(vector<CConstRef<CObject> >, it, objs) { const CSeq_feat* f = dynamic_cast<const CSeq_feat* >((*it).GetPointer()); CRef<CSeq_feat> new_feat(new CSeq_feat()); new_feat->Assign(*f); if (edit::AdjustFeaturePartialFlagForLocation(*new_feat)) { CSeq_feat_Handle fh = m_TopSeqEntry.GetScope().GetSeq_featHandle(*f); cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(fh, *new_feat))); any_change = true; } CRef<CCmdComposite> synch = GetSynchronizeProteinPartialsCommand(m_TopSeqEntry.GetScope(), *f); if (synch) { cmd->AddCommand(*synch); any_change = true; } } if (any_change) { m_CmdProccessor->Execute(cmd); } else { wxMessageBox(wxT("No effect!"), wxT("Error"), wxOK | wxICON_ERROR, NULL); } } void CSequenceEditingEventHandler::RetranslateCDS( wxCommandEvent& evt ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRetranslateCDS worker; switch (evt.GetId()) { case eCmdRetranslateCDSIgnoreStopExceptEnd : worker.apply( m_TopSeqEntry, m_CmdProccessor, "Retranslate coding regions", CRetranslateCDS::eRetranslateCDSIgnoreStopExceptEnd); break; case eCmdRetranslateCDSObeyStop : worker.apply( m_TopSeqEntry, m_CmdProccessor, "Retranslate coding regions", CRetranslateCDS::eRetranslateCDSObeyStop); break; case eCmdRetranslateCDSChooseFrame : worker.apply( m_TopSeqEntry, m_CmdProccessor, "Retranslate coding regions", CRetranslateCDS::eRetranslateCDSChooseFrame); break; default : break; } } void CSequenceEditingEventHandler::AddTranslExcept( wxCommandEvent& event ) { CAddTranslExceptDlg * dlg = new CAddTranslExceptDlg(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::RemoveAllStructuredComments( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveAllStructuredComment worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove All Structured Comments")) event.Skip(); } void CSequenceEditingEventHandler::RemoveEmptyStructuredComments( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveEmptyStructuredComment worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Empty Structured Comments")) event.Skip(); } void CSequenceEditingEventHandler::ModifyStructuredComment( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CModifyStructuredComment worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Structured Comment Field")) event.Skip(); } void CSequenceEditingEventHandler::RemoveStructuredCommentKeyword( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveStructuredCommentKeyword worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Structured Comment Keyword")) event.Skip(); } void CSequenceEditingEventHandler::AddStructuredCommentKeyword( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CAddStructuredCommentKeyword worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Add Structured Comment Keyword")) event.Skip(); } void CSequenceEditingEventHandler::AddGenomeAssemblyStructuredComment( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CSeqdesc> seqdesc(new CSeqdesc()); seqdesc->SetUser().Assign(*CGenomeAssemblyComment::MakeEmptyUserObject()); TConstScopedObjects objects; objects.push_back( SConstScopedObject(*seqdesc, m_TopSeqEntry.GetScope())); CSimpleProjectView :: CreateView("Edit Object Dialog View", CEditObjViewDlg::CreateDialogNew, m_Workbench, objects); } void CSequenceEditingEventHandler::ReorderStructuredComment( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CReorderStructuredComment worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Reorder Structured Comment")) event.Skip(); } void CSequenceEditingEventHandler::ConvertComment( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CConvertComment worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Convert Comment to Structured Comment", "::"," ")) event.Skip(); } void CSequenceEditingEventHandler::ParseComment( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CConvertComment worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Parse Comment to Structured Comment", "=",";")) event.Skip(); } void CSequenceEditingEventHandler::AssignFeatureIds( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CAssignFeatureId worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Assign Feature Ids")) event.Skip(); } void CSequenceEditingEventHandler::ClearFeatureIds( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CClearFeatureId worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Clear Feature Ids")) event.Skip(); } void CSequenceEditingEventHandler::ReassignFeatureIds( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CReassignFeatureId worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Reassign Feature Ids")) event.Skip(); } void CSequenceEditingEventHandler::UniqifyFeatureIds( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CUniqifyFeatureId worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Uniqify Feature Ids")) event.Skip(); } void CSequenceEditingEventHandler::TrimJunkInPrimerSeqs( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CPCRPrimerTrimJunk worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Trim Junk In Primer Seqs")) event.Skip(); } void CSequenceEditingEventHandler::FixiInPrimerSeqs( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CPCRPrimerFixI worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Fix i In Primer Seqs")) event.Skip(); } void CSequenceEditingEventHandler :: ItemAction(wxCommandEvent& event, CRef <CItem> item, const string& title) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; if (!(item.GetPointer()) || !(item->apply(m_TopSeqEntry, m_CmdProccessor, title)) ) event.Skip(); }; void CSequenceEditingEventHandler :: RemoveCddFeatDbxref(wxCommandEvent& event ) { ItemAction(event, CRef <CItem> (new CRmvCddFeatDbxref), "Remove All CDD Features and Dbxrefs"); }; void CSequenceEditingEventHandler :: PrefixAuthWithTax(wxCommandEvent& event ) { ItemAction(event, CRef <CItem> (new CPrefixAuthority), "Prefix Authority with Organism"); }; void CSequenceEditingEventHandler :: FocusSet(wxCommandEvent& event ) { ItemAction(event, CRef <CItem> (new CSrcFocusSet()), "Set"); }; void CSequenceEditingEventHandler :: FocusClear(wxCommandEvent& event ) { ItemAction(event, CRef <CItem> (new CSrcFocusClear()), "Clear"); }; void CSequenceEditingEventHandler :: SetTransgSrcDesc(wxCommandEvent& event ) { ItemAction(event, CRef <CItem> (new CSetTransgSrcDesc()), "Set Transgenic on Source Desc"); }; void CSequenceEditingEventHandler :: SplitDblinkQuals(wxCommandEvent& event ) { ItemAction(event, CRef <CItem> (new CSplitDblinkQuals()), "Split DBLink Quals at Commas"); }; void CSequenceEditingEventHandler::FixOrgModInstitution( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CFixOrgModInst worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Fix OrgMod Institution")) event.Skip(); } void CSequenceEditingEventHandler::SwapPrimerSeqName( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CSwapPrimerNameSeq worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Swap Primer Seq and Name")) event.Skip(); } void CSequenceEditingEventHandler::MergePrimerSets( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CMergePrimerSets worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Merge Primer Sets")) event.Skip(); } void CSequenceEditingEventHandler::SplitPrimerSets( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CSplitPrimerSets worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Split Primer Sets By Position")) event.Skip(); } void CSequenceEditingEventHandler::AppendModToOrg( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CAppendModToOrgDlg dlg(NULL, m_TopSeqEntry); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) m_CmdProccessor->Execute(cmd); dlg.Close(); } } void CSequenceEditingEventHandler::ParseCollectionDateMonthFirst( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CParseCollectionDateFormats worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Parse Collection Date Month First",true)) event.Skip(); } void CSequenceEditingEventHandler::ParseCollectionDateDayFirst( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CParseCollectionDateFormats worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Parse Collection Date Day First",false)) event.Skip(); } void CSequenceEditingEventHandler::CountryFixupCap( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CCountryFixup worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Country Fixup Fix Capitalization After Colon",true)) event.Skip(); } void CSequenceEditingEventHandler::CountryFixupNoCap( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CCountryFixup worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Country Fixup Do Not Fix Capitalization After Colon",false)) event.Skip(); } void CSequenceEditingEventHandler::VectorTrim( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || !m_CmdProccessor) return; wxWindow* main_window = NULL; CWorkbench* wb_frame = dynamic_cast<CWorkbench*>(m_Workbench); if (wb_frame) main_window = wb_frame->GetMainWindow(); CVectorTrimDlg* dlg = new CVectorTrimDlg(main_window, m_TopSeqEntry); dlg->Show(); } void CSequenceEditingEventHandler::SelectTarget( wxCommandEvent& event ) { CSelectTargetDlg * dlg = new CSelectTargetDlg(NULL, m_Workbench); dlg->Show(); } void CSequenceEditingEventHandler::AddCDS( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CBulkFeatureAddDlg dlg(NULL, m_TopSeqEntry, CSourceRequirements::eWizardType_standard, CSourceRequirements::eWizardSrcType_any, m_Workbench); dlg.ChooseFeatureType(CSeqFeatData::eSubtype_cdregion); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); } else { string errmsg = dlg.GetErrorMessage(); if (!NStr::IsBlank(errmsg)) { wxString error = ToWxString(errmsg); wxMessageBox(error, wxT("Error"), wxOK | wxICON_ERROR, NULL); } } dlg.Close(); } } void CSequenceEditingEventHandler::AddRNA( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CBulkFeatureAddDlg dlg(NULL, m_TopSeqEntry, CSourceRequirements::eWizardType_standard, CSourceRequirements::eWizardSrcType_any, m_Workbench); dlg.ChooseFeatureType(CSeqFeatData::eSubtype_rRNA); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); } else { string errmsg = dlg.GetErrorMessage(); if (!NStr::IsBlank(errmsg)) { wxString error = ToWxString(errmsg); wxMessageBox(error, wxT("Error"), wxOK | wxICON_ERROR, NULL); } } dlg.Close(); } } void CSequenceEditingEventHandler::AddOtherFeature( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CBulkFeatureAddDlg dlg(NULL, m_TopSeqEntry, CSourceRequirements::eWizardType_standard, CSourceRequirements::eWizardSrcType_any, m_Workbench); dlg.ChooseFeatureType(CSeqFeatData::eSubtype_gene); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); } else { string errmsg = dlg.GetErrorMessage(); if (!NStr::IsBlank(errmsg)) { wxString error = ToWxString(errmsg); wxMessageBox(error, wxT("Error"), wxOK | wxICON_ERROR, NULL); } } dlg.Close(); } } void CSequenceEditingEventHandler::Validate( wxCommandEvent& evt ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CObjectFor<TConstScopedObjects> > objects(new CObjectFor<TConstScopedObjects>); if (m_SeqSubmit) { objects->GetData().push_back(SConstScopedObject(*m_SeqSubmit, m_TopSeqEntry.GetScope())); } else { objects->GetData().push_back(SConstScopedObject(*(m_TopSeqEntry.GetCompleteObject()), m_TopSeqEntry.GetScope())); } if (!objects->GetData().front().object) return; static const string sViewType("Validate Table View"); CRef<CUser_object> params(new CUser_object()); switch (evt.GetId()) { case eCmdValidate: CTableDataValidateParams::SetDoAlignment(*params, true); CTableDataValidateParams::SetDoInference(*params, false); break; case eCmdValidateNoAlignments: CTableDataValidateParams::SetDoAlignment(*params, false); CTableDataValidateParams::SetDoInference(*params, false); break; case eCmdValidateCheckInferences: CTableDataValidateParams::SetDoAlignment(*params, true); CTableDataValidateParams::SetDoInference(*params, true); break; default: break; } CIRef<CProjectService> prjSrv = m_Workbench->GetServiceByType<CProjectService>(); CTableViewWithTextViewNav* pTableView(dynamic_cast<CTableViewWithTextViewNav*>(prjSrv->FindView(*objects->GetData().front().object, sViewType))); if (pTableView != 0) { prjSrv->ActivateProjectView(pTableView); //!! send this message only when it's known that validated data has been really changed, //!! otherwise unneeded validations may take place if(true) { // set parameters pTableView->SetParams(params.GetPointer()); // send a message to the validate view that is it should re-read it's data and refresh itself CEditTableEvent evt(CEvent::eEvent_Message, CEditTableEvent::eRefreshData); CEditTableEvent::TRefreshDataAttachment* attachment(new CEditTableEvent::TRefreshDataAttachment()); attachment->SetData(objects); evt.SetAttachment(attachment, CEvent::eRelease); pTableView->Send(&evt); } } else { prjSrv->AddProjectView(sViewType, objects->GetData(), params.GetPointer()); } } void CSequenceEditingEventHandler::SortUniqueCount( wxCommandEvent& evt ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; TConstScopedObjects objects; if (m_SeqSubmit) { objects.push_back(SConstScopedObject(*m_SeqSubmit, m_TopSeqEntry.GetScope())); } else { objects.push_back(SConstScopedObject(*(m_TopSeqEntry.GetCompleteObject()), m_TopSeqEntry.GetScope())); } if (!objects.front().object) return; int event_id = evt.GetId(); switch (event_id) { case eCmdSortUniqueCount: {{ static const string sViewType("SUC Table View"); CIRef<CProjectService> prjSrv = m_Workbench->GetServiceByType<CProjectService>(); IProjectView* projectView = prjSrv->FindView(*objects.front().object, sViewType); if (projectView != 0) { prjSrv->ActivateProjectView(projectView); } else { prjSrv->AddProjectView(sViewType, objects, 0, true); } }} break; case eCmdSortUniqueCountText: {{ IRefreshCntrl * suc_refresh = new CSUCRefreshCntrl(m_Workbench); CGenericReportDlg* report = new CGenericReportDlg(NULL); report->SetRefresh(suc_refresh); report->RefreshData(); report->Show(true); }} break; default: break; } } void CSequenceEditingEventHandler::MegaReport ( wxCommandEvent& event ) { if (!m_TopSeqEntry) return; TConstScopedObjects objects; objects.push_back(SConstScopedObject(*(m_TopSeqEntry.GetCompleteObject()), m_TopSeqEntry.GetScope())); CSimpleProjectView :: CreateView("Mega Report Dialog View", CMegaRepDlgVw::CreateDialog, m_Workbench, objects, new CDlgVwWithNavCmdHandler()); } void CSequenceEditingEventHandler :: OnCallerTool(wxCommandEvent& event) { if (!m_TopSeqEntry) return; TConstScopedObjects objects; objects.push_back(SConstScopedObject(*(m_TopSeqEntry.GetCompleteObject()), m_TopSeqEntry.GetScope())); CSimpleProjectView :: CreateView("Oncaller Tool Dialog View", COncallToolDlgVw::CreateDialog, m_Workbench, objects, new CDlgVwWithNavCmdHandler()); }; void CSequenceEditingEventHandler::DiscrepancyReport ( wxCommandEvent& event ) { if (!m_TopSeqEntry) return; TConstScopedObjects objects; objects.push_back( SConstScopedObject(*(m_TopSeqEntry.GetCompleteObject()), m_TopSeqEntry.GetScope())); CSimpleProjectView :: CreateView("Discrepancy Report Dialog View", CDiscRepDlgVw::CreateDialog, m_Workbench, objects, new CDlgVwWithNavCmdHandler()); } void CSequenceEditingEventHandler::TestDialogView( wxCommandEvent& /*event*/ ) { if (!m_TopSeqEntry) return; TConstScopedObjects objects; objects.push_back(SConstScopedObject(*(m_TopSeqEntry.GetCompleteObject()), m_TopSeqEntry.GetScope())); CSimpleProjectView::CreateView("Test Dialog View", CTestDialogView::CreateDialog, m_Workbench, objects); } void CSequenceEditingEventHandler::TestFormView( wxCommandEvent& /*event*/ ) { if (!m_TopSeqEntry) return; TConstScopedObjects objects; objects.push_back(SConstScopedObject(*(m_TopSeqEntry.GetCompleteObject()), m_TopSeqEntry.GetScope())); CSimpleProjectView::CreateView("Test Form View", CTextPanel::CreateForm, m_Workbench, objects); } void CSequenceEditingEventHandler::AddSequences( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CAddSequences worker; worker.apply(m_TopSeqEntry, m_CmdProccessor); } void CSequenceEditingEventHandler::x_HandleBulkCmdDlg (CBulkCmdDlg& dlg) { bool done = false; while (!done) { if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); dlg.Close(); done = true; } else { string error = dlg.GetErrorMessage(); if (!NStr::IsBlank(error)) { wxMessageBox(ToWxString(error), wxT("Error"), wxOK | wxICON_ERROR, NULL); } } } else { done = true; } } } void CSequenceEditingEventHandler::ApplyEditConvertRemove( wxCommandEvent& evt ) { CAECRDlg::EActionType action_type = CAECRDlg::eActionType_Unknown; CFieldNamePanel::EFieldType field_type = CFieldNamePanel::eFieldType_Unknown; switch (evt.GetId()) { case eCmdApplySourceQual: action_type = CAECRDlg::eActionType_Apply; field_type = CFieldNamePanel::eFieldType_Source; break; case eCmdEditSourceQual: action_type = CAECRDlg::eActionType_Edit; field_type = CFieldNamePanel::eFieldType_Source; break; case eCmdConvertSourceQual: action_type = CAECRDlg::eActionType_Convert; field_type = CFieldNamePanel::eFieldType_Source; break; case eCmdSwapSourceQual: action_type = CAECRDlg::eActionType_Swap; field_type = CFieldNamePanel::eFieldType_Source; break; case eCmdRemoveSourceQual: action_type = CAECRDlg::eActionType_Remove; field_type = CFieldNamePanel::eFieldType_Source; break; case eCmdApplyRNAQual: action_type = CAECRDlg::eActionType_Apply; field_type = CFieldNamePanel::eFieldType_RNA; break; case eCmdEditRNAQual: action_type = CAECRDlg::eActionType_Edit; field_type = CFieldNamePanel::eFieldType_RNA; break; case eCmdConvertRNAQual: action_type = CAECRDlg::eActionType_Convert; field_type = CFieldNamePanel::eFieldType_RNA; break; case eCmdSwapRNAQual: action_type = CAECRDlg::eActionType_Swap; field_type = CFieldNamePanel::eFieldType_RNA; break; case eCmdRemoveRNAQual: action_type = CAECRDlg::eActionType_Remove; field_type = CFieldNamePanel::eFieldType_RNA; break; case eCmdApplyCGPQual: action_type = CAECRDlg::eActionType_Apply; field_type = CFieldNamePanel::eFieldType_CDSGeneProt; break; case eCmdEditCGPQual: action_type = CAECRDlg::eActionType_Edit; field_type = CFieldNamePanel::eFieldType_CDSGeneProt; break; case eCmdConvertCGPQual: action_type = CAECRDlg::eActionType_Convert; field_type = CFieldNamePanel::eFieldType_CDSGeneProt; break; case eCmdSwapCGPQual: action_type = CAECRDlg::eActionType_Swap; field_type = CFieldNamePanel::eFieldType_CDSGeneProt; break; case eCmdRemoveCGPQual: action_type = CAECRDlg::eActionType_Remove; field_type = CFieldNamePanel::eFieldType_CDSGeneProt; break; case eCmdApplyFeatQual: action_type = CAECRDlg::eActionType_Apply; field_type = CFieldNamePanel::eFieldType_Feature; break; case eCmdEditFeatQual: action_type = CAECRDlg::eActionType_Edit; field_type = CFieldNamePanel::eFieldType_Feature; break; case eCmdConvertFeatQual: action_type = CAECRDlg::eActionType_Convert; field_type = CFieldNamePanel::eFieldType_Feature; break; case eCmdSwapFeatQual: action_type = CAECRDlg::eActionType_Swap; field_type = CFieldNamePanel::eFieldType_Feature; break; case eCmdRemoveFeatQual: action_type = CAECRDlg::eActionType_Remove; field_type = CFieldNamePanel::eFieldType_Feature; break; case eCmdRemoveTextOutsideString: action_type = CAECRDlg::eActionType_RemoveTextOutside; field_type = CFieldNamePanel::eFieldType_Misc; break; default: return; break; } CAECRDlg * dlg = new CAECRDlg(NULL, m_Workbench); dlg->SetInitParameters(action_type, field_type); dlg->Show(true); } void CSequenceEditingEventHandler::EditFeature( wxCommandEvent& evt ) { CBulkEditFeatDlg * dlg = new CBulkEditFeatDlg(NULL, m_Workbench); switch (evt.GetId()) { case eCmdEditFeatLoc: dlg->SetEditingType(CBulkEditFeatDlg::eLocation); break; case eCmdEditFeatEv: dlg->SetEditingType(CBulkEditFeatDlg::eEvidence); break; case eCmdEditFeatStrand: dlg->SetEditingType(CBulkEditFeatDlg::eStrand); break; case eCmdEditFeatRevInt: dlg->SetEditingType(CBulkEditFeatDlg::eRevInt); break; default: break; } dlg->Show(true); } void CSequenceEditingEventHandler::ParseText( wxCommandEvent& evt ) { CParseRecordDlg * dlg = new CParseRecordDlg(NULL, m_Workbench); switch (evt.GetId()) { case eCmdParseTextFromDefline: dlg->SetFromFieldType(CFieldNamePanel::eFieldType_Misc); break; case eCmdParseLocalToSrc: dlg->SetFromFieldType(CFieldNamePanel::eFieldType_SeqId); dlg->SetToFieldType(CFieldNamePanel::eFieldType_Source); break; default: break; } dlg->Show(true); } void CSequenceEditingEventHandler::ConvertFeatures( wxCommandEvent& evt ) { CConvertFeatDlg * dlg = new CConvertFeatDlg(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::x_TableReaderCommon(CIRef<IObjectLoader> object_loader, CQualTableLoadManager& qual_mgr, const wxString& msg) { if (!object_loader) { wxMessageBox(wxT("Failed to get object loader"), wxT("Error"), wxOK | wxICON_ERROR); return; } else { IExecuteUnit* execute_unit = dynamic_cast<IExecuteUnit*>(object_loader.GetPointer()); if (execute_unit) { if (!execute_unit->PreExecute()) return; CExecuteUnitAsyncCall call(*execute_unit, msg); CAsyncCall::Execute(call); if (!call.GetResult()) // Canceled return; if (!execute_unit->PostExecute()) return; } } const IObjectLoader::TObjects& objects = object_loader->GetObjects(); ITERATE(IObjectLoader::TObjects, obj_it, objects) { const CObject& ptr = obj_it->GetObject(); const objects::CSeq_annot* annot = dynamic_cast<const objects::CSeq_annot*>(&ptr); if (annot && annot->IsSeq_table()) { try { CRef<objects::CSeq_table> input_table (new objects::CSeq_table()); input_table->Assign(annot->GetData().GetSeq_table()); CRef<objects::CUser_object> column_properties(new objects::CUser_object); // Get user data from seqannot const CUser_object* ud = NULL; if (annot->CanGetDesc()) { const CSeq_annot::TDesc& annot_desc = annot->GetDesc(); if (annot_desc.CanGet()) { const CAnnot_descr_Base::Tdata& desc_list_data = annot_desc.Get(); CAnnot_descr_Base::Tdata::const_iterator tditer = desc_list_data.begin(); for (; tditer!=desc_list_data.end(); ++tditer) { if ( (*tditer)->IsUser() ) break; } if (tditer != desc_list_data.end()) { // Get User data from Annot Descriptor this is the Properties data // structure, where each entry is a combination of column number // and field properties, e.g. // Column.1 &xtype=StartPosition &one_based=true ud = &(*tditer)->GetUser(); } } } if (ud != NULL) column_properties->Assign(*ud); CRef<CSeq_table> mail_report(NULL); if (qual_mgr.ShouldMakeMailReport()) { mail_report = edit::MakeMailReportPreReport(m_TopSeqEntry); } CRef<CCmdComposite> cmd = ApplyMiscSeqTableToSeqEntry(input_table, m_TopSeqEntry, column_properties); if (cmd) { m_CmdProccessor->Execute(cmd); } else { wxMessageBox(wxT("Unable to apply table"), wxT("Error"), wxOK | wxICON_ERROR, NULL); } if (mail_report) { cmd = TaxonomyLookupCommand(m_TopSeqEntry); if (cmd) { m_CmdProccessor->Execute(cmd); } edit::MakeMailReportPostReport(*mail_report, m_TopSeqEntry.GetScope()); CGenericReportDlg* report = new CGenericReportDlg(NULL); report->SetTitle(wxT("Organism Change Report")); report->SetText(ToWxString(edit::GetReportFromMailReportTable(*mail_report))); report->Show(true); } } catch (CException& e) { wxMessageBox(e.GetMsg(), wxT("Error"), wxOK | wxICON_ERROR, NULL); } } } } void CSequenceEditingEventHandler::TableReader( wxCommandEvent& evt ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CQualTableLoadManager* qual_mgr = NULL; CRef<CFileLoadWizard> fileManager(new CFileLoadWizard()); vector<string> format_ids; format_ids.push_back("file_loader_qual_table"); fileManager->LoadFormats(format_ids); for( size_t i = 0; i < fileManager->GetFormatManagers().size(); ++i ) { const IFileLoadPanelClient* mgr = fileManager->GetFormatManagers()[0].GetPointerOrNull(); if ("file_loader_qual_table" == mgr->GetFileLoaderId()) { const CQualTableLoadManager* const_qual_mgr = dynamic_cast<const CQualTableLoadManager*>(mgr); if (const_qual_mgr) { qual_mgr = const_cast<CQualTableLoadManager*>(const_qual_mgr); qual_mgr->SetTopLevelEntry(m_TopSeqEntry); qual_mgr->SetServiceLocator(m_Workbench); } } } vector<CIRef<IOpenObjectsPanelClient> > loadManagers; loadManagers.push_back(CIRef<IOpenObjectsPanelClient>(fileManager.GetPointer())); COpenObjectsDlg dlg(NULL); dlg.SetSize(710, 480); dlg.SetRegistryPath("Dialogs.Edit.OpenTables"); dlg.SetManagers(loadManagers); if (dlg.ShowModal() == wxID_OK) { CIRef<IObjectLoader> object_loader(dlg.GetObjectLoader()); x_TableReaderCommon(object_loader, *qual_mgr, wxT("Reading file(s)...")); } } void CSequenceEditingEventHandler::TableReaderClipboard( wxCommandEvent& evt ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CQualTableLoadManager* qual_mgr = NULL; vector< CIRef<IFileLoadPanelClientFactory> > file_formats; GetExtensionAsInterface("file_load_panel_client", file_formats); CIRef<IFileLoadPanelClient> format_manager; for (size_t i = 0; i < file_formats.size(); ++i) { if (file_formats[i]->GetFileLoaderId() == "file_loader_qual_table") { format_manager.Reset(file_formats[i]->CreateInstance()); if ("file_loader_qual_table" == format_manager->GetFileLoaderId()) { const CQualTableLoadManager* const_qual_mgr = dynamic_cast<const CQualTableLoadManager*>(format_manager.GetPointer()); if (const_qual_mgr) { qual_mgr = const_cast<CQualTableLoadManager*>(const_qual_mgr); qual_mgr->SetTopLevelEntry(m_TopSeqEntry); qual_mgr->SetServiceLocator(m_Workbench); } } } } string fname; { wxTextDataObject data; wxTheClipboard->GetData( data ); if (data.GetText().length() == 0) { wxMessageBox("No data in clipboard for table"); return; } CTmpFile f(CTmpFile::eNoRemove); f.AsOutputFile(CTmpFile::eIfExists_ReturnCurrent) << data.GetText(); fname = f.GetFileName(); } vector<wxString> fnames; fnames.push_back(ToWxString(fname)); // This also causes windows to be created it seems, and so it must happen after // create is called.... qual_mgr->SetFilenames(fnames); COpenDataSourceObjectDlg dlg(NULL, CIRef<IUIToolManager>(qual_mgr)); dlg.SetSize(780, 540); dlg.SetRegistryPath("Dialogs.Edit.OpenTables"); CFile tmp_file(fname); tmp_file.Remove(); if (dlg.ShowModal() == wxID_OK) { CIRef<IObjectLoader> object_loader(dlg.GetObjectLoader()); x_TableReaderCommon(object_loader, *qual_mgr, wxT("Reading from clipboard(s)...")); } } void CSequenceEditingEventHandler::BulkEdit( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; try { SrcEditDialog dlg(NULL, m_TopSeqEntry, m_Workbench, m_SeqSubmit, CSourceRequirements::eWizardType_standard, CSourceRequirements::eWizardSrcType_any); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); m_CmdProccessor->Execute(cmd); //dlg.Close(); } } catch (CException&) {} } void CSequenceEditingEventHandler::BulkCdsEdit( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CSeq_entry_Handle seh = m_TopSeqEntry; vector<CRef<CSeq_loc> > &locs = x_GetSelectedLocations(); if (!locs.empty()) { try { seh = m_TopSeqEntry.GetScope().GetBioseqHandle(*locs.front()).GetParentBioseq_set().GetParentEntry(); } catch (CException&) {} } try { CBulkCDS dlg(NULL, seh,m_Workbench, m_SeqSubmit); bool done = false; while (!done) { if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); //dlg.Close(); done = true; } else { wxString error = ToWxString(dlg.GetErrorMessage()); wxMessageBox(error, wxT("Error"), wxOK | wxICON_ERROR, NULL); } } else { done = true; } } } catch (CException&) {} } void CSequenceEditingEventHandler::BulkGeneEdit( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CSeq_entry_Handle seh = m_TopSeqEntry; vector<CRef<CSeq_loc> > &locs = x_GetSelectedLocations(); if (!locs.empty()) { try { seh = m_TopSeqEntry.GetScope().GetBioseqHandle(*locs.front()).GetParentBioseq_set().GetParentEntry(); } catch (CException&) {} } try { CBulkGene dlg(NULL, seh,m_Workbench, m_SeqSubmit); bool done = false; while (!done) { if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); //dlg.Close(); done = true; } else { wxString error = ToWxString(dlg.GetErrorMessage()); wxMessageBox(error, wxT("Error"), wxOK | wxICON_ERROR, NULL); } } else { done = true; } } } catch (CException&) {} } void CSequenceEditingEventHandler::BulkRnaEdit( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CSeq_entry_Handle seh = m_TopSeqEntry; vector<CRef<CSeq_loc> > &locs = x_GetSelectedLocations(); if (!locs.empty()) { try { seh = m_TopSeqEntry.GetScope().GetBioseqHandle(*locs.front()).GetParentBioseq_set().GetParentEntry(); } catch (CException&) {} } try { CBulkRna dlg(NULL, seh,m_Workbench, m_SeqSubmit); bool done = false; while (!done) { if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); //dlg.Close(); done = true; } else { wxString error = ToWxString(dlg.GetErrorMessage()); wxMessageBox(error, wxT("Error"), wxOK | wxICON_ERROR, NULL); } } else { done = true; } } } catch (CException&) {} } void CSequenceEditingEventHandler::MolInfoEdit(wxCommandEvent& evt) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CMolInfoEditDlg dlg(NULL, m_TopSeqEntry); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); } dlg.Close(); } } void CSequenceEditingEventHandler::CorrectGenes( wxCommandEvent& event ) { CCorrectGenesDialog * dlg = new CCorrectGenesDialog(NULL, m_Workbench); dlg->Show(true); } static bool CompLoc(CRef<CSeq_loc> first, CRef<CSeq_loc> second) { return first->Compare(*second); } static bool EqualLoc(CRef<CSeq_loc> first, CRef<CSeq_loc> second) { return first->Equals(*second); } void CSequenceEditingEventHandler::Autodef(wxCommandEvent& evt) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; int event_id = evt.GetId(); switch (event_id) { case eCmdAutodefDefaultOptions: { SAutodefParams params; ConfigureAutodefParamsForBestCombo(params, m_TopSeqEntry); CRef<CCmdComposite> cmd = AutodefSeqEntry(m_TopSeqEntry, &params); m_CmdProccessor->Execute(cmd); } break; case eCmdAutodefOptions: { SAutodefParams params; ConfigureAutodefParamsForBestCombo(params, m_TopSeqEntry); CAutodefDlg dlg(NULL); dlg.SetParams(&params); if (dlg.ShowModal() == wxID_OK) { dlg.PopulateParams(params); CRef<CCmdComposite> cmd(NULL); if (dlg.OnlyTargeted()) { vector<CRef<CSeq_loc> > &orig_locs = x_GetSelectedLocations(); vector<CRef<CSeq_loc> > cpy = orig_locs; vector<CRef<CSeq_loc> >::iterator lit = cpy.begin(); while (lit != cpy.end()) { CBioseq_Handle b = m_TopSeqEntry.GetScope().GetBioseqHandle(**lit); if (!b || b.IsAa()) { lit = cpy.erase(lit); } else { ++lit; } } if (cpy.empty()) { dlg.Close(); return; } stable_sort(cpy.begin(), cpy.end(), CompLoc); cpy.erase( unique( cpy.begin(), cpy.end(), EqualLoc), cpy.end() ); cmd.Reset(new CCmdComposite("Autodef")); ITERATE(vector<CRef<CSeq_loc> >, b, cpy) { CBioseq_Handle bsh = m_TopSeqEntry.GetScope().GetBioseqHandle(**b); CRef<CCmdComposite> subcmd = AutodefSeqEntry(m_TopSeqEntry, bsh, &params); if (subcmd) { cmd->AddCommand(*subcmd); } } } else { cmd = AutodefSeqEntry(m_TopSeqEntry, &params); } m_CmdProccessor->Execute(cmd); dlg.Close(); } } break; case eCmdAutodefMisc: { SAutodefParams params; ConfigureAutodefParamsForBestCombo(params, m_TopSeqEntry); params.m_MiscFeatRule = 1; CRef<CCmdComposite> cmd = AutodefSeqEntry(m_TopSeqEntry, &params); m_CmdProccessor->Execute(cmd); } break; case eCmdAutodefId: { SAutodefParams params; ConfigureAutodefParamsForID(params, m_TopSeqEntry); CRef<CCmdComposite> cmd = AutodefSeqEntry(m_TopSeqEntry, &params); m_CmdProccessor->Execute(cmd); } break; case eCmdAutodefNoMods: { SAutodefParams params; CRef<CCmdComposite> cmd = AutodefSeqEntry(m_TopSeqEntry, &params); m_CmdProccessor->Execute(cmd); } break; case eCmdAutodefPopset: { SAutodefParams params; ConfigureAutodefParamsForBestCombo(params, m_TopSeqEntry); CAutodefDlg dlg(NULL); dlg.SetParams(&params); dlg.ShowSourceOptions(false); if (dlg.ShowModal() == wxID_OK) { dlg.PopulateParams(params); CRef<CCmdComposite> cmd = AutodefSeqEntry(m_TopSeqEntry, &params, true); m_CmdProccessor->Execute(cmd); dlg.Close(); } } break; } } void CSequenceEditingEventHandler::PT_Cleanup (wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> cmd = InstantiateProteinTitles(m_TopSeqEntry); if (cmd) { m_CmdProccessor->Execute(cmd); } } void CSequenceEditingEventHandler::ParseStrainSerotypeFromNames (wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CStrainSerotypeInfluenza worker(CStrainSerotypeInfluenza::eCommandInfluenza_parse); CRef<CCmdComposite> composite (new CCmdComposite("Parse Strain Serotype from Names")); int nr_conflicts = 0; worker.SetIsParsable() = false; // if there is at least one seq which can be parsed, this will be TRUE worker.TestSeqEntryForParsing (m_TopSeqEntry, nr_conflicts); if (worker.GetIsParsable()){ // if the Seq_entry is parsable bool update; if (nr_conflicts > 0){ string error = NStr::NumericToString(nr_conflicts)+" affected fields already contain a value. Do you wish to overwrite existing text?"; int answer = wxMessageBox (ToWxString(error), ToWxString("Warning"), wxYES_NO | wxCANCEL | wxICON_QUESTION); switch (answer){ case wxYES: update = true; worker.DoParsingOnSeqEntry (m_TopSeqEntry, composite, update); m_CmdProccessor->Execute(composite.GetPointer()); break; case wxNO: update = false; worker.DoParsingOnSeqEntry (m_TopSeqEntry, composite, update); m_CmdProccessor->Execute(composite.GetPointer()); break; case wxCANCEL: event.Skip(); break; } } else if (nr_conflicts == 0){ update = false; worker.DoParsingOnSeqEntry (m_TopSeqEntry, composite, update); m_CmdProccessor->Execute(composite.GetPointer()); } } else event.Skip(); } void CSequenceEditingEventHandler::AddStrainSerotypeToNames (wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CStrainSerotypeInfluenza worker(CStrainSerotypeInfluenza::eCommandInfluenza_add); if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Add Strain Serotype to Names")) event.Skip(); } void CSequenceEditingEventHandler::FixupOrganismNames (wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CStrainSerotypeInfluenza worker(CStrainSerotypeInfluenza::eCommandInfluenza_fixup); if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Fixup Organism Names")) event.Skip(); } void CSequenceEditingEventHandler::SplitQualifiersAtCommas (wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CStrainSerotypeInfluenza worker(CStrainSerotypeInfluenza::eCommandSplitQualsAtCommas); if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Split Quals at Commas")) event.Skip(); } void CSequenceEditingEventHandler::SplitStructuredCollections (wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CStrainSerotypeInfluenza worker(CStrainSerotypeInfluenza::eCommandSplitStructuredCollections); if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Split Structured Collections at Semicolon")) event.Skip(); } void CSequenceEditingEventHandler::TrimOrganismNames (wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CStrainSerotypeInfluenza worker(CStrainSerotypeInfluenza::eCommandTrimOrganismNames); if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Trim Organism Names")) event.Skip(); } void CSequenceEditingEventHandler::AddNamedrRNA (wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; string rna_name; switch (event.GetId()){ case eCmdAddNamedrRNA12S: rna_name = "12S ribosomal RNA"; break; case eCmdAddNamedrRNA16S: rna_name = "16S ribosomal RNA"; break; case eCmdAddNamedrRNA23S: rna_name = "23S ribosomal RNA"; break; case eCmdAddNamedrRNA18S: rna_name = "18S ribosomal RNA"; break; case eCmdAddNamedrRNA28S: rna_name = "28S ribosomal RNA"; break; case eCmdAddNamedrRNA26S: rna_name = "26S ribosomal RNA"; break; case eCmdAddNamedrRNASmall: rna_name = "small subunit ribosomal RNA"; break; case eCmdAddNamedrRNALarge: rna_name = "large subunit ribosomal RNA"; break; case eCmdAdd16S: rna_name = "16S ribosomal RNA"; break; case eCmdAdd18S: rna_name = "18S ribosomal RNA"; break; case eCmdAdd23S: rna_name = "23S ribosomal RNA"; break; } bool ispartial5 = true; bool ispartial3 = true; // feature partial on both ends CRef<CCmdComposite> composite = AddNamedrRna(m_TopSeqEntry, rna_name, ispartial5, ispartial3); if (composite){ m_CmdProccessor->Execute(composite); } else event.Skip(); } void CSequenceEditingEventHandler::AddControlRegion ( wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> composite = CreateControlRegion(m_TopSeqEntry); if (composite){ m_CmdProccessor->Execute(composite); } else event.Skip(); } void CSequenceEditingEventHandler::AddMicrosatellite ( wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> composite = CreateMicrosatellite(m_TopSeqEntry); if (composite){ m_CmdProccessor->Execute(composite); } else event.Skip(); } bool CSequenceEditingEventHandler::x_IsLocationOkForFeatCmd(int cmd, CRef<CSeq_loc> loc) { bool rval = false; if (cmd >= kStartAnyLoc && cmd <= kEndAnyLoc) { rval = true; } else { bool isAa = false; map<CRef<CSeq_loc>,bool>::iterator f = m_CachedLocationIsAa.find(loc); if (f != m_CachedLocationIsAa.end() && f->second) isAa = true; if (isAa) { if (cmd >= kStartProtOnly && cmd <= kEndProtOnly) { rval = true; } } else { if (cmd >= kStartNucOnly && cmd <= kEndNucOnly) { rval = true; } } } return rval; } void CSequenceEditingEventHandler::CreateFeature ( wxCommandEvent& evt) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; vector<CRef<CSeq_loc> > &orig_locs = x_GetSelectedLocations(); if (orig_locs.empty()) { return; } vector<CRef<CSeq_loc> > cpy = orig_locs; stable_sort(cpy.begin(), cpy.end(), CompLoc); cpy.erase( unique( cpy.begin(), cpy.end(), EqualLoc), cpy.end() ); ITERATE(vector<CRef<CSeq_loc> >, lit, cpy) { if (!x_IsLocationOkForFeatCmd(evt.GetId(), *lit)) { continue; } CSeqFeatData::ESubtype subtype = GetKeyFromCmdID(evt.GetId()); CRef<CSeq_feat> feat = MakeDefaultFeature(subtype); feat->SetLocation().Assign(**lit); CBioseq_Handle bsh = m_TopSeqEntry.GetScope().GetBioseqHandle(**lit); CSeq_entry_Handle seh = bsh.GetSeq_entry_Handle(); TConstScopedObjects objects; objects.push_back( SConstScopedObject(*feat, m_TopSeqEntry.GetScope())); CSimpleProjectView :: CreateView("Edit Object Dialog View", CEditObjViewDlg::CreateDialogNew, m_Workbench, objects); } } void CSequenceEditingEventHandler::CreateDescriptor ( wxCommandEvent& evt) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CSeqdesc> seqdesc(new CSeqdesc()); switch (evt.GetId()) { case eCmdCreateDescTPAAssembly: seqdesc->SetUser().SetType().SetStr("TpaAssembly"); break; case eCmdCreateDescStructuredComment: seqdesc->SetUser().SetObjectType(CUser_object::eObjectType_StructuredComment); break; case eCmdCreateDescRefGeneTracking: seqdesc->SetUser().SetType().SetStr("RefGeneTracking"); break; case eCmdCreateDescDBLink: seqdesc->SetUser().SetObjectType(CUser_object::eObjectType_DBLink); break; case eCmdCreateDescUnverified: seqdesc->SetUser().SetObjectType(CUser_object::eObjectType_Unverified); break; case eCmdCreateDescAuthorizedAccess: seqdesc->SetUser().SetType().SetStr("AuthorizedAccess"); break; case eCmdCreateDescGenomeAssemblyComment: seqdesc->SetUser().Assign(*CGenomeAssemblyComment::MakeEmptyUserObject()); break; case eCmdCreateDescGenBankBlock: seqdesc->SetGenbank(); break; case eCmdCreateDescComment: seqdesc->SetComment(); break; case eCmdCreateDescTitle: seqdesc->SetTitle(); break; case eCmdCreateDescMolinfo: seqdesc->SetMolinfo(); break; case eCmdCreateDescSource: {{ CRef<CBioSource> bioSource(new CBioSource()); seqdesc->SetSource(*bioSource); }} break; case eCmdCreateDescPub: {{ CRef<CPubdesc> pubdesc(new CPubdesc()); seqdesc->SetPub(*pubdesc); }} break; default: break; } TConstScopedObjects objects; objects.push_back( SConstScopedObject(*seqdesc, m_TopSeqEntry.GetScope())); CSimpleProjectView :: CreateView("Edit Object Dialog View", CEditObjViewDlg::CreateDialogNew, m_Workbench, objects); } void CSequenceEditingEventHandler::RemoveUnverified( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemoveUnverified worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Univerified")) event.Skip(); } void CSequenceEditingEventHandler::AddDefLine ( wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CAddDefLineDlg *dlg = new CAddDefLineDlg(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::RemoveDefLines ( wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> composite(new CCmdComposite("Removing DefLines")); if (composite){ RemoveTitlesSeqEntry(m_TopSeqEntry, *(m_TopSeqEntry.GetCompleteSeq_entry()), composite); m_CmdProccessor->Execute(composite); CAddDefLineDlg *dlg = new CAddDefLineDlg(NULL, m_Workbench); dlg->Show(true); }else event.Skip(); } void CSequenceEditingEventHandler::PrefixDefLines ( wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; bool show_label = true; switch (event.GetId()){ case eCmdPrefixOrgToDefLine:{ CRef<CCmdComposite> composite(new CCmdComposite("Prefix Organism Name to Definition Line")); if (AddOrgToDefline(m_TopSeqEntry, composite)) m_CmdProccessor->Execute(composite); break; } case eCmdPrefixStrainToDefLine:{ CRef<CCmdComposite> composite(new CCmdComposite("Prefix Strain to Definition Line")); CAutoDefAvailableModifier modifier(COrgMod::eSubtype_strain, true); if (AddModToDefline(m_TopSeqEntry, composite, modifier, show_label)) m_CmdProccessor->Execute(composite); break; } case eCmdPrefixCloneToDefLine:{ CRef<CCmdComposite> composite(new CCmdComposite("Prefix Clone to Definition Line")); CAutoDefAvailableModifier modifier(CSubSource::eSubtype_clone, false); if (AddModToDefline(m_TopSeqEntry, composite, modifier, show_label)) m_CmdProccessor->Execute(composite); break; } case eCmdPrefixIsolateToDefLine:{ CRef<CCmdComposite> composite(new CCmdComposite("Prefix Isolate to Definition Line")); CAutoDefAvailableModifier modifier(COrgMod::eSubtype_isolate, true); if (AddModToDefline(m_TopSeqEntry, composite, modifier, show_label)) m_CmdProccessor->Execute(composite); break; } case eCmdPrefixHaplotToDefLine:{ CRef<CCmdComposite> composite(new CCmdComposite("Prefix Haplotype to Definition Line")); CAutoDefAvailableModifier modifier(CSubSource::eSubtype_haplotype, false); if (AddModToDefline(m_TopSeqEntry, composite, modifier, show_label)) m_CmdProccessor->Execute(composite); break; } case eCmdPrefixCultivarToDefLine:{ CRef<CCmdComposite> composite(new CCmdComposite("Prefix Cultivar to Definition Line")); CAutoDefAvailableModifier modifier(COrgMod::eSubtype_cultivar, true); if (AddModToDefline(m_TopSeqEntry, composite, modifier, show_label)) m_CmdProccessor->Execute(composite); break; } case eCmdPrefixListToDefLine:{ SAutodefParams params; unsigned int found = ConfigureParamsForPrefixCombo(params, m_TopSeqEntry); CPrefixDeflinedlg dlg(NULL, m_TopSeqEntry, found); if (found > 0){ dlg.SetParams(&params); dlg.PopulateModifierCombo(); } if (dlg.ShowModal() == wxID_OK){ CRef<CCmdComposite> composite = dlg.GetCommand(); if (composite){ m_CmdProccessor->Execute(composite); } dlg.Close(); } break; } } } void CSequenceEditingEventHandler::MakeBadSpecificHostTable(wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; validator::TSpecificHostWithParentList host_list; bool badhosts = AreBadSpecificHostValues (m_TopSeqEntry, host_list); if (!badhosts) { wxMessageBox(ToWxString("No bad specific-host values found!"),ToWxString("Message"), wxOK | wxICON_INFORMATION); } else { CMakeBadSpecificHost_dlg* dlg = new CMakeBadSpecificHost_dlg(NULL); dlg->WriteBadSpecificHostTable(host_list); dlg->Show(true); } } void CSequenceEditingEventHandler::CorrectRNAStrand(wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CCorrectRNAStrandDlg* dlg = new CCorrectRNAStrandDlg(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::ApplyRNA_ITS ( wxCommandEvent& event) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CApplyRNAITSDlg *dlg = new CApplyRNAITSDlg(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::EditingButtons ( wxCommandEvent& event ) { wxWindow* main_window = NULL; CWorkbench* wb_frame = dynamic_cast<CWorkbench*>(m_Workbench); if (wb_frame) main_window = wb_frame->GetMainWindow(); CEditingBtnsPanel * dlg = new CEditingBtnsPanel(main_window, m_Workbench); dlg->Show(true); dlg->SetFrameAndPosition(); dlg->PlaceButtons(); } void CSequenceEditingEventHandler::TrimNs( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CTrimN worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Trim Ns")) event.Skip(); } void CSequenceEditingEventHandler::LabelRna( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CLabelRna worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Label RNA")) event.Skip(); } void CSequenceEditingEventHandler::RemProtTitles( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRemProtTitles worker; if (!worker.apply(m_TopSeqEntry,m_CmdProccessor,"Remove Protein Titles")) event.Skip(); } void CSequenceEditingEventHandler::ListMacroButtonNames( wxCommandEvent& event) { CDisplayMacros_dlg* dlg = new CDisplayMacros_dlg(NULL); dlg->Show(true); } void CSequenceEditingEventHandler::SegregateSets( wxCommandEvent& event ) { CSegregateSets dlg(NULL, m_TopSeqEntry); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) m_CmdProccessor->Execute(cmd); } } void CSequenceEditingEventHandler::SequesterSets( wxCommandEvent& event ) { wxWindow* main_window = NULL; CWorkbench* wb_frame = dynamic_cast<CWorkbench*>(m_Workbench); if (wb_frame) main_window = wb_frame->GetMainWindow(); CSequesterSets * dlg = new CSequesterSets(main_window, m_TopSeqEntry, m_SeqSubmit, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::WithdrawSequences( wxCommandEvent& event ) { CWithdrawSequences dlg(NULL, m_TopSeqEntry); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); event.SetId(eCmdValidate); Validate(event); } } } void CSequenceEditingEventHandler::AddSet( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CChooseSetClassDlg dlg(NULL); if (dlg.ShowModal() == wxID_OK) { CBioseq_set::EClass new_class = dlg.GetClass(); CRef<CCmdInsertBioseqSet> cmd(new CCmdInsertBioseqSet(m_TopSeqEntry, new_class)); if (cmd) m_CmdProccessor->Execute(cmd); } } void CSequenceEditingEventHandler::ConvertSetType( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; if (!m_TopSeqEntry.IsSet()) { return; } CConvertSetTypeDlg dlg(NULL, m_TopSeqEntry.GetCompleteSeq_entry()->GetSet()); if (dlg.ShowModal() == wxID_OK) { bool error = false; CRef<CCmdComposite> cmd = dlg.GetCommand(m_TopSeqEntry.GetScope(), m_TopSeqEntry.GetCompleteSeq_entry()->GetSet(), error); if (error) { wxMessageBox(wxT("Set structure no longer matches"), wxT("Error"), wxOK | wxICON_ERROR, NULL); } else if (cmd) { m_CmdProccessor->Execute(cmd); } else { wxMessageBox(wxT("No changes requested"), wxT("Error"), wxOK | wxICON_ERROR, NULL); } } } void CSequenceEditingEventHandler::PropagateDBLink( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> cmd = GetPropagateDBLinkCmd(m_TopSeqEntry); if (cmd) m_CmdProccessor->Execute(cmd); } void CSequenceEditingEventHandler::MacroEditor( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CMacroEdit_dlg dlg(NULL); if (dlg.ShowModal() == wxID_OK){ CSeq_submit* submit = const_cast<CSeq_submit*>(m_SeqSubmit.GetPointerOrNull()); dlg.OnRun(m_TopSeqEntry, m_Workbench, CRef<CSeq_submit>(submit), m_CmdProccessor); } } void CSequenceEditingEventHandler::RevCompSequences( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRevCompSequencesDlg dlg(NULL, m_TopSeqEntry); if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) m_CmdProccessor->Execute(cmd); } } void CSequenceEditingEventHandler::BioseqFeatsRevComp( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRevCompSequencesDlg dlg(NULL, m_TopSeqEntry); dlg.apply(m_TopSeqEntry,m_CmdProccessor,"BioseqFeatsRevComp"); } void CSequenceEditingEventHandler::UnculTaxTool( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; wxWindow* main_window = NULL; CWorkbench* wb_frame = dynamic_cast<CWorkbench*>(m_Workbench); if (wb_frame) main_window = wb_frame->GetMainWindow(); try { CUnculTaxTool *dlg = new CUnculTaxTool(main_window, m_TopSeqEntry, m_Workbench); dlg->Show(true); } catch (CException&) {} } void CSequenceEditingEventHandler::ExtendPartialsConstr( wxCommandEvent& evt ) { CExtendPartialFeatDlg * dlg = new CExtendPartialFeatDlg(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::ExtendPartialsAll( wxCommandEvent& evt ) { CExtendPartialFeatDlg * dlg = new CExtendPartialFeatDlg(NULL, m_Workbench); dlg->ApplyToAllAndDie(); } void CSequenceEditingEventHandler::ConvertCdsToMiscFeat( wxCommandEvent& evt ) { CConvertCdsToMiscFeat * dlg = new CConvertCdsToMiscFeat(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::AddFluComments( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CAddFluComments worker; worker.apply(m_TopSeqEntry,m_CmdProccessor,"Add Flu Comments"); } void CSequenceEditingEventHandler::LowercaseQuals( wxCommandEvent& evt ) { CLowerQuals* dlg = new CLowerQuals(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::AdjustForConsensusSpliceSites ( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> adjust_cds(new CCmdComposite("Adjust for consensus splice sites")); for (CBioseq_CI b_iter(m_TopSeqEntry, CSeq_inst::eMol_na); b_iter; ++b_iter) { bool good_seq = false; switch (event.GetId()) { case eCmdAdjustConsensusSpliceSitesStrict: good_seq = CAdjustForConsensusSplice::s_IsBioseqGood_Strict(*b_iter); break; case eCmdAdjustConsensusSpliceSitesRelaxed: good_seq = CAdjustForConsensusSplice::s_IsBioseqGood_Relaxed(*b_iter); break; } if (good_seq) { for (CFeat_CI feat(*b_iter, SAnnotSelector(CSeqFeatData::e_Cdregion)); feat; ++feat) { CAdjustForConsensusSplice worker; CRef<CCmdComposite> cmd = worker.AdjustForConsensusSpliceSite(feat->GetMappedFeature(), m_TopSeqEntry.GetScope()); if (cmd) { adjust_cds->AddCommand(*cmd); } } } } m_CmdProccessor->Execute(adjust_cds); } void CSequenceEditingEventHandler::ConvertCdsWithInternalStopToMiscFeat( wxCommandEvent& evt ) { CConvertCdsToMiscFeat * dlg = new CConvertCdsToMiscFeat(NULL, m_Workbench); bool similar = true; bool nonfunctional = false; bool unverified = false; dlg->ApplyToAllAndDie(similar,nonfunctional,unverified); } void CSequenceEditingEventHandler::ConvertCdsWithInternalStopToMiscFeatViral( wxCommandEvent& evt ) { CConvertCdsToMiscFeat * dlg = new CConvertCdsToMiscFeat(NULL, m_Workbench); bool similar = false; bool nonfunctional = true; bool unverified = false; dlg->ApplyToAllAndDie(similar,nonfunctional,unverified); } void CSequenceEditingEventHandler::ConvertCdsWithInternalStopToMiscFeatUnverified( wxCommandEvent& evt ) { CConvertCdsToMiscFeat * dlg = new CConvertCdsToMiscFeat(NULL, m_Workbench); bool similar = true; bool nonfunctional = false; bool unverified = true; dlg->ApplyToAllAndDie(similar,nonfunctional,unverified); } void CSequenceEditingEventHandler::CombineSelectedGenesIntoPseudogenes( wxCommandEvent& evt ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> cmd(new CCmdComposite("Combine Selected Genes into Pseudogene")); TConstScopedObjects &objects = m_SelObjects; if (objects.empty()) return; vector<const objects::CSeq_feat*> genes; NON_CONST_ITERATE (TConstScopedObjects, it, objects) { const CObject* ptr = it->object.GetPointer(); const objects::CSeq_feat* seqfeat = dynamic_cast<const objects::CSeq_feat*>(ptr); if (seqfeat && seqfeat->IsSetData() && seqfeat->GetData().IsGene()) { genes.push_back(seqfeat); } } if (genes.size() != 2) { wxMessageBox(_("Please select two gene features to combine. Use Ctrl+Left mouse click"), wxT("Error"), wxOK | wxICON_ERROR, NULL); return; } CScope &scope = m_TopSeqEntry.GetScope(); CRef<CSeq_feat> new_feat(new CSeq_feat()); new_feat->Assign(*genes[0]); new_feat->SetPseudo(true); new_feat->SetLocation().Add(genes[1]->GetLocation()); CRef<CSeq_loc> new_loc = sequence::Seq_loc_Merge(new_feat->GetLocation(), CSeq_loc::fMerge_SingleRange, &scope); new_loc->SetPartialStart(false, eExtreme_Biological); new_loc->SetPartialStop(false, eExtreme_Biological); new_feat->SetLocation(*new_loc); new_feat->SetPartial(false); vector<string> locus; if (genes[1]->GetData().GetGene().IsSetLocus()) locus.push_back(genes[1]->GetData().GetGene().GetLocus()); if (genes[0]->GetData().GetGene().IsSetLocus()) locus.push_back(genes[0]->GetData().GetGene().GetLocus()); new_feat->SetComment(NStr::Join(locus,";")); CBioseq_Handle bsh = scope.GetBioseqHandle(new_feat->GetLocation()); CSeq_entry_Handle seh = bsh.GetSeq_entry_Handle(); cmd->AddCommand(*CRef<CCmdCreateFeat>(new CCmdCreateFeat(seh, *new_feat))); cmd->AddCommand(*GetDeleteFeatureCommand(scope.GetSeq_featHandle(*genes[0]))); cmd->AddCommand(*GetDeleteFeatureCommand(scope.GetSeq_featHandle(*genes[1]))); CConstRef<CSeq_feat> cds1 = sequence::GetOverlappingCDS(genes[0]->GetLocation(), scope); CConstRef<CSeq_feat> cds2 = sequence::GetOverlappingCDS(genes[1]->GetLocation(), scope); cmd->AddCommand(*GetDeleteFeatureCommand(scope.GetSeq_featHandle(*cds1))); cmd->AddCommand(*GetDeleteFeatureCommand(scope.GetSeq_featHandle(*cds2))); m_CmdProccessor->Execute(cmd); } void CSequenceEditingEventHandler::GeneFromOtherFeat( wxCommandEvent& evt ) { CGeneFeatFromOtherFeatDlg * dlg = new CGeneFeatFromOtherFeatDlg(NULL, m_Workbench); dlg->Show(true); } void CSequenceEditingEventHandler::LatLonTool( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; try { CLatLonTool dlg(NULL, m_TopSeqEntry); bool done = false; while (!done) { if (dlg.ShowModal() == wxID_OK) { CRef<CCmdComposite> cmd = dlg.GetCommand(); if (cmd) { m_CmdProccessor->Execute(cmd); done = true; } else { wxString error = ToWxString(dlg.GetErrorMessage()); wxMessageBox(error, wxT("Error"), wxOK | wxICON_ERROR, NULL); } } else { done = true; } } } catch (CException&) {} } void CSequenceEditingEventHandler::CDSGeneRangeErrorSuppress( wxCommandEvent& event ) { CRef<CCmdComposite> cmd(new CCmdComposite("CDSGeneRangeError Suppress")); for (CFeat_CI feat_ci(m_TopSeqEntry); feat_ci; ++feat_ci) { const CSeq_feat& orig = feat_ci->GetOriginalFeature(); CConstRef<CSeq_feat> contained = sequence::GetBestOverlappingFeat(orig.GetLocation(), CSeqFeatData::eSubtype_gene, sequence::eOverlap_Contained, m_TopSeqEntry.GetScope(), 0); CConstRef<CSeq_feat> overlapping = sequence::GetBestOverlappingFeat(orig.GetLocation(), CSeqFeatData::eSubtype_gene, sequence::eOverlap_Simple, m_TopSeqEntry.GetScope(), 0); bool gene_xref = false; FOR_EACH_SEQFEATXREF_ON_SEQFEAT(xref,orig) { if ((*xref)->IsSetData() && (*xref)->GetData().IsGene()) gene_xref = true; } if (!contained && overlapping && !gene_xref) { CRef<CSeq_feat> new_feat(new CSeq_feat()); new_feat->Assign(orig); CRef< CSeqFeatXref > xref(new CSeqFeatXref); xref->SetData().SetGene(); new_feat->SetXref().push_back(xref); cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(feat_ci->GetSeq_feat_Handle(), *new_feat))); } } m_CmdProccessor->Execute(cmd); } void CSequenceEditingEventHandler::CDSGeneRangeErrorRestore( wxCommandEvent& event ) { CRef<CCmdComposite> cmd(new CCmdComposite("CDSGeneRangeError Restore")); for (CFeat_CI feat_ci(m_TopSeqEntry); feat_ci; ++feat_ci) { const CSeq_feat& orig = feat_ci->GetOriginalFeature(); CConstRef<CSeq_feat> contained = sequence::GetBestOverlappingFeat(orig.GetLocation(), CSeqFeatData::eSubtype_gene, sequence::eOverlap_Contained, m_TopSeqEntry.GetScope(), 0); CConstRef<CSeq_feat> overlapping = sequence::GetBestOverlappingFeat(orig.GetLocation(), CSeqFeatData::eSubtype_gene, sequence::eOverlap_Simple, m_TopSeqEntry.GetScope(), 0); bool gene_xref = false; FOR_EACH_SEQFEATXREF_ON_SEQFEAT(xref,orig) { if ((*xref)->IsSetData() && (*xref)->GetData().IsGene()) gene_xref = true; } if (!contained && overlapping && gene_xref) { CRef<CSeq_feat> new_feat(new CSeq_feat()); new_feat->Assign(orig); CSeq_feat::TXref::iterator seq_feat_xref; EDIT_EACH_SEQFEATXREF_ON_SEQFEAT(xref,*new_feat) { if ((*xref)->IsSetData() && (*xref)->GetData().IsGene()) seq_feat_xref = xref; } new_feat->SetXref().erase(seq_feat_xref); if (new_feat->GetXref().empty()) new_feat->ResetXref(); cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(feat_ci->GetSeq_feat_Handle(), *new_feat))); } } m_CmdProccessor->Execute(cmd); } void CSequenceEditingEventHandler::ExportTable(wxCommandEvent& evt) { x_SetUpTSEandUnDoManager(m_Workbench); // perhaps this is unnecessary here after IsObjectSelected has run if (!m_TopSeqEntry || ! m_CmdProccessor) return; CExportTableDlg dlg(NULL, m_TopSeqEntry); if (dlg.ShowModal() == wxID_OK) { dlg.SaveTable(); } } void CSequenceEditingEventHandler::RemoveSegGaps( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> cmd(new CCmdComposite("Remove Seg Gaps")); // So far, handle DENSEG type only SAnnotSelector align_sel(CSeq_annot::C_Data::e_Align); CAlign_CI align_ci(m_TopSeqEntry, align_sel); for ( ; align_ci; ++align_ci) { CRef<CSeq_align> new_align(new CSeq_align()); new_align->Assign(align_ci.GetOriginalSeq_align()); bool modified = CMacroFunction_RemoveSegGaps::s_RemoveSegGaps(*new_align); if (modified) { CIRef<IEditCommand> chgAlign( new CCmdChangeAlign( align_ci.GetSeq_align_Handle(), *new_align )); cmd->AddCommand(*chgAlign); } } m_CmdProccessor->Execute(cmd); } void CSequenceEditingEventHandler::EditSequence( wxCommandEvent& event ) { wxWindow* main_window = NULL; CWorkbench* wb_frame = dynamic_cast<CWorkbench*>(m_Workbench); if (wb_frame) main_window = wb_frame->GetMainWindow(); CEditSequence *dlg = NULL; try { dlg = new CEditSequence(main_window, m_Workbench); dlg->Show(true); } catch (CException&) { if (dlg) dlg->Destroy(); wxMessageBox(wxT("No bioseq selected"), wxT("Error"), wxOK | wxICON_ERROR); } } void CSequenceEditingEventHandler::RawSeqToDeltaByNs( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRawSeqToDeltaByN dlg(NULL); if (dlg.ShowModal() == wxID_OK) { } } void CSequenceEditingEventHandler::RmCultureNotes( wxCommandEvent& event ) { x_SetUpTSEandUnDoManager(m_Workbench); if (!m_TopSeqEntry || ! m_CmdProccessor) return; CRef<CCmdComposite> cmd = GetRmCultureNotesCommand(m_TopSeqEntry.GetTopLevelEntry()); if (cmd) m_CmdProccessor->Execute(cmd); } END_NCBI_SCOPE

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.