From 6311ef861b067452ebdd9c6965d25c5825bf820f Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Thu, 14 Jul 2022 17:08:46 -0400 Subject: [PATCH 1/9] Initial bits Signed-off-by: Geoff Hutchison --- .../qtplugins/insertpeptide/CMakeLists.txt | 15 + .../insertpeptide/fragments/ACE.zmat | 6 + .../insertpeptide/fragments/AIB.zmat | 15 + .../insertpeptide/fragments/ALA.zmat | 12 + .../insertpeptide/fragments/ARG.zmat | 23 + .../insertpeptide/fragments/ASN.zmat | 16 + .../insertpeptide/fragments/ASP.zmat | 15 + .../insertpeptide/fragments/CYS.zmat | 13 + .../insertpeptide/fragments/GLN.zmat | 19 + .../insertpeptide/fragments/GLU.zmat | 18 + .../insertpeptide/fragments/GLY.zmat | 9 + .../insertpeptide/fragments/HIS.zmat | 20 + .../insertpeptide/fragments/ILE.zmat | 21 + .../insertpeptide/fragments/LEU.zmat | 21 + .../insertpeptide/fragments/LYS.zmat | 24 + .../insertpeptide/fragments/MET.zmat | 19 + .../insertpeptide/fragments/NME.zmat | 6 + .../insertpeptide/fragments/PHE.zmat | 22 + .../insertpeptide/fragments/PRO.zmat | 17 + .../insertpeptide/fragments/SEC.zmat | 13 + .../insertpeptide/fragments/SER.zmat | 13 + .../insertpeptide/fragments/THR.zmat | 16 + .../insertpeptide/fragments/TRP.zmat | 24 + .../insertpeptide/fragments/TYR.zmat | 23 + .../insertpeptide/fragments/VAL.zmat | 18 + avogadro/qtplugins/insertpeptide/getamino.py | 109 ++++ .../qtplugins/insertpeptide/insertpeptide.cpp | 124 ++++ .../qtplugins/insertpeptide/insertpeptide.h | 66 +++ .../insertpeptide/insertpeptidedialog.ui | 541 ++++++++++++++++++ .../insertpeptide/insertpeptideextension.cpp | 499 ++++++++++++++++ .../insertpeptide/insertpeptideextension.h | 81 +++ 31 files changed, 1838 insertions(+) create mode 100644 avogadro/qtplugins/insertpeptide/CMakeLists.txt create mode 100644 avogadro/qtplugins/insertpeptide/fragments/ACE.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/AIB.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/ALA.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/ARG.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/ASN.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/ASP.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/CYS.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/GLN.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/GLU.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/GLY.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/HIS.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/ILE.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/LEU.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/LYS.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/MET.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/NME.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/PHE.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/PRO.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/SEC.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/SER.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/THR.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/TRP.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/TYR.zmat create mode 100644 avogadro/qtplugins/insertpeptide/fragments/VAL.zmat create mode 100644 avogadro/qtplugins/insertpeptide/getamino.py create mode 100644 avogadro/qtplugins/insertpeptide/insertpeptide.cpp create mode 100644 avogadro/qtplugins/insertpeptide/insertpeptide.h create mode 100644 avogadro/qtplugins/insertpeptide/insertpeptidedialog.ui create mode 100644 avogadro/qtplugins/insertpeptide/insertpeptideextension.cpp create mode 100644 avogadro/qtplugins/insertpeptide/insertpeptideextension.h diff --git a/avogadro/qtplugins/insertpeptide/CMakeLists.txt b/avogadro/qtplugins/insertpeptide/CMakeLists.txt new file mode 100644 index 0000000000..cbbabce8b2 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +avogadro_plugin(InsertFragment + "Insert oligopeptide chains" + ExtensionPlugin + insertpeptide.h + InsertFragment + insertpeptide.cpp + insertpeptidedialog.ui +) + +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/fragments" +DESTINATION "${INSTALL_DATA_DIR}/avogadro2" +PATTERN ".git" EXCLUDE +) diff --git a/avogadro/qtplugins/insertpeptide/fragments/ACE.zmat b/avogadro/qtplugins/insertpeptide/fragments/ACE.zmat new file mode 100644 index 0000000000..9da2b1675f --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/ACE.zmat @@ -0,0 +1,6 @@ +C CH3 0.0000 0.000000 0.000000 0 0 0 +H H 2.2508 0.000000 0.000000 1 0 0 +C C 1.0803 35.46101 0.000000 2 1 0 +O O 1.2072 120.0465 180.0000 3 2 1 +H H1 1.0900 119.9187 289.6056 1 2 3 +H H3 1.0899 84.91843 180.0000 1 2 3 diff --git a/avogadro/qtplugins/insertpeptide/fragments/AIB.zmat b/avogadro/qtplugins/insertpeptide/fragments/AIB.zmat new file mode 100644 index 0000000000..c49119e01d --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/AIB.zmat @@ -0,0 +1,15 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4686 0.000000 0.000000 1 0 0 +C C 1.5059 109.4171 0.000000 2 1 0 +O O 1.2084 119.9458 150.0173 3 2 1 +O OXT 1.3413 120.0589 329.9213 3 2 1 +C CB1 1.5299 109.4321 119.9565 2 1 3 +C CB2 1.5287 109.4911 239.9557 2 1 3 +H H 1.0085 106.7340 300.0814 1 2 3 +H HO2 0.9673 120.0319 179.9951 5 3 2 +H HB11 1.0894 109.4608 60.06779 6 2 1 +H HB12 1.0899 109.4311 180.0189 6 2 1 +H HB13 1.0893 109.4736 300.0102 6 2 1 +H HB21 1.0891 109.4949 179.9677 7 2 1 +H HB22 1.0904 109.4702 299.9992 7 2 1 +H HB23 1.0901 109.4749 60.03897 7 2 1 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ALA.zmat b/avogadro/qtplugins/insertpeptide/fragments/ALA.zmat new file mode 100644 index 0000000000..3931331829 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/ALA.zmat @@ -0,0 +1,12 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4677 0.000000 0.000000 1 0 0 +C C 1.5054 109.5241 0.000000 2 1 0 +O O 1.2070 120.0308 330.1001 3 2 1 +C CB 1.5294 109.4645 240.0009 2 1 3 +O OXT 1.3419 120.0083 149.9558 3 2 1 +H H 1.0084 106.7514 59.95234 1 2 3 +H HA 1.0899 109.4654 120.0828 2 1 3 +H HB1 1.0906 109.4905 300.0287 5 2 1 +H HB2 1.0899 109.4323 59.99757 5 2 1 +H HB3 1.0900 109.5238 180.0387 5 2 1 +H HXT 0.9675 120.0129 180.0568 6 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ARG.zmat b/avogadro/qtplugins/insertpeptide/fragments/ARG.zmat new file mode 100644 index 0000000000..78e06de04d --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/ARG.zmat @@ -0,0 +1,23 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4617 0.000000 0.000000 1 0 0 +C C 1.5181 108.1384 0.000000 2 1 0 +O O 1.2241 125.4847 356.0694 3 2 1 +C C 1.5362 111.5499 236.4394 2 1 3 +C C 1.5370 114.5356 63.80061 5 2 1 +C C 1.5272 112.4169 177.6312 6 5 2 +N N 1.4435 111.0161 60.18268 7 6 5 +C C 1.4057 123.0046 179.9756 8 7 6 +N N 1.3905 120.9961 179.9864 9 8 7 +O OXT 1.3600 111.9146 175.9826 3 2 1 +H H 0.9966 117.9469 188.7658 1 2 3 +H HA 1.0963 107.5544 116.2989 2 1 3 +H H 1.0973 108.9070 301.3856 5 2 1 +H H 1.0980 108.8389 185.9250 5 2 1 +H H 1.0965 109.5460 57.53464 6 5 2 +H H 1.0967 110.0276 300.0132 6 5 2 +H H 1.0954 109.4797 179.9983 7 6 5 +H H 1.0952 110.6346 298.2449 7 6 5 +H H 1.0270 120.4290 0.146808 8 7 6 +H H 1.0177 120.9036 180.0404 10 9 8 +H H 1.0164 121.9420 0.197924 10 9 8 +H HXT 0.9813 115.2667 180.1501 11 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ASN.zmat b/avogadro/qtplugins/insertpeptide/fragments/ASN.zmat new file mode 100644 index 0000000000..dd9222c18a --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/ASN.zmat @@ -0,0 +1,16 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4682 0.000000 0.000000 1 0 0 +C C 1.5072 109.5130 0.000000 2 1 0 +O O 1.2079 119.9723 340.0286 3 2 1 +C CB 1.5308 109.4540 240.0040 2 1 3 +C CG 1.5065 109.4843 295.0517 5 2 1 +O OD1 1.2132 119.9742 359.9445 6 5 2 +N ND2 1.3476 120.0120 180.0184 6 5 2 +O OXT 1.3421 120.0035 159.9845 3 2 1 +H H 1.0090 111.0009 296.0389 1 2 3 +H HA 1.0898 109.5055 120.0626 2 1 3 +H HB2 1.0903 109.4142 55.01933 5 2 1 +H HB3 1.0894 109.4697 175.0191 5 2 1 +H HD21 0.9701 119.9862 359.9484 8 6 5 +H HD22 0.9695 120.0576 179.9901 8 6 5 +H HXT 0.9673 117.0186 179.9857 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ASP.zmat b/avogadro/qtplugins/insertpeptide/fragments/ASP.zmat new file mode 100644 index 0000000000..69ff29c57c --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/ASP.zmat @@ -0,0 +1,15 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4687 0.000000 0.000000 1 0 0 +C C 1.5069 109.4804 0.000000 2 1 0 +O O 1.2090 119.9838 339.9761 3 2 1 +C CB 1.5300 109.4796 239.9886 2 1 3 +C CG 1.5075 109.4629 295.0120 5 2 1 +O OD1 1.2079 119.9589 359.9386 6 5 2 +O OD2 1.3414 119.9992 180.0027 6 5 2 +O OXT 1.3423 120.0375 160.0276 3 2 1 +H H 1.0092 110.9741 296.0413 1 2 3 +H HA 1.0901 109.4921 119.9456 2 1 3 +H HB2 1.0897 109.4853 54.97142 5 2 1 +H HB3 1.0900 109.4852 175.0010 5 2 1 +H HD2 0.9664 117.0275 179.9932 8 6 5 +H HXT 0.9672 117.0117 179.9501 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/CYS.zmat b/avogadro/qtplugins/insertpeptide/fragments/CYS.zmat new file mode 100644 index 0000000000..85ef280c61 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/CYS.zmat @@ -0,0 +1,13 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4688 0.000000 0.000000 1 0 0 +C C 1.5063 109.3893 0.000000 2 1 0 +O O 1.2067 120.0597 329.9811 3 2 1 +C CB 1.5284 109.4956 239.9862 2 1 3 +S SG 1.8141 109.4980 300.0021 5 2 1 +O OXT 1.3426 119.9769 149.9692 3 2 1 +H H 1.0081 106.7160 60.06859 1 2 3 +H HA 1.0897 109.4231 119.9603 2 1 3 +H HB2 1.0900 109.4724 59.98469 5 2 1 +H HB3 1.0895 109.4416 179.9840 5 2 1 +H HG 1.3444 100.0342 180.0381 6 5 2 +H HXT 0.9665 120.0015 179.9705 7 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/GLN.zmat b/avogadro/qtplugins/insertpeptide/fragments/GLN.zmat new file mode 100644 index 0000000000..712ba45c50 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/GLN.zmat @@ -0,0 +1,19 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4687 0.000000 0.000000 1 0 0 +C C 1.5062 109.4529 0.000000 2 1 0 +O O 1.2072 120.0332 329.9931 3 2 1 +C CB 1.5288 109.4591 239.9337 2 1 3 +C CG 1.5284 109.5344 300.0762 5 2 1 +C CD 1.5066 109.5426 180.0078 6 5 2 +O OE1 1.2122 119.9366 359.9450 7 6 5 +N NE2 1.3471 120.0932 179.9882 7 6 5 +O OXT 1.3426 119.9728 150.0266 3 2 1 +H H 1.0083 106.7232 59.96727 1 2 3 +H HA 1.0896 109.4409 120.0190 2 1 3 +H HB2 1.0906 109.4210 60.06983 5 2 1 +H HB3 1.0896 109.4408 179.9621 5 2 1 +H HG2 1.0906 109.4594 299.9700 6 5 2 +H HG3 1.0896 109.5021 59.92385 6 5 2 +H HE21 0.9693 120.1198 179.9881 9 7 6 +H HE22 0.9703 119.9554 359.9965 9 7 6 +H HXT 0.9672 120.0114 179.9868 10 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/GLU.zmat b/avogadro/qtplugins/insertpeptide/fragments/GLU.zmat new file mode 100644 index 0000000000..1222e98b1a --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/GLU.zmat @@ -0,0 +1,18 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4685 0.000000 0.000000 1 0 0 +C C 1.5077 109.4740 0.000000 2 1 0 +O O 1.2082 119.9808 340.0214 3 2 1 +C CB 1.5301 109.4823 240.0444 2 1 3 +C CG 1.5305 109.4016 294.9863 5 2 1 +C CD 1.5076 109.4303 180.0024 6 5 2 +O OE1 1.2083 120.0030 359.9670 7 6 5 +O OE2 1.3425 119.9976 180.0297 7 6 5 +O OXT 1.3419 119.9916 160.0419 3 2 1 +H H 1.0092 111.0465 59.99216 1 2 3 +H HA 1.0896 109.4996 120.0005 2 1 3 +H HB2 1.0900 109.5094 54.94982 5 2 1 +H HB3 1.0891 109.5036 175.0089 5 2 1 +H HG2 1.0900 109.5025 299.9677 6 5 2 +H HG3 1.0894 109.4462 60.04849 6 5 2 +H HE2 0.9662 116.9917 179.9872 9 7 6 +H HXT 0.9671 116.9919 180.0217 10 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/GLY.zmat b/avogadro/qtplugins/insertpeptide/fragments/GLY.zmat new file mode 100644 index 0000000000..98cb4e7208 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/GLY.zmat @@ -0,0 +1,9 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4696 0.000000 0.000000 1 0 0 +C C 1.5068 109.4387 0.000000 2 1 0 +O O 1.2081 120.0512 0.017594 3 2 1 +O OXT 1.3422 119.9671 180.0328 3 2 1 +H H 1.0081 111.0194 56.05797 1 2 3 +H HA2 1.0895 109.4828 119.9853 2 1 3 +H HA3 1.0902 109.4504 240.0322 2 1 3 +H HXT 0.9672 117.0442 180.0002 5 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/HIS.zmat b/avogadro/qtplugins/insertpeptide/fragments/HIS.zmat new file mode 100644 index 0000000000..a149e8840d --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/HIS.zmat @@ -0,0 +1,20 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4410 0.000000 0.000000 1 0 0 +C C 1.5218 111.1470 0.000000 2 1 0 +O O 1.2269 122.9812 325.5385 3 2 1 +C CB 1.5336 111.1252 237.2205 2 1 3 +C CG 1.5099 112.9790 201.7956 5 2 1 +N ND1 1.3512 120.3285 269.9903 6 5 2 +C CD2 1.3375 129.9283 89.83600 6 5 2 +C CE1 1.3368 107.8621 179.9048 7 6 5 +N NE2 1.3370 107.6169 359.9566 9 7 6 +O OXT 1.3551 114.8546 145.0741 3 2 1 +H H 1.0064 119.0111 267.1248 1 2 3 +H HA 1.0957 106.2509 115.9169 2 1 3 +H HB2 1.0986 110.3817 322.9151 5 2 1 +H HB3 1.0982 110.1994 78.70511 5 2 1 +H HD1 1.0162 127.0804 359.9159 7 6 5 +H HD2 1.0722 137.1496 359.9774 8 6 5 +H HE1 1.0776 126.1755 179.9914 9 7 6 +H HE2 1.0156 125.0780 180.0841 10 9 7 +H HXT 0.9804 114.8373 180.4044 11 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ILE.zmat b/avogadro/qtplugins/insertpeptide/fragments/ILE.zmat new file mode 100644 index 0000000000..a08971ea91 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/ILE.zmat @@ -0,0 +1,21 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4688 0.000000 0.000000 1 0 0 +C C 1.5061 109.4831 0.000000 2 1 0 +O O 1.2075 120.0000 329.9431 3 2 1 +C CB 1.5288 109.4301 239.9267 2 1 3 +C CG1 1.5294 109.5473 300.0058 5 2 1 +C CG2 1.5303 109.4576 180.0339 5 2 1 +C CD1 1.5288 109.5473 180.0000 6 5 2 +O OXT 1.3416 120.0309 150.0613 3 2 1 +H H 1.0073 106.7077 60.00293 1 2 3 +H HA 1.0906 109.4978 119.9738 2 1 3 +H HB 1.0892 109.4848 60.09626 5 2 1 +H HG12 1.0898 109.4337 60.02852 6 5 2 +H HG13 1.0895 109.4756 300.0331 6 5 2 +H HG21 1.0884 109.4849 59.97255 7 5 2 +H HG22 1.0900 109.4496 180.0516 7 5 2 +H HG23 1.0897 109.4798 299.9703 7 5 2 +H HD11 1.0891 109.6037 180.0081 8 6 5 +H HD12 1.0902 109.4935 300.0985 8 6 5 +H HD13 1.0896 109.4578 59.97957 8 6 5 +H HXT 0.9674 120.0631 179.9546 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/LEU.zmat b/avogadro/qtplugins/insertpeptide/fragments/LEU.zmat new file mode 100644 index 0000000000..e5c820b482 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/LEU.zmat @@ -0,0 +1,21 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4690 0.000000 0.000000 1 0 0 +C C 1.5061 109.4376 0.000000 2 1 0 +O O 1.2076 120.0886 330.0194 3 2 1 +C CB 1.5286 109.4163 240.0272 2 1 3 +C CG 1.5302 109.4949 299.9316 5 2 1 +C CD1 1.5300 109.5000 179.9852 6 5 2 +C CD2 1.5285 109.5007 300.0770 6 5 2 +O OXT 1.3425 119.9808 150.0480 3 2 1 +H H 1.0078 106.7663 59.96217 1 2 3 +H HA 1.0894 109.4715 120.0526 2 1 3 +H HB2 1.0898 109.4621 179.9668 5 2 1 +H HB3 1.0901 109.5405 60.01234 5 2 1 +H HG 1.0895 109.4031 60.12393 6 5 2 +H HD11 1.0891 109.4929 179.9785 7 6 5 +H HD12 1.0903 109.5083 300.1220 7 6 5 +H HD13 1.0898 109.4475 60.04104 7 6 5 +H HD21 1.0898 109.4268 299.9467 8 6 5 +H HD22 1.0898 109.4970 59.94242 8 6 5 +H HD23 1.0903 109.4846 179.9828 8 6 5 +H HXT 0.9661 120.0406 179.9773 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/LYS.zmat b/avogadro/qtplugins/insertpeptide/fragments/LYS.zmat new file mode 100644 index 0000000000..24b1ed3dbf --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/LYS.zmat @@ -0,0 +1,24 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4693 0.000000 0.000000 1 0 0 +C C 1.5065 109.4699 0.000000 2 1 0 +O O 1.2079 120.0256 339.9907 3 2 1 +C CB 1.5299 109.4526 240.0329 2 1 3 +C CG 1.5307 109.4176 294.9790 5 2 1 +C CD 1.5307 109.4405 179.9999 6 5 2 +C CE 1.5291 109.4646 179.9974 7 6 5 +N NZ 1.4694 109.5003 180.0488 8 7 6 +O OXT 1.3430 119.9901 160.0293 3 2 1 +H H 1.0087 106.6766 59.99811 1 2 3 +H HA 1.0894 109.4516 119.9862 2 1 3 +H HB2 1.0890 109.5091 54.99614 5 2 1 +H HB3 1.0901 109.4868 175.0350 5 2 1 +H HG2 1.0893 109.4687 299.9789 6 5 2 +H HG3 1.0901 109.4907 60.05621 6 5 2 +H HD2 1.0900 109.5046 300.0335 7 6 5 +H HD3 1.0901 109.4308 60.01949 7 6 5 +H HE2 1.0900 109.5335 300.0205 8 7 6 +H HE3 1.0900 109.5013 60.00135 8 7 6 +H HZ1 1.0094 109.3691 299.9953 9 8 7 +H HZ2 1.0083 109.4677 59.95000 9 8 7 +H HZ3 1.0087 109.5277 180.0401 9 8 7 +H HXT 0.9671 119.9875 180.0263 10 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/MET.zmat b/avogadro/qtplugins/insertpeptide/fragments/MET.zmat new file mode 100644 index 0000000000..45422004fb --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/MET.zmat @@ -0,0 +1,19 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4688 0.000000 0.000000 1 0 0 +C C 1.5062 109.4319 0.000000 2 1 0 +O O 1.2071 120.0537 329.9835 3 2 1 +C CB 1.5293 109.4273 239.9632 2 1 3 +C CG 1.5283 109.5448 299.9834 5 2 1 +S SD 1.8137 109.5064 180.0152 6 5 2 +C CE 1.8135 100.0339 180.0049 7 6 5 +O OXT 1.3426 119.9938 150.0196 3 2 1 +H H 1.0086 106.7237 60.01292 1 2 3 +H HA 1.0895 109.4718 120.0071 2 1 3 +H HB2 1.0900 109.4389 179.9436 5 2 1 +H HB3 1.0905 109.4619 60.03777 5 2 1 +H HG2 1.0903 109.4600 60.03549 6 5 2 +H HG3 1.0895 109.4834 300.0351 6 5 2 +H HE1 1.0890 109.5482 179.9723 8 7 6 +H HE2 1.0893 109.4601 299.9972 8 7 6 +H HE3 1.0898 109.4478 60.03030 8 7 6 +H HXT 0.9668 120.0005 179.9927 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/NME.zmat b/avogadro/qtplugins/insertpeptide/fragments/NME.zmat new file mode 100644 index 0000000000..5a384a85d1 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/NME.zmat @@ -0,0 +1,6 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C C 1.4690 0.000000 0.000000 1 0 0 +H HN1 1.0096 111.0105 0.000000 1 2 0 +H H1 1.0898 109.4340 176.0657 2 1 3 +H H2 1.0900 109.4546 296.0175 2 1 3 +H H3 1.0897 109.4499 56.05866 2 1 3 diff --git a/avogadro/qtplugins/insertpeptide/fragments/PHE.zmat b/avogadro/qtplugins/insertpeptide/fragments/PHE.zmat new file mode 100644 index 0000000000..5d357e9b26 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/PHE.zmat @@ -0,0 +1,22 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4685 0.000000 0.000000 1 0 0 +C C 1.5071 109.4924 0.000000 2 1 0 +O O 1.2069 119.9830 329.9446 3 2 1 +C CB 1.5289 109.4735 239.9059 2 1 3 +C CG 1.5052 109.5165 300.0678 5 2 1 +C CD1 1.3817 120.0584 89.96778 6 5 2 +C CD2 1.3831 120.0047 269.7252 6 5 2 +C CE1 1.3819 120.0292 179.9941 7 6 5 +C CE2 1.3818 119.9769 179.8391 8 6 5 +C CZ 1.3806 120.0469 359.9515 9 7 6 +O OXT 1.3413 120.0246 150.0013 3 2 1 +H H 1.0087 106.6385 60.03405 1 2 3 +H HA 1.0896 109.4338 119.9573 2 1 3 +H HB2 1.0905 109.4434 60.11997 5 2 1 +H HB3 1.0896 109.4924 179.9979 5 2 1 +H HD1 1.0800 119.9524 0.036931 7 6 5 +H HD2 1.0801 119.9716 0.153951 8 6 5 +H HE1 1.0801 119.9772 179.9695 9 7 6 +H HE2 1.0808 119.9333 180.2676 10 8 6 +H HZ 1.0799 120.0735 179.9385 11 9 7 +H HXT 0.9667 120.0207 180.0091 12 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/PRO.zmat b/avogadro/qtplugins/insertpeptide/fragments/PRO.zmat new file mode 100644 index 0000000000..d573746e78 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/PRO.zmat @@ -0,0 +1,17 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4861 0.000000 0.000000 1 0 0 +C C 1.5076 110.3843 0.000000 2 1 0 +O O 1.2084 119.9888 343.0105 3 2 1 +C CB 1.5433 104.7219 241.1593 2 1 3 +C CG 1.5426 105.0593 336.2003 5 2 1 +C CD 1.4866 104.1364 158.1429 1 2 3 +O OXT 1.3420 119.9824 163.0770 3 2 1 +H H 1.0083 106.8822 270.8915 1 2 3 +H HA 1.0898 110.3995 122.2913 2 1 3 +H HB2 1.0902 110.3550 95.01776 5 2 1 +H HB3 1.0895 110.3543 217.3112 5 2 1 +H HG2 1.0900 110.3647 118.8608 6 5 2 +H HG3 1.0903 110.3652 241.1389 6 5 2 +H HD2 1.0903 110.4433 201.8084 7 1 2 +H HD3 1.0899 110.2551 79.49266 7 1 2 +H HXT 0.9664 119.9828 180.0082 8 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/SEC.zmat b/avogadro/qtplugins/insertpeptide/fragments/SEC.zmat new file mode 100644 index 0000000000..40eac856ea --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/SEC.zmat @@ -0,0 +1,13 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4686 0.000000 0.000000 1 0 0 +C C 1.5076 109.4680 0.000000 2 1 0 +O O 1.2083 119.9540 339.9695 3 2 1 +C CB 1.5295 109.5015 239.9663 2 1 3 +Se SE 1.9599 109.4679 295.0058 5 2 1 +O OXT 1.3419 120.0087 159.9700 3 2 1 +H H 1.0087 111.0452 296.0359 1 2 3 +H HA 1.0897 109.4886 119.9515 2 1 3 +H HB2 1.0899 109.4752 54.96829 5 2 1 +H HB3 1.0904 109.4844 174.9757 5 2 1 +H HE 1.5608 100.9695 179.9790 6 5 2 +H HXT 0.9667 116.9770 179.9525 7 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/SER.zmat b/avogadro/qtplugins/insertpeptide/fragments/SER.zmat new file mode 100644 index 0000000000..be60430ff2 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/SER.zmat @@ -0,0 +1,13 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4689 0.000000 0.000000 1 0 0 +C C 1.5067 109.4352 0.000000 2 1 0 +O O 1.2069 120.0466 329.9939 3 2 1 +C CB 1.5287 109.4711 239.9795 2 1 3 +O OG 1.4283 109.5115 300.0305 5 2 1 +O OXT 1.3418 119.9531 149.9881 3 2 1 +H H 1.0080 106.7161 59.97649 1 2 3 +H HA 1.0897 109.4275 119.9662 2 1 3 +H HB2 1.0901 109.4340 60.03743 5 2 1 +H HB3 1.0896 109.4804 179.9939 5 2 1 +H HG 0.9669 106.8144 180.0309 6 5 2 +H HXT 0.9673 120.0092 180.0020 7 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/THR.zmat b/avogadro/qtplugins/insertpeptide/fragments/THR.zmat new file mode 100644 index 0000000000..d1776fff9c --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/THR.zmat @@ -0,0 +1,16 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4693 0.000000 0.000000 1 0 0 +C C 1.5060 109.4088 0.000000 2 1 0 +O O 1.2070 120.0934 329.9820 3 2 1 +C CB 1.5289 109.4115 239.9998 2 1 3 +O OG1 1.4280 109.5053 60.02168 5 2 1 +C CG2 1.5301 109.5254 299.9908 5 2 1 +O OXT 1.3423 119.9177 150.0143 3 2 1 +H H 1.0074 106.7226 59.99129 1 2 3 +H HA 1.0898 109.4163 120.0013 2 1 3 +H HB 1.0897 109.4276 180.0138 5 2 1 +H HG1 0.9665 106.8125 299.9435 6 5 2 +H HG21 1.0893 109.4778 180.0629 7 5 2 +H HG22 1.0901 109.4679 300.0565 7 5 2 +H HG23 1.0888 109.4590 60.04122 7 5 2 +H HXT 0.9669 119.9569 179.9139 8 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/TRP.zmat b/avogadro/qtplugins/insertpeptide/fragments/TRP.zmat new file mode 100644 index 0000000000..47dfe5ed74 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/TRP.zmat @@ -0,0 +1,24 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4687 0.000000 0.000000 1 0 0 +C C 1.5074 109.4283 0.000000 2 1 0 +O O 1.2078 119.9978 329.9998 3 2 1 +C C 1.5286 109.5226 239.9744 2 1 3 +C C 1.5067 109.4418 299.9990 5 2 1 +C C 1.3425 126.4957 90.03792 6 5 2 +C C 1.4639 126.5118 269.6594 6 5 2 +N N 1.3686 109.9317 179.9435 7 6 5 +C C 1.3768 109.8503 359.9382 9 7 6 +C C 1.3960 134.0470 0.783874 8 6 5 +C C 1.3905 133.5052 180.0019 10 9 7 +C C 1.3658 119.7952 179.6390 11 8 6 +O OXT 1.3421 119.9724 150.0225 3 2 1 +H H 1.0092 106.6869 60.04729 1 2 3 +H HA 1.0898 109.4787 119.9395 2 1 3 +H H 1.0898 109.4702 59.95987 5 2 1 +H H 1.0894 109.5124 180.0059 5 2 1 +H H 1.0791 125.0893 359.9421 7 6 5 +H H 0.9691 125.0686 180.0301 9 7 6 +H H 1.0801 120.0707 359.3219 11 8 6 +H H 1.0804 120.1130 359.9568 12 10 9 +H H 1.0798 119.7561 179.6597 13 11 8 +H HXT 0.9670 119.9595 180.0536 14 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/TYR.zmat b/avogadro/qtplugins/insertpeptide/fragments/TYR.zmat new file mode 100644 index 0000000000..94d644eb2b --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/TYR.zmat @@ -0,0 +1,23 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4688 0.000000 0.000000 1 0 0 +C C 1.5071 109.4691 0.000000 2 1 0 +O O 1.2069 120.0078 330.0234 3 2 1 +C CB 1.5287 109.4702 239.9590 2 1 3 +C CG 1.5061 109.4974 300.0187 5 2 1 +C CD1 1.3823 119.9470 90.02964 6 5 2 +C CD2 1.3829 119.9427 269.7215 6 5 2 +C CE1 1.3809 120.0728 180.0236 7 6 5 +C CE2 1.3809 120.0203 179.7745 8 6 5 +C CZ 1.3867 119.9781 359.8979 9 7 6 +O OH 1.3581 120.1300 180.0340 11 9 7 +O OXT 1.3423 119.9533 149.9700 3 2 1 +H H 1.0090 106.6670 60.00949 1 2 3 +H HA 1.0906 109.4278 119.9905 2 1 3 +H HB2 1.0892 109.5117 60.12204 5 2 1 +H HB3 1.0909 109.4603 180.0300 5 2 1 +H HD1 1.0793 119.9414 0.027701 7 6 5 +H HD2 1.0795 119.9964 0.243787 8 6 5 +H HE1 1.0795 120.0572 179.9539 9 7 6 +H HE2 1.0799 120.0441 180.3397 10 8 6 +H HH 0.9663 106.8813 90.03999 12 11 9 +H HXT 0.9675 119.9331 180.0803 13 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/VAL.zmat b/avogadro/qtplugins/insertpeptide/fragments/VAL.zmat new file mode 100644 index 0000000000..ca2644a61b --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/VAL.zmat @@ -0,0 +1,18 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4687 0.000000 0.000000 1 0 0 +C C 1.5059 109.4631 0.000000 2 1 0 +O O 1.2075 120.0245 330.0003 3 2 1 +C CB 1.5287 109.4451 239.9962 2 1 3 +C CG1 1.5298 109.5086 300.0064 5 2 1 +C CG2 1.5292 109.4895 60.03210 5 2 1 +O OXT 1.3423 119.9903 149.9836 3 2 1 +H H 1.0083 106.6869 60.00203 1 2 3 +H HA 1.0896 109.4704 120.0076 2 1 3 +H HB 1.0908 109.4559 180.0351 5 2 1 +H HG11 1.0904 109.5197 180.0107 6 5 2 +H HG12 1.0896 109.4569 300.0192 6 5 2 +H HG13 1.0889 109.4590 60.03317 6 5 2 +H HG21 1.0898 109.4732 299.9788 7 5 2 +H HG22 1.0896 109.4963 59.97466 7 5 2 +H HG23 1.0903 109.5303 179.9528 7 5 2 +H HXT 0.9674 119.9801 179.9759 8 3 2 diff --git a/avogadro/qtplugins/insertpeptide/getamino.py b/avogadro/qtplugins/insertpeptide/getamino.py new file mode 100644 index 0000000000..111f4e8d89 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/getamino.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python + +import os + +import requests + +from openbabel import pybel +from openbabel import openbabel as ob + +# URL for the ideal geometry (PDB) +pdbTemplate = "http://ligand-expo.rcsb.org/reports/{}/{}/{}_ideal.pdb" + +# default ligand list +ligands = [ + # 20 common amino acids + "ALA", + "ARG", + "ASP", + "ASN", + "CYS", + "GLU", + "GLN", + "GLY", + "HIS", + "ILE", + "LEU", + "LYS", + "MET", + "PHE", + "PRO", + "SER", + "THR", + "TRP", + "TYR", + "VAL", + # extra + "SEC", # "MLY", "MLZ", "PYL", + # caps + "NME", + "ACE", + # misc + "AIB", +] + +for ligand in ligands: + pdb = requests.get(pdbTemplate.format(ligand[0], ligand, ligand)) + with open("temp.pdb", "wb") as handle: + for block in pdb.iter_content(1024): + handle.write(block) + + try: + mol_pdb = next(pybel.readfile("pdb", "temp.pdb")) + except StopIteration: + continue + + # fix up some atom orders + if ligand == "ACE": + # reorder the atoms to make sure C=O are 3, 4 + # unfortunately, OB won't let H be the first atom + new_order = [3, 4, 1, 2, 5, 6, 7] + mol_pdb.OBMol.RenumberAtoms(new_order) + elif ligand == "SEC": + new_order = [1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 11, 12, 13, 14] + mol_pdb.OBMol.RenumberAtoms(new_order) + # TODO: PYL, MLY, MLZ and others + + # remove the "extra" atoms (H2, OXT, HXT) + removeAtoms = [] + for atom in mol_pdb.atoms: + name = atom.OBAtom.GetResidue().GetAtomID(atom.OBAtom) + +# if name.find("HXT") != -1 or name.find("OXT") != -1: +# removeAtoms.append(atom.OBAtom) + # NME is tricky + if ligand == "NME" and name.find("HN2") != -1: + removeAtoms.append(atom.OBAtom) + if ligand != "NME" and name.find("H2") != -1: + removeAtoms.append(atom.OBAtom) + + for atom in removeAtoms: + mol_pdb.OBMol.DeleteAtom(atom, False) + + # convert to a MOPAC internal + internal = mol_pdb.write("mopin") + + # drop the first two lines of internal + with open(ligand + ".zmat", "w") as f: + i = 0 + # drop the first two lines + for line in internal.splitlines()[2:]: + items = line.split() + if len(items) < 10: + continue + + element = items[0] + length = items[1] + angle = items[3] + torsion = items[5] + atom1, atom2, atom3 = items[7], items[8], items[9] + + obatom = mol_pdb.atoms[i].OBAtom + name = obatom.GetResidue().GetAtomID(obatom) + i += 1 + + f.write( + f"{element:2} {name} {length:2.6} {angle:4.8} {torsion:4.8} {atom1:>3} {atom2:>3} {atom3:>3}\n" + ) + +os.remove("temp.pdb") diff --git a/avogadro/qtplugins/insertpeptide/insertpeptide.cpp b/avogadro/qtplugins/insertpeptide/insertpeptide.cpp new file mode 100644 index 0000000000..8c4fba6adb --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/insertpeptide.cpp @@ -0,0 +1,124 @@ +/****************************************************************************** + This source file is part of the Avogadro project. + This source code is released under the 3-Clause BSD License, (see "LICENSE"). +******************************************************************************/ + +#include "insertfragment.h" +#include "insertfragmentdialog.h" + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +using Avogadro::Io::FileFormatManager; +using Avogadro::QtGui::Molecule; + +namespace Avogadro::QtPlugins { + +InsertFragment::InsertFragment(QObject* parent_) + : Avogadro::QtGui::ExtensionPlugin(parent_), m_crystalDialog(nullptr), + m_moleculeDialog(nullptr), m_reader(nullptr), m_molecule(nullptr) +{ + auto* action = new QAction(tr("Fragment…"), this); + action->setData("molecules"); // will also work for crystals + connect(action, SIGNAL(triggered()), SLOT(showDialog())); + m_actions.append(action); + + action = new QAction(tr("Crystal…"), this); + action->setData("crystals"); // will also work for crystals + connect(action, SIGNAL(triggered()), SLOT(showDialog())); + m_actions.append(action); +} + +InsertFragment::~InsertFragment() +{ + delete m_reader; +} + +QList InsertFragment::actions() const +{ + return m_actions; +} + +QStringList InsertFragment::menuPath(QAction* action) const +{ + if (action->data() == "crystals") + return QStringList() << tr("&File") << tr("&Import"); + else + return QStringList() << tr("&Build") << tr("&Insert"); +} + +void InsertFragment::setMolecule(QtGui::Molecule* mol) +{ + m_molecule = mol; +} + +void InsertFragment::showDialog() +{ + if (!m_molecule) + return; + + QWidget* parentAsWidget = qobject_cast(parent()); + auto* theSender = qobject_cast(sender()); + + // Prompt user for input: + bool crystal = theSender->data().toString() == "crystals"; + if (crystal) { + // create the dialog if it doesn't exist + if (!m_crystalDialog) { + m_crystalDialog = new InsertFragmentDialog(parentAsWidget, "crystals"); + connect(m_crystalDialog, &InsertFragmentDialog::performInsert, this, + &InsertFragment::performInsert); + } + m_crystalDialog->show(); + } else { + // fragments - create the dialog if it doesn't exist + if (!m_moleculeDialog) { + m_moleculeDialog = new InsertFragmentDialog(parentAsWidget, "molecules"); + connect(m_moleculeDialog, &InsertFragmentDialog::performInsert, this, + &InsertFragment::performInsert); + } + m_moleculeDialog->show(); + } +} + +void InsertFragment::performInsert(const QString& fileName, bool crystal) +{ + if (m_molecule == nullptr) + return; + + // read the file into the new fragment + Avogadro::QtGui::Molecule newMol(m_molecule->parent()); + bool ok = + Io::FileFormatManager::instance().readFile(newMol, fileName.toStdString()); + if (!ok) { + QMessageBox::critical(qobject_cast(parent()), tr("Error"), + tr("Error reading file (%1).").arg(fileName)); + return; + } + + if (crystal) { + Molecule::MoleculeChanges changes = + (Molecule::Atoms | Molecule::Bonds | Molecule::Added | Molecule::Removed); + + m_molecule->undoMolecule()->modifyMolecule(newMol, changes, + tr("Import Crystal")); + emit requestActiveTool("Navigator"); + } else { + // insert mol into m_molecule + m_molecule->undoMolecule()->appendMolecule(newMol, tr("Insert Fragment")); + emit requestActiveTool("Manipulator"); + } +} + +} // namespace Avogadro diff --git a/avogadro/qtplugins/insertpeptide/insertpeptide.h b/avogadro/qtplugins/insertpeptide/insertpeptide.h new file mode 100644 index 0000000000..39f2b2fdad --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/insertpeptide.h @@ -0,0 +1,66 @@ +/****************************************************************************** + This source file is part of the Avogadro project. + This source code is released under the 3-Clause BSD License, (see "LICENSE"). +******************************************************************************/ + +#ifndef AVOGADRO_QTPLUGINS_INSERTFRAGMENT_H +#define AVOGADRO_QTPLUGINS_INSERTFRAGMENT_H + +#include + +#include + +#include + +namespace Avogadro { +namespace Io { +class FileFormat; +} +namespace QtPlugins { +class InsertFragmentDialog; +} + +namespace QtPlugins { + +/** + * @brief Load single-line molecule descriptors through an input dialog. + */ +class InsertFragment : public QtGui::ExtensionPlugin +{ + Q_OBJECT +public: + explicit InsertFragment(QObject* parent_ = nullptr); + ~InsertFragment() override; + + QString name() const override { return tr("InsertFragment"); } + QString description() const override; + QList actions() const override; + QStringList menuPath(QAction*) const override; + +public slots: + void setMolecule(QtGui::Molecule*) override; + +private slots: + void showDialog(); + void performInsert(const QString &fileName, bool crystal); + +private: + QList m_actions; + InsertFragmentDialog* m_moleculeDialog; + InsertFragmentDialog* m_crystalDialog; + /// Maps identifier to extension: + QMap m_formats; + + QtGui::Molecule* m_molecule; + Io::FileFormat* m_reader; +}; + +inline QString InsertFragment::description() const +{ + return tr("Insert molecular fragments for building larger molecules."); +} + +} // namespace QtPlugins +} // namespace Avogadro + +#endif // AVOGADRO_QTPLUGINS_INSERTFRAGMENT_H diff --git a/avogadro/qtplugins/insertpeptide/insertpeptidedialog.ui b/avogadro/qtplugins/insertpeptide/insertpeptidedialog.ui new file mode 100644 index 0000000000..a166c6af46 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/insertpeptidedialog.ui @@ -0,0 +1,541 @@ + + + InsertPeptideDialog + + + + 0 + 0 + 447 + 428 + + + + Insert Peptide + + + + + + Peptide Builder + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QLayout::SetDefaultConstraint + + + + + Alanine + + + Ala + + + + + + + Arginine + + + Arg + + + + + + + Asparagine + + + Asn + + + + + + + Aspartic acid + + + Asp + + + + + + + Cysteine + + + Cys + + + + + + + Glutamic acid + + + Glu + + + + + + + Glutamine + + + Gln + + + + + + + Glycine + + + Gly + + + + + + + Histidine + + + His + + + + + + + Isoleucine + + + Ile + + + + + + + Valine + + + Val + + + + + + + Tyrosine + + + Tyr + + + + + + + Tryptophan + + + Trp + + + + + + + Threonine + + + Thr + + + + + + + Serine + + + Ser + + + + + + + Proline + + + Pro + + + + + + + Phenylalanine + + + Phe + + + + + + + Methionine + + + Met + + + + + + + Lysine + + + Lys + + + + + + + Leucine + + + Leu + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Amino Acids: + + + + + + + Sequence (N to C): + + + + + + + + + + Stereochemistry: + + + + + + + + + L + + + true + + + + + + + D + + + + + + + + + + + N Terminus: + + + + + + + C Terminus: + + + + + + + + NH₂ + + + + + NH₃⁺ + + + + + + + + + CO₂H + + + + + CO₂⁻ + + + + + + + + + + Structure: + + + + + + + + Straight Chain + + + + + Alpha Helix + + + + + Beta Sheet + + + + + 3-10 Helix + + + + + Pi Helix + + + + + Other + + + + + + + + + + Phi: + + + + + + + ° + + + -180.000000000000000 + + + 180.000000000000000 + + + 180.000000000000000 + + + + + + + ° + + + -180.000000000000000 + + + 180.000000000000000 + + + 180.000000000000000 + + + + + + + Psi: + + + + + + + + + + + + + + Chain Number: + + + + + + + The chain number for the new peptide + + + true + + + + A + + + + + B + + + + + C + + + + + D + + + + + E + + + + + F + + + + + G + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Insert Peptide + + + true + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + diff --git a/avogadro/qtplugins/insertpeptide/insertpeptideextension.cpp b/avogadro/qtplugins/insertpeptide/insertpeptideextension.cpp new file mode 100644 index 0000000000..bc5ec6532f --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/insertpeptideextension.cpp @@ -0,0 +1,499 @@ +/********************************************************************** + InsertPeptide - Insert oligopeptide sequences + + Copyright (C) 2008-2009 by Geoffrey R. Hutchison + + This file is part of the Avogadro molecular editor project. + For more information, see + + Some code is based on Open Babel + For more information, see + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + ***********************************************************************/ + +#include "insertpeptideextension.h" +#include "insertcommand.h" + +#include +#include + +#include +#include +#include + +#include + +using namespace std; +using namespace OpenBabel; + + +namespace Avogadro { + + void AddResidue(QString residue, bool lStereo, + OBMol &mol, vector &vic, + const char chain); + + void AddTerminus(int element, QString atomID, + int a, double distance, + int b, double angle, + int c, double dihedral, + OBMol &mol, vector &vic); + + InsertPeptideExtension::InsertPeptideExtension(QObject *parent) : + Extension(parent), + m_molecule(0), + phi(180.0), psi(180.0), omega(179.99), + lStereo(true), + structureType(0), + m_dialog(0) + { + QAction *action = new QAction(this); + action->setText(tr("Peptide...")); + m_actions.append(action); + + m_widget = qobject_cast(parent); + } + + InsertPeptideExtension::~InsertPeptideExtension() + { + } + + QList InsertPeptideExtension::actions() const + { + return m_actions; + } + + QString InsertPeptideExtension::menuPath(QAction *) const + { + return tr("&Build") + '>' + tr("&Insert"); + } + + void InsertPeptideExtension::setMolecule(Molecule *molecule) + { + m_molecule = molecule; + } + + QUndoCommand* InsertPeptideExtension::performAction(QAction *, + GLWidget *widget) + { + if (m_molecule == NULL) + return NULL; // nothing we can do + + m_widget = widget; // save for delayed response + + if (m_dialog == NULL) { + constructDialog(); + } + m_dialog->show(); + + return NULL; // delayed action on user clicking the Insert button + } + + void InsertPeptideExtension::performInsert() + { + if (!m_dialog) + return; // nothing we can do + + QString sequence = m_dialog->sequenceText->toPlainText().toLower(); + if (sequence.isEmpty()) + return; // also nothing to do + + OBMol obfragment; + vector vic; + vic.push_back((OBInternalCoord*)NULL); + OBInternalCoord* ic; + int lastN, lastCa, lastCac, lastO; // backbone atoms + lastN = lastCa = lastCac = lastO = 0; + int newN, newCa, newCac, newO; + int lastAtom = 0; // last atom read from previous residue + + double amideLength = 1.33; + double bondAngle = 120.0; + const char chain = m_dialog->chainNumberCombo->currentText().toAscii()[0]; + + // Now the work begins + // Get the sequence (in lower case) + obfragment.BeginModify(); + foreach (const QString &residue, sequence.split('-')) { + AddResidue(residue, lStereo, obfragment, vic, chain); + if (!obfragment.NumAtoms()) {// Residue was not added - bail + qDebug() << "Problem adding new residues - file not read."; + return; + } + + newN = lastAtom + 1; + newCa = lastAtom + 2; + newCac = lastAtom + 3; + newO = lastAtom + 4; + + if (lastAtom != 0) { + // set the peptide bond to the previous residue + // first the nitrogen + ic = vic[newN]; + ic->_a = obfragment.GetAtom(lastCac); + ic->_dst = amideLength; + ic->_b = obfragment.GetAtom(lastCa); + ic->_ang = bondAngle; + ic->_c = obfragment.GetAtom(lastN); + ic->_tor = psi; + + // fix the O=C from previous residue + ic = vic[lastO]; + ic->_tor = 180.0 + psi; + + // now the Calpha + ic = vic[newCa]; + ic->_b = obfragment.GetAtom(lastCac); + ic->_ang = bondAngle; + ic->_c = obfragment.GetAtom(lastCa); + ic->_tor = omega; + + // now the new C=O + ic = vic[newCac]; + ic->_c = obfragment.GetAtom(lastCac); + ic->_tor = phi; + + // add the peptide bond + obfragment.AddBond(lastCac, newN, 1); + } + else { // The first residue + // Add the N-terminus modification + switch (m_dialog->nGroupCombo->currentIndex()) { + case 0: // NH2 + AddTerminus(1, "H2", newN, 1.009, newCa, 120.0, + newCac, 175.0, obfragment, vic); + break; + case 1: // NH3+ + AddTerminus(1, "H2", newN, 1.009, newCa, 109.5, + newCac, 117.0, obfragment, vic); + AddTerminus(1, "H3", newN, 1.009, newCa, 109.5, + newCac, -117.0, obfragment, vic); + break; + default: + break; + } + } + + // add the known backbone bonds + obfragment.AddBond(newN, newCa, 1); + obfragment.AddBond(newCa, newCac, 1); + obfragment.AddBond(newCac, newO, 2); // C=O + + lastN = newN; + lastCa = newCa; + lastCac = newCac; + lastO = newO; + lastAtom = obfragment.NumAtoms(); + } + // Fix the final C=O if not straight-chain + ic = vic[lastO]; + ic->_tor = 180.0 + psi; + + // Add the C-terminus end group + switch (m_dialog->cGroupCombo->currentIndex()) { + case 0: // CO2H + AddTerminus(8, "OXT", lastCac, 1.3419, lastO, 120.0, + lastCa, -180.0, obfragment, vic); + obfragment.AddBond(obfragment.NumAtoms(), lastCac, 1); + AddTerminus(1, "HXT", obfragment.NumAtoms(), 0.9674, + lastCac, 120.0, lastO, 180.0, obfragment, vic); + break; + case 1: // CO2- + AddTerminus(8, "OXT", lastCac, 1.3419, lastO, 120.0, + lastCa, -180.0, obfragment, vic); + break; + default: + break; + } + + obfragment.EndModify(); + if (obfragment.NumAtoms()) { + // Don't do all this work, if there's nothing to do + InternalToCartesian(vic,obfragment); + OBBitVec allAtoms; + allAtoms.SetRangeOn(0, obfragment.NumAtoms()); + allAtoms.SetBitOff(obfragment.NumAtoms() - 1); // Don't add bonds for the terminus + resdat.AssignBonds(obfragment, allAtoms); + + // some of the fragments still miss bonds + obfragment.ConnectTheDots(); + + obfragment.SetPartialChargesPerceived(); + + Molecule fragment; + fragment.setOBMol(&obfragment); + emit performCommand(new InsertFragmentCommand(m_molecule, fragment, + m_widget, tr("Insert Peptide"))); + } + } + + void InsertPeptideExtension::writeSettings(QSettings &settings) const + { + Extension::writeSettings(settings); + settings.setValue("phiAngle", phi); + settings.setValue("psiAngle", psi); + settings.setValue("lStereo", lStereo); + settings.setValue("structureType", structureType); + } + + void InsertPeptideExtension::readSettings(QSettings &settings) + { + Extension::readSettings(settings); + + phi = settings.value("phiAngle", 180.0).toDouble(); + psi = settings.value("psiAngle", 180.0).toDouble(); + lStereo = settings.value("lStereo", true).toBool(); + structureType = settings.value("structureType", 0).toInt(); + + updateDialog(); + } + + void InsertPeptideExtension::constructDialog() + { + if (m_dialog == NULL) { + m_dialog = new InsertPeptideDialog(m_widget); + QButtonGroup* stereoGroup = new QButtonGroup(m_dialog); + stereoGroup->addButton(m_dialog->dStereoButton, 0); + stereoGroup->addButton(m_dialog->lStereoButton, 1); + stereoGroup->setExclusive(true); + + connect(stereoGroup, SIGNAL(buttonClicked(int)), + this, SLOT(setStereo(int))); + + connect(m_dialog->structureCombo, SIGNAL(currentIndexChanged(int)), + this, SLOT(setStructureType(int))); + connect(m_dialog->phiSpin, SIGNAL(valueChanged(double)), + this, SLOT(setPhi(double))); + connect(m_dialog->psiSpin, SIGNAL(valueChanged(double)), + this, SLOT(setPsi(double))); + connect(m_dialog->insertButton, SIGNAL(clicked()), + this, SLOT(performInsert())); + + // Set the amino buttons to update the sequence + foreach(const QToolButton *child, m_dialog->findChildren()) { + connect(child, SIGNAL(clicked()), this, SLOT(updateText())); + } + connect(m_dialog, SIGNAL(destroyed()), this, SLOT(dialogDestroyed())); + } + m_dialog->sequenceText->setPlainText(QString()); + updateDialog(); + } + + void InsertPeptideExtension::updateDialog() + { + if (m_dialog == NULL) + return; // the method will be called again when the dialog is created + + m_dialog->structureCombo->setCurrentIndex(structureType); + m_dialog->phiSpin->setValue(phi); + m_dialog->psiSpin->setValue(psi); + if (lStereo) + m_dialog->lStereoButton->setChecked(true); + else + m_dialog->dStereoButton->setChecked(true); + } + + void InsertPeptideExtension::updateText() + { + QToolButton *button = qobject_cast(sender()); + if (button) { + QString sequenceText = m_dialog->sequenceText->toPlainText(); + if (!sequenceText.isEmpty()) + sequenceText += '-'; // divider between amino acids + + sequenceText += button->text(); + + m_dialog->sequenceText->setPlainText(sequenceText); + } + } + + void InsertPeptideExtension::setStereo(int stereoValue) + { + lStereo = stereoValue; + } + + void InsertPeptideExtension::setPhi(double angle) + { + phi = angle; + } + + void InsertPeptideExtension::setPsi(double angle) + { + psi = angle; + } + + void InsertPeptideExtension::setStructureType(int type) + { + structureType = type; + + switch (type) { + case 0: // straight chain + setPhi(180.0); + setPsi(180.0); + m_dialog->phiSpin->setValue(phi); + m_dialog->psiSpin->setValue(psi); + break; + case 1: // alpha helix + setPhi(-60.0); + setPsi(-40.0); + m_dialog->phiSpin->setValue(phi); + m_dialog->psiSpin->setValue(psi); + break; + case 2: // beta sheet + setPhi(-135.0); + setPsi(135.0); + m_dialog->phiSpin->setValue(phi); + m_dialog->psiSpin->setValue(psi); + break; + case 3: // 3-10 helix + setPhi(-74.0); + setPsi(-4.0); + m_dialog->phiSpin->setValue(phi); + m_dialog->psiSpin->setValue(psi); + break; + case 4: // pi helix + setPhi(-57.0); + setPsi(-70.0); + m_dialog->phiSpin->setValue(phi); + m_dialog->psiSpin->setValue(psi); + break; + default: // arbitrary value + break; + } + } + + void InsertPeptideExtension::dialogDestroyed() + { + m_dialog = 0; + } + + void AddResidue(QString residue, bool lStereo, + OBMol &mol, vector &vic, + const char chain) + { + QString filename; + /// TODO Make this work in the build directory. + filename = QCoreApplication::applicationDirPath() + + "/../share/avogadro/builder/amino/"; + + if (residue != "gly") { + if (lStereo) + filename += "l-"; + else // D stereo + filename += "d-"; + } + filename += residue + ".zmat"; + + ifstream ifs; + ifs.open(filename.toAscii()); + + if (!ifs) { // file doesn't exist + qDebug() << " Cannot open residue file: " << filename; + return; + } + + // Offset: + // When we add the internal coordinates, we have to increment + // based on the size of the molecule so far + unsigned int offset = mol.NumAtoms(); + + // setup the parent residue + int prevRes = mol.NumResidues() + 1; + OBResidue *res = mol.NewResidue(); + res->SetNum(prevRes); + res->SetChain(chain); + // needs to be in uppercase + res->SetName(residue.toUpper().toStdString()); + + // Read in an amino z-matrix + // similar to MOPAC zmat format + char buffer[BUFF_SIZE]; + vector vs; + OBAtom *atom; + + while (ifs.getline(buffer, BUFF_SIZE)) { + tokenize(vs, buffer); + + atom = mol.NewAtom(); + atom->SetAtomicNum(etab.GetAtomicNum(vs[0].c_str())); + atom->SetPartialCharge(atof(vs[7].c_str())); + res->InsertAtom(atom); + res->SetHetAtom(atom, false); + res->SetSerialNum(atom, mol.NumAtoms()); + if (vs.size() == 9) + res->SetAtomID(atom, vs[8]); + + OBInternalCoord *coord = new OBInternalCoord; + coord->_dst = atof(vs[1].c_str()); + coord->_ang = atof(vs[2].c_str()); + coord->_tor = atof(vs[3].c_str()); + + unsigned int index; + // Set _a + index = atoi(vs[4].c_str()); + if (index > 0 && index <= mol.NumAtoms()) + coord->_a = mol.GetAtom(index + offset); + else + coord->_a = NULL; + // Set _b + index = atoi(vs[5].c_str()); + if (index > 0 && index <= mol.NumAtoms()) + coord->_b = mol.GetAtom(index + offset); + else + coord->_b = NULL; + // Set _c + index = atoi(vs[6].c_str()); + if (index > 0 && index <= mol.NumAtoms()) + coord->_c = mol.GetAtom(index + offset); + else + coord->_c = NULL; + + vic.push_back(coord); + } + } + + void AddTerminus(int element, QString atomID, + int a, double distance, + int b, double angle, + int c, double dihedral, + OBMol &mol, vector &vic) + { + OBResidue *res = mol.GetResidue(mol.NumResidues() - 1); + if (!res || mol.NumResidues() == 0) + return; // can't do anything -- we're in a weird state + + OBAtom *atom; + + atom = mol.NewAtom(); + atom->SetAtomicNum(element); + res->InsertAtom(atom); + res->SetHetAtom(atom, false); + res->SetSerialNum(atom, mol.NumAtoms()); + res->SetAtomID(atom, atomID.toAscii().data()); + + OBInternalCoord *coord = new OBInternalCoord; + coord->_dst = distance; + coord->_ang = angle; + coord->_tor = dihedral; + + coord->_a = mol.GetAtom(a); + coord->_b = mol.GetAtom(b); + coord->_c = mol.GetAtom(c); + + // Add a bond between the recently created atom and our "a" + mol.AddBond(mol.NumAtoms(), a, 1); + + vic.push_back(coord); + } + +} // end namespace Avogadro + +Q_EXPORT_PLUGIN2(insertpeptideextension, Avogadro::InsertPeptideExtensionFactory) diff --git a/avogadro/qtplugins/insertpeptide/insertpeptideextension.h b/avogadro/qtplugins/insertpeptide/insertpeptideextension.h new file mode 100644 index 0000000000..06401fcd59 --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/insertpeptideextension.h @@ -0,0 +1,81 @@ +/****************************************************************************** + This source file is part of the Avogadro project. + This source code is released under the 3-Clause BSD License, (see "LICENSE"). +******************************************************************************/ + +#ifndef INSERTPEPTIDEEXTENSION_H +#define INSERTPEPTIDEEXTENSION_H + +#include + +#include "ui_insertpeptidedialog.h" + +namespace Avogadro { + + class InsertPeptideDialog : public QDialog, public Ui::InsertPeptideDialog + { + public: + InsertPeptideDialog(QWidget *parent=0) : QDialog(parent) { + setWindowFlags(Qt::Dialog | Qt::Tool); + setupUi(this); + } + }; + + class InsertPeptideExtension : public Extension + { + Q_OBJECT + AVOGADRO_EXTENSION("InsertPeptide", tr("Insert Peptide"), + tr("Insert oligopeptide sequences")) + + public: + //! Constructor + InsertPeptideExtension(QObject *parent=0); + //! Destructor + ~InsertPeptideExtension(); + + //! Perform Action + QList actions() const; + QUndoCommand* performAction(QAction *action, GLWidget *widget); + QString menuPath(QAction *action) const; + void setMolecule(Molecule *molecule); + + void writeSettings(QSettings &settings) const; + void readSettings(QSettings &settings); + + public Q_SLOTS: + void performInsert(); + + void updateText(); + + void setStructureType(int); + void setPhi(double); + void setPsi(double); + + void setStereo(int); + + void dialogDestroyed(); + + private: + QList m_actions; + GLWidget* m_widget; + Molecule *m_molecule; + + double phi, psi, omega; + bool lStereo; + int structureType; + + InsertPeptideDialog *m_dialog; + void constructDialog(); + void updateDialog(); + }; + + class InsertPeptideExtensionFactory : public QObject, public PluginFactory + { + Q_OBJECT + Q_INTERFACES(Avogadro::PluginFactory) + AVOGADRO_EXTENSION_FACTORY(InsertPeptideExtension) + }; + +} // end namespace Avogadro + +#endif From 8023abcf6e45a6e0f43901ce2607e29f9b2e1e57 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Thu, 14 Jul 2022 17:56:34 -0400 Subject: [PATCH 2/9] Add PYL Signed-off-by: Geoff Hutchison --- .../insertpeptide/fragments/PYL.zmat | 38 +++++++++++++++++++ avogadro/qtplugins/insertpeptide/getamino.py | 6 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 avogadro/qtplugins/insertpeptide/fragments/PYL.zmat diff --git a/avogadro/qtplugins/insertpeptide/fragments/PYL.zmat b/avogadro/qtplugins/insertpeptide/fragments/PYL.zmat new file mode 100644 index 0000000000..59c940aa6e --- /dev/null +++ b/avogadro/qtplugins/insertpeptide/fragments/PYL.zmat @@ -0,0 +1,38 @@ +N N 0.0000 0.000000 0.000000 0 0 0 +C CA 1.4689 0.000000 0.000000 1 0 0 +C C 1.5068 109.4737 0.000000 2 1 0 +O O 1.2081 119.9803 340.0366 3 2 1 +C CB2 9.1237 111.4676 220.7596 2 1 3 +C CG2 1.5304 88.32532 307.2805 5 2 1 +C CD2 1.5473 111.1653 173.1919 6 5 2 +C CE2 1.5122 103.7931 218.5594 7 6 5 +N N2 1.2726 111.2463 15.89254 8 7 6 +C CA2 1.4676 112.5639 0.119969 9 8 7 +C C2 1.5064 110.3437 224.8654 10 9 8 +O O2 1.2131 120.0007 15.70823 11 10 9 +N NZ 1.3477 120.0342 195.6186 11 10 9 +C CE 1.4651 120.0190 180.0295 13 11 10 +C CD 1.5297 109.4732 180.0395 14 13 11 +C CG 1.5293 109.4788 180.0095 15 14 13 +C CB 1.5297 109.4788 180.0000 16 15 14 +O OXT 1.3421 119.9904 159.9746 3 2 1 +H HXT 0.9674 116.9746 180.0055 18 3 2 +H HA 1.0900 109.4776 120.0277 2 1 3 +H H 1.0098 110.9859 295.9900 1 2 3 +H HB3 1.0903 109.4768 299.9513 17 16 15 +H HB2 1.0895 109.5184 59.96634 17 16 15 +H HG3 1.0904 109.4701 299.9552 16 15 14 +H HG2 1.0895 109.4960 60.01183 16 15 14 +H HD3 1.0901 109.4547 300.0348 15 14 13 +H HD2 1.0905 109.4735 59.94377 15 14 13 +H HE3 1.0903 109.4354 300.0257 14 13 11 +H HE2 1.0895 109.4436 60.03385 14 13 11 +H HZ 0.9699 119.9657 0.101708 13 11 10 +H HA2 1.0903 110.2903 102.6514 10 9 8 +H HE22 1.0804 124.4128 195.9286 8 7 6 +H HD32 1.0902 110.5879 337.1387 7 6 5 +H HD22 1.0899 110.6215 99.94142 7 6 5 +H HG22 1.0899 110.9460 297.4611 6 5 2 +H HB12 1.0899 113.7249 57.81997 5 2 1 +H HB22 1.0899 21.77360 140.9865 5 2 1 +H HB32 1.0899 123.7714 194.8341 5 2 1 diff --git a/avogadro/qtplugins/insertpeptide/getamino.py b/avogadro/qtplugins/insertpeptide/getamino.py index 111f4e8d89..ab9c201210 100644 --- a/avogadro/qtplugins/insertpeptide/getamino.py +++ b/avogadro/qtplugins/insertpeptide/getamino.py @@ -34,6 +34,7 @@ "TYR", "VAL", # extra + "PYL", "SEC", # "MLY", "MLZ", "PYL", # caps "NME", @@ -62,7 +63,10 @@ elif ligand == "SEC": new_order = [1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 11, 12, 13, 14] mol_pdb.OBMol.RenumberAtoms(new_order) - # TODO: PYL, MLY, MLZ and others + elif ligand == "PYL": + new_order = [18, 14, 15, 17, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,36, 37, 38, 39] + mol_pdb.OBMol.RenumberAtoms(new_order) + # TODO: MLY, MLZ and others # remove the "extra" atoms (H2, OXT, HXT) removeAtoms = [] From 2bef579d77d6b89726a88f1076cb84d4b4d37d82 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Thu, 14 Jul 2022 18:03:06 -0400 Subject: [PATCH 3/9] More work Signed-off-by: Geoff Hutchison --- .../qtplugins/insertpeptide/insertpeptide.cpp | 86 +++---------------- .../qtplugins/insertpeptide/insertpeptide.h | 47 ++++------ 2 files changed, 29 insertions(+), 104 deletions(-) diff --git a/avogadro/qtplugins/insertpeptide/insertpeptide.cpp b/avogadro/qtplugins/insertpeptide/insertpeptide.cpp index 8c4fba6adb..de946cdbf3 100644 --- a/avogadro/qtplugins/insertpeptide/insertpeptide.cpp +++ b/avogadro/qtplugins/insertpeptide/insertpeptide.cpp @@ -3,122 +3,64 @@ This source code is released under the 3-Clause BSD License, (see "LICENSE"). ******************************************************************************/ -#include "insertfragment.h" -#include "insertfragmentdialog.h" +#include "insertpeptide.h" -#include #include #include -#include -#include - #include -#include #include -#include -#include -using Avogadro::Io::FileFormatManager; using Avogadro::QtGui::Molecule; namespace Avogadro::QtPlugins { -InsertFragment::InsertFragment(QObject* parent_) - : Avogadro::QtGui::ExtensionPlugin(parent_), m_crystalDialog(nullptr), - m_moleculeDialog(nullptr), m_reader(nullptr), m_molecule(nullptr) +InsertPeptide::InsertPeptide(QObject* parent_) + : Avogadro::QtGui::ExtensionPlugin(parent_) { - auto* action = new QAction(tr("Fragment…"), this); - action->setData("molecules"); // will also work for crystals - connect(action, SIGNAL(triggered()), SLOT(showDialog())); - m_actions.append(action); - - action = new QAction(tr("Crystal…"), this); - action->setData("crystals"); // will also work for crystals + auto* action = new QAction(tr("Peptide…"), this); connect(action, SIGNAL(triggered()), SLOT(showDialog())); m_actions.append(action); } -InsertFragment::~InsertFragment() +InsertPeptide::~InsertPeptide() { - delete m_reader; } -QList InsertFragment::actions() const +QList InsertPeptide::actions() const { return m_actions; } -QStringList InsertFragment::menuPath(QAction* action) const +QStringList InsertPeptide::menuPath(QAction* action) const { - if (action->data() == "crystals") - return QStringList() << tr("&File") << tr("&Import"); - else - return QStringList() << tr("&Build") << tr("&Insert"); + return QStringList() << tr("&Build") << tr("&Insert"); } -void InsertFragment::setMolecule(QtGui::Molecule* mol) +void InsertPeptide::setMolecule(QtGui::Molecule* mol) { m_molecule = mol; } -void InsertFragment::showDialog() +void InsertPeptide::showDialog() { if (!m_molecule) return; QWidget* parentAsWidget = qobject_cast(parent()); - auto* theSender = qobject_cast(sender()); - - // Prompt user for input: - bool crystal = theSender->data().toString() == "crystals"; - if (crystal) { - // create the dialog if it doesn't exist - if (!m_crystalDialog) { - m_crystalDialog = new InsertFragmentDialog(parentAsWidget, "crystals"); - connect(m_crystalDialog, &InsertFragmentDialog::performInsert, this, - &InsertFragment::performInsert); - } - m_crystalDialog->show(); - } else { - // fragments - create the dialog if it doesn't exist - if (!m_moleculeDialog) { - m_moleculeDialog = new InsertFragmentDialog(parentAsWidget, "molecules"); - connect(m_moleculeDialog, &InsertFragmentDialog::performInsert, this, - &InsertFragment::performInsert); - } - m_moleculeDialog->show(); - } } -void InsertFragment::performInsert(const QString& fileName, bool crystal) +void InsertFragment::performInsert(const QString& sequence) { if (m_molecule == nullptr) return; // read the file into the new fragment Avogadro::QtGui::Molecule newMol(m_molecule->parent()); - bool ok = - Io::FileFormatManager::instance().readFile(newMol, fileName.toStdString()); - if (!ok) { - QMessageBox::critical(qobject_cast(parent()), tr("Error"), - tr("Error reading file (%1).").arg(fileName)); - return; - } - - if (crystal) { - Molecule::MoleculeChanges changes = - (Molecule::Atoms | Molecule::Bonds | Molecule::Added | Molecule::Removed); - - m_molecule->undoMolecule()->modifyMolecule(newMol, changes, - tr("Import Crystal")); - emit requestActiveTool("Navigator"); - } else { - // insert mol into m_molecule - m_molecule->undoMolecule()->appendMolecule(newMol, tr("Insert Fragment")); - emit requestActiveTool("Manipulator"); - } + + m_molecule->undoMolecule()->appendMolecule(newMol, tr("Insert Peptide")); + emit requestActiveTool("Manipulator"); } } // namespace Avogadro diff --git a/avogadro/qtplugins/insertpeptide/insertpeptide.h b/avogadro/qtplugins/insertpeptide/insertpeptide.h index 39f2b2fdad..3f122313e6 100644 --- a/avogadro/qtplugins/insertpeptide/insertpeptide.h +++ b/avogadro/qtplugins/insertpeptide/insertpeptide.h @@ -3,37 +3,31 @@ This source code is released under the 3-Clause BSD License, (see "LICENSE"). ******************************************************************************/ -#ifndef AVOGADRO_QTPLUGINS_INSERTFRAGMENT_H -#define AVOGADRO_QTPLUGINS_INSERTFRAGMENT_H +#ifndef AVOGADRO_QTPLUGINS_INSERTPEPTIDE_H +#define AVOGADRO_QTPLUGINS_INSERTPEPTIDE_H #include -#include - -#include - namespace Avogadro { -namespace Io { -class FileFormat; -} namespace QtPlugins { -class InsertFragmentDialog; -} -namespace QtPlugins { +class InsertPeptideDialog; /** - * @brief Load single-line molecule descriptors through an input dialog. + * @brief Insert oligopeptide sequences */ -class InsertFragment : public QtGui::ExtensionPlugin +class InsertPeptide : public QtGui::ExtensionPlugin { Q_OBJECT public: - explicit InsertFragment(QObject* parent_ = nullptr); - ~InsertFragment() override; - - QString name() const override { return tr("InsertFragment"); } - QString description() const override; + explicit InsertPeptide(QObject* parent_ = nullptr); + ~InsertPeptide() override; + + QString name() const override { return tr("InsertPeptide"); } + QString description() const override + { + return tr("Insert oligopeptide sequences."); + } QList actions() const override; QStringList menuPath(QAction*) const override; @@ -42,25 +36,14 @@ public slots: private slots: void showDialog(); - void performInsert(const QString &fileName, bool crystal); + void performInsert(const QString& sequence); private: QList m_actions; - InsertFragmentDialog* m_moleculeDialog; - InsertFragmentDialog* m_crystalDialog; - /// Maps identifier to extension: - QMap m_formats; - QtGui::Molecule* m_molecule; - Io::FileFormat* m_reader; }; -inline QString InsertFragment::description() const -{ - return tr("Insert molecular fragments for building larger molecules."); -} - } // namespace QtPlugins } // namespace Avogadro -#endif // AVOGADRO_QTPLUGINS_INSERTFRAGMENT_H +#endif // AVOGADRO_QTPLUGINS_INSERTPEPTIDE_H From dc614c08ed72d99b201c81149badb5b88549471d Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Thu, 14 Jul 2022 18:22:43 -0400 Subject: [PATCH 4/9] Dialog work Signed-off-by: Geoff Hutchison --- .../insertpeptide/insertpeptidedialog.ui | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/avogadro/qtplugins/insertpeptide/insertpeptidedialog.ui b/avogadro/qtplugins/insertpeptide/insertpeptidedialog.ui index a166c6af46..e8540e2ad1 100644 --- a/avogadro/qtplugins/insertpeptide/insertpeptidedialog.ui +++ b/avogadro/qtplugins/insertpeptide/insertpeptidedialog.ui @@ -7,7 +7,7 @@ 0 0 447 - 428 + 432 @@ -276,6 +276,9 @@ + + false + Stereochemistry: @@ -295,9 +298,15 @@ + + false + D + + false + @@ -320,6 +329,14 @@ + + 2 + + + + CH₃CONH + + NH₂ @@ -334,6 +351,9 @@ + + 1 + CO₂H @@ -344,6 +364,11 @@ CO₂⁻ + + + CONHCH₃ + + From 00a5808a6395f224dc663468a069ac8141222bac Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Fri, 15 Jul 2022 12:14:53 -0400 Subject: [PATCH 5/9] Initial work to convert internal to Cartesian Signed-off-by: Geoff Hutchison --- avogadro/core/internalcoordinates.cpp | 108 ++++++++++++++++++++++++++ avogadro/core/internalcoordinates.h | 35 +++++++++ 2 files changed, 143 insertions(+) create mode 100644 avogadro/core/internalcoordinates.cpp create mode 100644 avogadro/core/internalcoordinates.h diff --git a/avogadro/core/internalcoordinates.cpp b/avogadro/core/internalcoordinates.cpp new file mode 100644 index 0000000000..a899bb20b6 --- /dev/null +++ b/avogadro/core/internalcoordinates.cpp @@ -0,0 +1,108 @@ +/****************************************************************************** + This source file is part of the Avogadro project. + This source code is released under the 3-Clause BSD License, (see "LICENSE"). +******************************************************************************/ + +#include "internalcoordinates.h" +#include "matrix.h" + +#include + +namespace Avogadro::Core { + +Array internalToCartesian( + const Molecule& molecule, const Array& internalCoords) +{ + Array coords(molecule.atomCount()); + Vector3 ab; + Vector3 bc; + Vector3 n; + Matrix3 m; + + for (Index i = 0; i < molecule.atomCount()++ i) { + Real sinTheta, cosTheta, sinPhi, cosPhi; + Real length = internalCoords[i].length; + Real angle = internalCoords[i].angle; + Real dihedral = internalCoords[i].dihedral; + + switch (i) { + case 0: + coords[i] = Vector3(0.0, 0.0, 0.0); + break; + case 1: + coords[i] = Vector3(length, 0.0, 0.0); + ab = Vector3(1.0, 0.0, 0.0); // normalized + break; + case 2: + sinTheta = std::sin(angle*DEG_TO_RAD); + cosTheta = std::cos(angle*DEG_TO_RAD); + coords[i] = Vector3(coords[i - 1] + length * cosTheta, + length * sinTheta, 0.0); + bc = (coords[i] - coords[i - 1]) / length; + break; + default: + // NeRF formula + // see J. Comp. Chem. Vol. 26, No. 10, p. 1063-1068 (2005) + // https://doi.org/10.1002/jcc.20237 + sinTheta = std::sin(internalCoords[i].angle); + cosTheta = std::cos(internalCoords[i].angle); + sinPhi = std::sin(internalCoords[i].dihedral); + cosPhi = std::cos(internalCoords[i].dihedral); + + n = (ab.cross(bc)).normalized(); + + // D2 in the paper nomenclature (page 1066) + // D2 = (RcosTheta, R*cosPhi*sinTheta, R*sinPhi*sinTheta) + coords[i] = Vector3(length*cosTheta, R*sinTheta*cosPhi, R*sinTheta*sinPhi); + m.col(0) = bc; + m.col(1) = n.cross(bc); + m.col(2) = n; + coords[i] = m * coords[i] + coords[i - 1]; + + // set up the vectors for the next iteration + ab = bc; + // we know the length, so we don't need .normalized() + // .. save ourself a square root + bc = (coords[i] - coords[i - 1]) / length; + break; + } + } + + return coords; +} + +Array cartesianToInternal(const Molecule& molecule) +{ + Array internalCoords(molecule.atomCount()); + /* + for (Index i = 0; i < molecule.numAtoms(); ++i) { + + Vector3 a = molecule.atom(i).pos(); + Vector3 b = molecule.atom(j).pos(); + Vector3 c = molecule.atom(k).pos(); + Vector3 ab = b - a; + Vector3 bc = c - b; + Vector3 ac = c - a; + Real lengthAB = ab.length(); + Real lengthBC = bc.length(); + Real lengthAC = ac.length(); + Real angleAB = std::acos(ab.dot(bc) / (lengthAB * lengthBC)); + Real angleAC = std::acos(ac.dot(bc) / (lengthAC * lengthBC)); + Real angleBC = std::acos(bc.dot(ab) / (lengthBC * lengthAB)); + Real dihedral = + std::acos((ab.dot(ac) * std::sin(angleAB) * std::sin(angleAC)) / + (lengthAB * lengthAC)); + + InternalCoordinate coord; + coord.a = i; + coord.b = j; + coord.c = k; + coord.length = lengthAB; + coord.angle = angleAB; + coord.dihedral = dihedral; + internalCoords.append(coord); + */ + return internalCoords; +} + +} // end namespace Avogadro::Core diff --git a/avogadro/core/internalcoordinates.h b/avogadro/core/internalcoordinates.h new file mode 100644 index 0000000000..e14c995853 --- /dev/null +++ b/avogadro/core/internalcoordinates.h @@ -0,0 +1,35 @@ +/****************************************************************************** + This source file is part of the Avogadro project. + This source code is released under the 3-Clause BSD License, (see "LICENSE"). +******************************************************************************/ + +#ifndef AVOGADRO_CORE_INTERNALCOORDINATES_H +#define AVOGADRO_CORE_INTERNALCOORDINATES_H + +#include "array.h" +#include "avogadrocore.h" +#include "vector.h" + +namespace Avogadro { +namespace Core { + +/** A simple struct to define internal / z-matrix coordinates. */ +struct InternalCoordinate +{ + Index a; + Index b; + Index c; + Real length; + Real angle; + Real dihedral; +}; + +Array internalToCartesian( + const Molecule& molecule, const Array& internalCoords); + +Array cartesianToInternal(const Molecule& molecule); + +} // namespace Core +} // namespace Avogadro + +#endif // AVOGADRO_CORE_INTERNALCOORDINATES_H From 714a31a89c64909ff57a7a62f91baad2185001a2 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Fri, 15 Jul 2022 13:27:00 -0400 Subject: [PATCH 6/9] More work Signed-off-by: Geoff Hutchison --- avogadro/qtplugins/insertpeptide/insertpeptide.cpp | 12 +++++++++++- avogadro/qtplugins/insertpeptide/insertpeptide.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/avogadro/qtplugins/insertpeptide/insertpeptide.cpp b/avogadro/qtplugins/insertpeptide/insertpeptide.cpp index de946cdbf3..6bf0d91df7 100644 --- a/avogadro/qtplugins/insertpeptide/insertpeptide.cpp +++ b/avogadro/qtplugins/insertpeptide/insertpeptide.cpp @@ -4,6 +4,7 @@ ******************************************************************************/ #include "insertpeptide.h" +#include "ui_insertpeptidedialog.h" #include #include @@ -16,8 +17,17 @@ using Avogadro::QtGui::Molecule; namespace Avogadro::QtPlugins { + class InsertPeptideDialog : public QDialog, public Ui::InsertPeptideDialog + { + public: + InsertPeptideDialog(QWidget *parent=0) : QDialog(parent) { + setWindowFlags(Qt::Dialog | Qt::Tool); + setupUi(this); + } + }; + InsertPeptide::InsertPeptide(QObject* parent_) - : Avogadro::QtGui::ExtensionPlugin(parent_) + : Avogadro::QtGui::ExtensionPlugin(parent_), m_dialog(nullptr) { auto* action = new QAction(tr("Peptide…"), this); connect(action, SIGNAL(triggered()), SLOT(showDialog())); diff --git a/avogadro/qtplugins/insertpeptide/insertpeptide.h b/avogadro/qtplugins/insertpeptide/insertpeptide.h index 3f122313e6..63a3d69390 100644 --- a/avogadro/qtplugins/insertpeptide/insertpeptide.h +++ b/avogadro/qtplugins/insertpeptide/insertpeptide.h @@ -41,6 +41,7 @@ private slots: private: QList m_actions; QtGui::Molecule* m_molecule; + InsertPeptideDialog* m_dialog; }; } // namespace QtPlugins From e9aac60c725588f9d8763eba65223aadaa9c0b0e Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Sat, 13 Aug 2022 14:53:57 -0400 Subject: [PATCH 7/9] Move fragments to the fragments repo Signed-off-by: Geoff Hutchison --- .../insertpeptide/fragments/ACE.zmat | 6 --- .../insertpeptide/fragments/AIB.zmat | 15 -------- .../insertpeptide/fragments/ALA.zmat | 12 ------ .../insertpeptide/fragments/ARG.zmat | 23 ----------- .../insertpeptide/fragments/ASN.zmat | 16 -------- .../insertpeptide/fragments/ASP.zmat | 15 -------- .../insertpeptide/fragments/CYS.zmat | 13 ------- .../insertpeptide/fragments/GLN.zmat | 19 ---------- .../insertpeptide/fragments/GLU.zmat | 18 --------- .../insertpeptide/fragments/GLY.zmat | 9 ----- .../insertpeptide/fragments/HIS.zmat | 20 ---------- .../insertpeptide/fragments/ILE.zmat | 21 ---------- .../insertpeptide/fragments/LEU.zmat | 21 ---------- .../insertpeptide/fragments/LYS.zmat | 24 ------------ .../insertpeptide/fragments/MET.zmat | 19 ---------- .../insertpeptide/fragments/NME.zmat | 6 --- .../insertpeptide/fragments/PHE.zmat | 22 ----------- .../insertpeptide/fragments/PRO.zmat | 17 --------- .../insertpeptide/fragments/PYL.zmat | 38 ------------------- .../insertpeptide/fragments/SEC.zmat | 13 ------- .../insertpeptide/fragments/SER.zmat | 13 ------- .../insertpeptide/fragments/THR.zmat | 16 -------- .../insertpeptide/fragments/TRP.zmat | 24 ------------ .../insertpeptide/fragments/TYR.zmat | 23 ----------- .../insertpeptide/fragments/VAL.zmat | 18 --------- 25 files changed, 441 deletions(-) delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/ACE.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/AIB.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/ALA.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/ARG.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/ASN.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/ASP.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/CYS.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/GLN.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/GLU.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/GLY.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/HIS.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/ILE.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/LEU.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/LYS.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/MET.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/NME.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/PHE.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/PRO.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/PYL.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/SEC.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/SER.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/THR.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/TRP.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/TYR.zmat delete mode 100644 avogadro/qtplugins/insertpeptide/fragments/VAL.zmat diff --git a/avogadro/qtplugins/insertpeptide/fragments/ACE.zmat b/avogadro/qtplugins/insertpeptide/fragments/ACE.zmat deleted file mode 100644 index 9da2b1675f..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/ACE.zmat +++ /dev/null @@ -1,6 +0,0 @@ -C CH3 0.0000 0.000000 0.000000 0 0 0 -H H 2.2508 0.000000 0.000000 1 0 0 -C C 1.0803 35.46101 0.000000 2 1 0 -O O 1.2072 120.0465 180.0000 3 2 1 -H H1 1.0900 119.9187 289.6056 1 2 3 -H H3 1.0899 84.91843 180.0000 1 2 3 diff --git a/avogadro/qtplugins/insertpeptide/fragments/AIB.zmat b/avogadro/qtplugins/insertpeptide/fragments/AIB.zmat deleted file mode 100644 index c49119e01d..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/AIB.zmat +++ /dev/null @@ -1,15 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4686 0.000000 0.000000 1 0 0 -C C 1.5059 109.4171 0.000000 2 1 0 -O O 1.2084 119.9458 150.0173 3 2 1 -O OXT 1.3413 120.0589 329.9213 3 2 1 -C CB1 1.5299 109.4321 119.9565 2 1 3 -C CB2 1.5287 109.4911 239.9557 2 1 3 -H H 1.0085 106.7340 300.0814 1 2 3 -H HO2 0.9673 120.0319 179.9951 5 3 2 -H HB11 1.0894 109.4608 60.06779 6 2 1 -H HB12 1.0899 109.4311 180.0189 6 2 1 -H HB13 1.0893 109.4736 300.0102 6 2 1 -H HB21 1.0891 109.4949 179.9677 7 2 1 -H HB22 1.0904 109.4702 299.9992 7 2 1 -H HB23 1.0901 109.4749 60.03897 7 2 1 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ALA.zmat b/avogadro/qtplugins/insertpeptide/fragments/ALA.zmat deleted file mode 100644 index 3931331829..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/ALA.zmat +++ /dev/null @@ -1,12 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4677 0.000000 0.000000 1 0 0 -C C 1.5054 109.5241 0.000000 2 1 0 -O O 1.2070 120.0308 330.1001 3 2 1 -C CB 1.5294 109.4645 240.0009 2 1 3 -O OXT 1.3419 120.0083 149.9558 3 2 1 -H H 1.0084 106.7514 59.95234 1 2 3 -H HA 1.0899 109.4654 120.0828 2 1 3 -H HB1 1.0906 109.4905 300.0287 5 2 1 -H HB2 1.0899 109.4323 59.99757 5 2 1 -H HB3 1.0900 109.5238 180.0387 5 2 1 -H HXT 0.9675 120.0129 180.0568 6 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ARG.zmat b/avogadro/qtplugins/insertpeptide/fragments/ARG.zmat deleted file mode 100644 index 78e06de04d..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/ARG.zmat +++ /dev/null @@ -1,23 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4617 0.000000 0.000000 1 0 0 -C C 1.5181 108.1384 0.000000 2 1 0 -O O 1.2241 125.4847 356.0694 3 2 1 -C C 1.5362 111.5499 236.4394 2 1 3 -C C 1.5370 114.5356 63.80061 5 2 1 -C C 1.5272 112.4169 177.6312 6 5 2 -N N 1.4435 111.0161 60.18268 7 6 5 -C C 1.4057 123.0046 179.9756 8 7 6 -N N 1.3905 120.9961 179.9864 9 8 7 -O OXT 1.3600 111.9146 175.9826 3 2 1 -H H 0.9966 117.9469 188.7658 1 2 3 -H HA 1.0963 107.5544 116.2989 2 1 3 -H H 1.0973 108.9070 301.3856 5 2 1 -H H 1.0980 108.8389 185.9250 5 2 1 -H H 1.0965 109.5460 57.53464 6 5 2 -H H 1.0967 110.0276 300.0132 6 5 2 -H H 1.0954 109.4797 179.9983 7 6 5 -H H 1.0952 110.6346 298.2449 7 6 5 -H H 1.0270 120.4290 0.146808 8 7 6 -H H 1.0177 120.9036 180.0404 10 9 8 -H H 1.0164 121.9420 0.197924 10 9 8 -H HXT 0.9813 115.2667 180.1501 11 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ASN.zmat b/avogadro/qtplugins/insertpeptide/fragments/ASN.zmat deleted file mode 100644 index dd9222c18a..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/ASN.zmat +++ /dev/null @@ -1,16 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4682 0.000000 0.000000 1 0 0 -C C 1.5072 109.5130 0.000000 2 1 0 -O O 1.2079 119.9723 340.0286 3 2 1 -C CB 1.5308 109.4540 240.0040 2 1 3 -C CG 1.5065 109.4843 295.0517 5 2 1 -O OD1 1.2132 119.9742 359.9445 6 5 2 -N ND2 1.3476 120.0120 180.0184 6 5 2 -O OXT 1.3421 120.0035 159.9845 3 2 1 -H H 1.0090 111.0009 296.0389 1 2 3 -H HA 1.0898 109.5055 120.0626 2 1 3 -H HB2 1.0903 109.4142 55.01933 5 2 1 -H HB3 1.0894 109.4697 175.0191 5 2 1 -H HD21 0.9701 119.9862 359.9484 8 6 5 -H HD22 0.9695 120.0576 179.9901 8 6 5 -H HXT 0.9673 117.0186 179.9857 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ASP.zmat b/avogadro/qtplugins/insertpeptide/fragments/ASP.zmat deleted file mode 100644 index 69ff29c57c..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/ASP.zmat +++ /dev/null @@ -1,15 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4687 0.000000 0.000000 1 0 0 -C C 1.5069 109.4804 0.000000 2 1 0 -O O 1.2090 119.9838 339.9761 3 2 1 -C CB 1.5300 109.4796 239.9886 2 1 3 -C CG 1.5075 109.4629 295.0120 5 2 1 -O OD1 1.2079 119.9589 359.9386 6 5 2 -O OD2 1.3414 119.9992 180.0027 6 5 2 -O OXT 1.3423 120.0375 160.0276 3 2 1 -H H 1.0092 110.9741 296.0413 1 2 3 -H HA 1.0901 109.4921 119.9456 2 1 3 -H HB2 1.0897 109.4853 54.97142 5 2 1 -H HB3 1.0900 109.4852 175.0010 5 2 1 -H HD2 0.9664 117.0275 179.9932 8 6 5 -H HXT 0.9672 117.0117 179.9501 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/CYS.zmat b/avogadro/qtplugins/insertpeptide/fragments/CYS.zmat deleted file mode 100644 index 85ef280c61..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/CYS.zmat +++ /dev/null @@ -1,13 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4688 0.000000 0.000000 1 0 0 -C C 1.5063 109.3893 0.000000 2 1 0 -O O 1.2067 120.0597 329.9811 3 2 1 -C CB 1.5284 109.4956 239.9862 2 1 3 -S SG 1.8141 109.4980 300.0021 5 2 1 -O OXT 1.3426 119.9769 149.9692 3 2 1 -H H 1.0081 106.7160 60.06859 1 2 3 -H HA 1.0897 109.4231 119.9603 2 1 3 -H HB2 1.0900 109.4724 59.98469 5 2 1 -H HB3 1.0895 109.4416 179.9840 5 2 1 -H HG 1.3444 100.0342 180.0381 6 5 2 -H HXT 0.9665 120.0015 179.9705 7 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/GLN.zmat b/avogadro/qtplugins/insertpeptide/fragments/GLN.zmat deleted file mode 100644 index 712ba45c50..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/GLN.zmat +++ /dev/null @@ -1,19 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4687 0.000000 0.000000 1 0 0 -C C 1.5062 109.4529 0.000000 2 1 0 -O O 1.2072 120.0332 329.9931 3 2 1 -C CB 1.5288 109.4591 239.9337 2 1 3 -C CG 1.5284 109.5344 300.0762 5 2 1 -C CD 1.5066 109.5426 180.0078 6 5 2 -O OE1 1.2122 119.9366 359.9450 7 6 5 -N NE2 1.3471 120.0932 179.9882 7 6 5 -O OXT 1.3426 119.9728 150.0266 3 2 1 -H H 1.0083 106.7232 59.96727 1 2 3 -H HA 1.0896 109.4409 120.0190 2 1 3 -H HB2 1.0906 109.4210 60.06983 5 2 1 -H HB3 1.0896 109.4408 179.9621 5 2 1 -H HG2 1.0906 109.4594 299.9700 6 5 2 -H HG3 1.0896 109.5021 59.92385 6 5 2 -H HE21 0.9693 120.1198 179.9881 9 7 6 -H HE22 0.9703 119.9554 359.9965 9 7 6 -H HXT 0.9672 120.0114 179.9868 10 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/GLU.zmat b/avogadro/qtplugins/insertpeptide/fragments/GLU.zmat deleted file mode 100644 index 1222e98b1a..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/GLU.zmat +++ /dev/null @@ -1,18 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4685 0.000000 0.000000 1 0 0 -C C 1.5077 109.4740 0.000000 2 1 0 -O O 1.2082 119.9808 340.0214 3 2 1 -C CB 1.5301 109.4823 240.0444 2 1 3 -C CG 1.5305 109.4016 294.9863 5 2 1 -C CD 1.5076 109.4303 180.0024 6 5 2 -O OE1 1.2083 120.0030 359.9670 7 6 5 -O OE2 1.3425 119.9976 180.0297 7 6 5 -O OXT 1.3419 119.9916 160.0419 3 2 1 -H H 1.0092 111.0465 59.99216 1 2 3 -H HA 1.0896 109.4996 120.0005 2 1 3 -H HB2 1.0900 109.5094 54.94982 5 2 1 -H HB3 1.0891 109.5036 175.0089 5 2 1 -H HG2 1.0900 109.5025 299.9677 6 5 2 -H HG3 1.0894 109.4462 60.04849 6 5 2 -H HE2 0.9662 116.9917 179.9872 9 7 6 -H HXT 0.9671 116.9919 180.0217 10 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/GLY.zmat b/avogadro/qtplugins/insertpeptide/fragments/GLY.zmat deleted file mode 100644 index 98cb4e7208..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/GLY.zmat +++ /dev/null @@ -1,9 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4696 0.000000 0.000000 1 0 0 -C C 1.5068 109.4387 0.000000 2 1 0 -O O 1.2081 120.0512 0.017594 3 2 1 -O OXT 1.3422 119.9671 180.0328 3 2 1 -H H 1.0081 111.0194 56.05797 1 2 3 -H HA2 1.0895 109.4828 119.9853 2 1 3 -H HA3 1.0902 109.4504 240.0322 2 1 3 -H HXT 0.9672 117.0442 180.0002 5 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/HIS.zmat b/avogadro/qtplugins/insertpeptide/fragments/HIS.zmat deleted file mode 100644 index a149e8840d..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/HIS.zmat +++ /dev/null @@ -1,20 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4410 0.000000 0.000000 1 0 0 -C C 1.5218 111.1470 0.000000 2 1 0 -O O 1.2269 122.9812 325.5385 3 2 1 -C CB 1.5336 111.1252 237.2205 2 1 3 -C CG 1.5099 112.9790 201.7956 5 2 1 -N ND1 1.3512 120.3285 269.9903 6 5 2 -C CD2 1.3375 129.9283 89.83600 6 5 2 -C CE1 1.3368 107.8621 179.9048 7 6 5 -N NE2 1.3370 107.6169 359.9566 9 7 6 -O OXT 1.3551 114.8546 145.0741 3 2 1 -H H 1.0064 119.0111 267.1248 1 2 3 -H HA 1.0957 106.2509 115.9169 2 1 3 -H HB2 1.0986 110.3817 322.9151 5 2 1 -H HB3 1.0982 110.1994 78.70511 5 2 1 -H HD1 1.0162 127.0804 359.9159 7 6 5 -H HD2 1.0722 137.1496 359.9774 8 6 5 -H HE1 1.0776 126.1755 179.9914 9 7 6 -H HE2 1.0156 125.0780 180.0841 10 9 7 -H HXT 0.9804 114.8373 180.4044 11 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/ILE.zmat b/avogadro/qtplugins/insertpeptide/fragments/ILE.zmat deleted file mode 100644 index a08971ea91..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/ILE.zmat +++ /dev/null @@ -1,21 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4688 0.000000 0.000000 1 0 0 -C C 1.5061 109.4831 0.000000 2 1 0 -O O 1.2075 120.0000 329.9431 3 2 1 -C CB 1.5288 109.4301 239.9267 2 1 3 -C CG1 1.5294 109.5473 300.0058 5 2 1 -C CG2 1.5303 109.4576 180.0339 5 2 1 -C CD1 1.5288 109.5473 180.0000 6 5 2 -O OXT 1.3416 120.0309 150.0613 3 2 1 -H H 1.0073 106.7077 60.00293 1 2 3 -H HA 1.0906 109.4978 119.9738 2 1 3 -H HB 1.0892 109.4848 60.09626 5 2 1 -H HG12 1.0898 109.4337 60.02852 6 5 2 -H HG13 1.0895 109.4756 300.0331 6 5 2 -H HG21 1.0884 109.4849 59.97255 7 5 2 -H HG22 1.0900 109.4496 180.0516 7 5 2 -H HG23 1.0897 109.4798 299.9703 7 5 2 -H HD11 1.0891 109.6037 180.0081 8 6 5 -H HD12 1.0902 109.4935 300.0985 8 6 5 -H HD13 1.0896 109.4578 59.97957 8 6 5 -H HXT 0.9674 120.0631 179.9546 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/LEU.zmat b/avogadro/qtplugins/insertpeptide/fragments/LEU.zmat deleted file mode 100644 index e5c820b482..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/LEU.zmat +++ /dev/null @@ -1,21 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4690 0.000000 0.000000 1 0 0 -C C 1.5061 109.4376 0.000000 2 1 0 -O O 1.2076 120.0886 330.0194 3 2 1 -C CB 1.5286 109.4163 240.0272 2 1 3 -C CG 1.5302 109.4949 299.9316 5 2 1 -C CD1 1.5300 109.5000 179.9852 6 5 2 -C CD2 1.5285 109.5007 300.0770 6 5 2 -O OXT 1.3425 119.9808 150.0480 3 2 1 -H H 1.0078 106.7663 59.96217 1 2 3 -H HA 1.0894 109.4715 120.0526 2 1 3 -H HB2 1.0898 109.4621 179.9668 5 2 1 -H HB3 1.0901 109.5405 60.01234 5 2 1 -H HG 1.0895 109.4031 60.12393 6 5 2 -H HD11 1.0891 109.4929 179.9785 7 6 5 -H HD12 1.0903 109.5083 300.1220 7 6 5 -H HD13 1.0898 109.4475 60.04104 7 6 5 -H HD21 1.0898 109.4268 299.9467 8 6 5 -H HD22 1.0898 109.4970 59.94242 8 6 5 -H HD23 1.0903 109.4846 179.9828 8 6 5 -H HXT 0.9661 120.0406 179.9773 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/LYS.zmat b/avogadro/qtplugins/insertpeptide/fragments/LYS.zmat deleted file mode 100644 index 24b1ed3dbf..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/LYS.zmat +++ /dev/null @@ -1,24 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4693 0.000000 0.000000 1 0 0 -C C 1.5065 109.4699 0.000000 2 1 0 -O O 1.2079 120.0256 339.9907 3 2 1 -C CB 1.5299 109.4526 240.0329 2 1 3 -C CG 1.5307 109.4176 294.9790 5 2 1 -C CD 1.5307 109.4405 179.9999 6 5 2 -C CE 1.5291 109.4646 179.9974 7 6 5 -N NZ 1.4694 109.5003 180.0488 8 7 6 -O OXT 1.3430 119.9901 160.0293 3 2 1 -H H 1.0087 106.6766 59.99811 1 2 3 -H HA 1.0894 109.4516 119.9862 2 1 3 -H HB2 1.0890 109.5091 54.99614 5 2 1 -H HB3 1.0901 109.4868 175.0350 5 2 1 -H HG2 1.0893 109.4687 299.9789 6 5 2 -H HG3 1.0901 109.4907 60.05621 6 5 2 -H HD2 1.0900 109.5046 300.0335 7 6 5 -H HD3 1.0901 109.4308 60.01949 7 6 5 -H HE2 1.0900 109.5335 300.0205 8 7 6 -H HE3 1.0900 109.5013 60.00135 8 7 6 -H HZ1 1.0094 109.3691 299.9953 9 8 7 -H HZ2 1.0083 109.4677 59.95000 9 8 7 -H HZ3 1.0087 109.5277 180.0401 9 8 7 -H HXT 0.9671 119.9875 180.0263 10 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/MET.zmat b/avogadro/qtplugins/insertpeptide/fragments/MET.zmat deleted file mode 100644 index 45422004fb..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/MET.zmat +++ /dev/null @@ -1,19 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4688 0.000000 0.000000 1 0 0 -C C 1.5062 109.4319 0.000000 2 1 0 -O O 1.2071 120.0537 329.9835 3 2 1 -C CB 1.5293 109.4273 239.9632 2 1 3 -C CG 1.5283 109.5448 299.9834 5 2 1 -S SD 1.8137 109.5064 180.0152 6 5 2 -C CE 1.8135 100.0339 180.0049 7 6 5 -O OXT 1.3426 119.9938 150.0196 3 2 1 -H H 1.0086 106.7237 60.01292 1 2 3 -H HA 1.0895 109.4718 120.0071 2 1 3 -H HB2 1.0900 109.4389 179.9436 5 2 1 -H HB3 1.0905 109.4619 60.03777 5 2 1 -H HG2 1.0903 109.4600 60.03549 6 5 2 -H HG3 1.0895 109.4834 300.0351 6 5 2 -H HE1 1.0890 109.5482 179.9723 8 7 6 -H HE2 1.0893 109.4601 299.9972 8 7 6 -H HE3 1.0898 109.4478 60.03030 8 7 6 -H HXT 0.9668 120.0005 179.9927 9 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/NME.zmat b/avogadro/qtplugins/insertpeptide/fragments/NME.zmat deleted file mode 100644 index 5a384a85d1..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/NME.zmat +++ /dev/null @@ -1,6 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C C 1.4690 0.000000 0.000000 1 0 0 -H HN1 1.0096 111.0105 0.000000 1 2 0 -H H1 1.0898 109.4340 176.0657 2 1 3 -H H2 1.0900 109.4546 296.0175 2 1 3 -H H3 1.0897 109.4499 56.05866 2 1 3 diff --git a/avogadro/qtplugins/insertpeptide/fragments/PHE.zmat b/avogadro/qtplugins/insertpeptide/fragments/PHE.zmat deleted file mode 100644 index 5d357e9b26..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/PHE.zmat +++ /dev/null @@ -1,22 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4685 0.000000 0.000000 1 0 0 -C C 1.5071 109.4924 0.000000 2 1 0 -O O 1.2069 119.9830 329.9446 3 2 1 -C CB 1.5289 109.4735 239.9059 2 1 3 -C CG 1.5052 109.5165 300.0678 5 2 1 -C CD1 1.3817 120.0584 89.96778 6 5 2 -C CD2 1.3831 120.0047 269.7252 6 5 2 -C CE1 1.3819 120.0292 179.9941 7 6 5 -C CE2 1.3818 119.9769 179.8391 8 6 5 -C CZ 1.3806 120.0469 359.9515 9 7 6 -O OXT 1.3413 120.0246 150.0013 3 2 1 -H H 1.0087 106.6385 60.03405 1 2 3 -H HA 1.0896 109.4338 119.9573 2 1 3 -H HB2 1.0905 109.4434 60.11997 5 2 1 -H HB3 1.0896 109.4924 179.9979 5 2 1 -H HD1 1.0800 119.9524 0.036931 7 6 5 -H HD2 1.0801 119.9716 0.153951 8 6 5 -H HE1 1.0801 119.9772 179.9695 9 7 6 -H HE2 1.0808 119.9333 180.2676 10 8 6 -H HZ 1.0799 120.0735 179.9385 11 9 7 -H HXT 0.9667 120.0207 180.0091 12 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/PRO.zmat b/avogadro/qtplugins/insertpeptide/fragments/PRO.zmat deleted file mode 100644 index d573746e78..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/PRO.zmat +++ /dev/null @@ -1,17 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4861 0.000000 0.000000 1 0 0 -C C 1.5076 110.3843 0.000000 2 1 0 -O O 1.2084 119.9888 343.0105 3 2 1 -C CB 1.5433 104.7219 241.1593 2 1 3 -C CG 1.5426 105.0593 336.2003 5 2 1 -C CD 1.4866 104.1364 158.1429 1 2 3 -O OXT 1.3420 119.9824 163.0770 3 2 1 -H H 1.0083 106.8822 270.8915 1 2 3 -H HA 1.0898 110.3995 122.2913 2 1 3 -H HB2 1.0902 110.3550 95.01776 5 2 1 -H HB3 1.0895 110.3543 217.3112 5 2 1 -H HG2 1.0900 110.3647 118.8608 6 5 2 -H HG3 1.0903 110.3652 241.1389 6 5 2 -H HD2 1.0903 110.4433 201.8084 7 1 2 -H HD3 1.0899 110.2551 79.49266 7 1 2 -H HXT 0.9664 119.9828 180.0082 8 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/PYL.zmat b/avogadro/qtplugins/insertpeptide/fragments/PYL.zmat deleted file mode 100644 index 59c940aa6e..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/PYL.zmat +++ /dev/null @@ -1,38 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4689 0.000000 0.000000 1 0 0 -C C 1.5068 109.4737 0.000000 2 1 0 -O O 1.2081 119.9803 340.0366 3 2 1 -C CB2 9.1237 111.4676 220.7596 2 1 3 -C CG2 1.5304 88.32532 307.2805 5 2 1 -C CD2 1.5473 111.1653 173.1919 6 5 2 -C CE2 1.5122 103.7931 218.5594 7 6 5 -N N2 1.2726 111.2463 15.89254 8 7 6 -C CA2 1.4676 112.5639 0.119969 9 8 7 -C C2 1.5064 110.3437 224.8654 10 9 8 -O O2 1.2131 120.0007 15.70823 11 10 9 -N NZ 1.3477 120.0342 195.6186 11 10 9 -C CE 1.4651 120.0190 180.0295 13 11 10 -C CD 1.5297 109.4732 180.0395 14 13 11 -C CG 1.5293 109.4788 180.0095 15 14 13 -C CB 1.5297 109.4788 180.0000 16 15 14 -O OXT 1.3421 119.9904 159.9746 3 2 1 -H HXT 0.9674 116.9746 180.0055 18 3 2 -H HA 1.0900 109.4776 120.0277 2 1 3 -H H 1.0098 110.9859 295.9900 1 2 3 -H HB3 1.0903 109.4768 299.9513 17 16 15 -H HB2 1.0895 109.5184 59.96634 17 16 15 -H HG3 1.0904 109.4701 299.9552 16 15 14 -H HG2 1.0895 109.4960 60.01183 16 15 14 -H HD3 1.0901 109.4547 300.0348 15 14 13 -H HD2 1.0905 109.4735 59.94377 15 14 13 -H HE3 1.0903 109.4354 300.0257 14 13 11 -H HE2 1.0895 109.4436 60.03385 14 13 11 -H HZ 0.9699 119.9657 0.101708 13 11 10 -H HA2 1.0903 110.2903 102.6514 10 9 8 -H HE22 1.0804 124.4128 195.9286 8 7 6 -H HD32 1.0902 110.5879 337.1387 7 6 5 -H HD22 1.0899 110.6215 99.94142 7 6 5 -H HG22 1.0899 110.9460 297.4611 6 5 2 -H HB12 1.0899 113.7249 57.81997 5 2 1 -H HB22 1.0899 21.77360 140.9865 5 2 1 -H HB32 1.0899 123.7714 194.8341 5 2 1 diff --git a/avogadro/qtplugins/insertpeptide/fragments/SEC.zmat b/avogadro/qtplugins/insertpeptide/fragments/SEC.zmat deleted file mode 100644 index 40eac856ea..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/SEC.zmat +++ /dev/null @@ -1,13 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4686 0.000000 0.000000 1 0 0 -C C 1.5076 109.4680 0.000000 2 1 0 -O O 1.2083 119.9540 339.9695 3 2 1 -C CB 1.5295 109.5015 239.9663 2 1 3 -Se SE 1.9599 109.4679 295.0058 5 2 1 -O OXT 1.3419 120.0087 159.9700 3 2 1 -H H 1.0087 111.0452 296.0359 1 2 3 -H HA 1.0897 109.4886 119.9515 2 1 3 -H HB2 1.0899 109.4752 54.96829 5 2 1 -H HB3 1.0904 109.4844 174.9757 5 2 1 -H HE 1.5608 100.9695 179.9790 6 5 2 -H HXT 0.9667 116.9770 179.9525 7 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/SER.zmat b/avogadro/qtplugins/insertpeptide/fragments/SER.zmat deleted file mode 100644 index be60430ff2..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/SER.zmat +++ /dev/null @@ -1,13 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4689 0.000000 0.000000 1 0 0 -C C 1.5067 109.4352 0.000000 2 1 0 -O O 1.2069 120.0466 329.9939 3 2 1 -C CB 1.5287 109.4711 239.9795 2 1 3 -O OG 1.4283 109.5115 300.0305 5 2 1 -O OXT 1.3418 119.9531 149.9881 3 2 1 -H H 1.0080 106.7161 59.97649 1 2 3 -H HA 1.0897 109.4275 119.9662 2 1 3 -H HB2 1.0901 109.4340 60.03743 5 2 1 -H HB3 1.0896 109.4804 179.9939 5 2 1 -H HG 0.9669 106.8144 180.0309 6 5 2 -H HXT 0.9673 120.0092 180.0020 7 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/THR.zmat b/avogadro/qtplugins/insertpeptide/fragments/THR.zmat deleted file mode 100644 index d1776fff9c..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/THR.zmat +++ /dev/null @@ -1,16 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4693 0.000000 0.000000 1 0 0 -C C 1.5060 109.4088 0.000000 2 1 0 -O O 1.2070 120.0934 329.9820 3 2 1 -C CB 1.5289 109.4115 239.9998 2 1 3 -O OG1 1.4280 109.5053 60.02168 5 2 1 -C CG2 1.5301 109.5254 299.9908 5 2 1 -O OXT 1.3423 119.9177 150.0143 3 2 1 -H H 1.0074 106.7226 59.99129 1 2 3 -H HA 1.0898 109.4163 120.0013 2 1 3 -H HB 1.0897 109.4276 180.0138 5 2 1 -H HG1 0.9665 106.8125 299.9435 6 5 2 -H HG21 1.0893 109.4778 180.0629 7 5 2 -H HG22 1.0901 109.4679 300.0565 7 5 2 -H HG23 1.0888 109.4590 60.04122 7 5 2 -H HXT 0.9669 119.9569 179.9139 8 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/TRP.zmat b/avogadro/qtplugins/insertpeptide/fragments/TRP.zmat deleted file mode 100644 index 47dfe5ed74..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/TRP.zmat +++ /dev/null @@ -1,24 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4687 0.000000 0.000000 1 0 0 -C C 1.5074 109.4283 0.000000 2 1 0 -O O 1.2078 119.9978 329.9998 3 2 1 -C C 1.5286 109.5226 239.9744 2 1 3 -C C 1.5067 109.4418 299.9990 5 2 1 -C C 1.3425 126.4957 90.03792 6 5 2 -C C 1.4639 126.5118 269.6594 6 5 2 -N N 1.3686 109.9317 179.9435 7 6 5 -C C 1.3768 109.8503 359.9382 9 7 6 -C C 1.3960 134.0470 0.783874 8 6 5 -C C 1.3905 133.5052 180.0019 10 9 7 -C C 1.3658 119.7952 179.6390 11 8 6 -O OXT 1.3421 119.9724 150.0225 3 2 1 -H H 1.0092 106.6869 60.04729 1 2 3 -H HA 1.0898 109.4787 119.9395 2 1 3 -H H 1.0898 109.4702 59.95987 5 2 1 -H H 1.0894 109.5124 180.0059 5 2 1 -H H 1.0791 125.0893 359.9421 7 6 5 -H H 0.9691 125.0686 180.0301 9 7 6 -H H 1.0801 120.0707 359.3219 11 8 6 -H H 1.0804 120.1130 359.9568 12 10 9 -H H 1.0798 119.7561 179.6597 13 11 8 -H HXT 0.9670 119.9595 180.0536 14 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/TYR.zmat b/avogadro/qtplugins/insertpeptide/fragments/TYR.zmat deleted file mode 100644 index 94d644eb2b..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/TYR.zmat +++ /dev/null @@ -1,23 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4688 0.000000 0.000000 1 0 0 -C C 1.5071 109.4691 0.000000 2 1 0 -O O 1.2069 120.0078 330.0234 3 2 1 -C CB 1.5287 109.4702 239.9590 2 1 3 -C CG 1.5061 109.4974 300.0187 5 2 1 -C CD1 1.3823 119.9470 90.02964 6 5 2 -C CD2 1.3829 119.9427 269.7215 6 5 2 -C CE1 1.3809 120.0728 180.0236 7 6 5 -C CE2 1.3809 120.0203 179.7745 8 6 5 -C CZ 1.3867 119.9781 359.8979 9 7 6 -O OH 1.3581 120.1300 180.0340 11 9 7 -O OXT 1.3423 119.9533 149.9700 3 2 1 -H H 1.0090 106.6670 60.00949 1 2 3 -H HA 1.0906 109.4278 119.9905 2 1 3 -H HB2 1.0892 109.5117 60.12204 5 2 1 -H HB3 1.0909 109.4603 180.0300 5 2 1 -H HD1 1.0793 119.9414 0.027701 7 6 5 -H HD2 1.0795 119.9964 0.243787 8 6 5 -H HE1 1.0795 120.0572 179.9539 9 7 6 -H HE2 1.0799 120.0441 180.3397 10 8 6 -H HH 0.9663 106.8813 90.03999 12 11 9 -H HXT 0.9675 119.9331 180.0803 13 3 2 diff --git a/avogadro/qtplugins/insertpeptide/fragments/VAL.zmat b/avogadro/qtplugins/insertpeptide/fragments/VAL.zmat deleted file mode 100644 index ca2644a61b..0000000000 --- a/avogadro/qtplugins/insertpeptide/fragments/VAL.zmat +++ /dev/null @@ -1,18 +0,0 @@ -N N 0.0000 0.000000 0.000000 0 0 0 -C CA 1.4687 0.000000 0.000000 1 0 0 -C C 1.5059 109.4631 0.000000 2 1 0 -O O 1.2075 120.0245 330.0003 3 2 1 -C CB 1.5287 109.4451 239.9962 2 1 3 -C CG1 1.5298 109.5086 300.0064 5 2 1 -C CG2 1.5292 109.4895 60.03210 5 2 1 -O OXT 1.3423 119.9903 149.9836 3 2 1 -H H 1.0083 106.6869 60.00203 1 2 3 -H HA 1.0896 109.4704 120.0076 2 1 3 -H HB 1.0908 109.4559 180.0351 5 2 1 -H HG11 1.0904 109.5197 180.0107 6 5 2 -H HG12 1.0896 109.4569 300.0192 6 5 2 -H HG13 1.0889 109.4590 60.03317 6 5 2 -H HG21 1.0898 109.4732 299.9788 7 5 2 -H HG22 1.0896 109.4963 59.97466 7 5 2 -H HG23 1.0903 109.5303 179.9528 7 5 2 -H HXT 0.9674 119.9801 179.9759 8 3 2 From 57e0dd65ff346d3efc238c25e6561dad9bf29b2e Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Tue, 28 Nov 2023 12:43:18 -0500 Subject: [PATCH 8/9] Compile Signed-off-by: Geoff Hutchison --- avogadro/qtplugins/CMakeLists.txt | 1 + .../qtplugins/insertpeptide/CMakeLists.txt | 29 ++++- avogadro/qtplugins/insertpeptide/getamino.py | 113 ------------------ .../qtplugins/insertpeptide/insertpeptide.cpp | 12 +- 4 files changed, 32 insertions(+), 123 deletions(-) delete mode 100644 avogadro/qtplugins/insertpeptide/getamino.py diff --git a/avogadro/qtplugins/CMakeLists.txt b/avogadro/qtplugins/CMakeLists.txt index 016baca235..93bdc5e904 100644 --- a/avogadro/qtplugins/CMakeLists.txt +++ b/avogadro/qtplugins/CMakeLists.txt @@ -112,6 +112,7 @@ add_subdirectory(forcefield) add_subdirectory(hydrogens) add_subdirectory(importpqr) add_subdirectory(insertdna) +add_subdirectory(insertpeptide) add_subdirectory(label) add_subdirectory(lineformatinput) add_subdirectory(manipulator) diff --git a/avogadro/qtplugins/insertpeptide/CMakeLists.txt b/avogadro/qtplugins/insertpeptide/CMakeLists.txt index cbbabce8b2..627a074e6d 100644 --- a/avogadro/qtplugins/insertpeptide/CMakeLists.txt +++ b/avogadro/qtplugins/insertpeptide/CMakeLists.txt @@ -1,15 +1,32 @@ -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +include(ExternalProject) -avogadro_plugin(InsertFragment +avogadro_plugin(InsertPeptide "Insert oligopeptide chains" ExtensionPlugin insertpeptide.h - InsertFragment + InsertPeptide insertpeptide.cpp insertpeptidedialog.ui ) -install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/fragments" -DESTINATION "${INSTALL_DATA_DIR}/avogadro2" -PATTERN ".git" EXCLUDE +# Install the fragments +set(_fragments "${AvogadroLibs_SOURCE_DIR}/../fragments") + +# Look in parallel directory for the molecule fragment repository +if(NOT EXISTS "${_fragments}") +# download molecules... +ExternalProject_Add(fragments + GIT_REPOSITORY https://github.com/openchemistry/fragments + GIT_TAG main + # or https://github.com/OpenChemistry/molecules/archive/refs/heads/master.zip + SOURCE_DIR "${AvogadroLibs_SOURCE_DIR}/../fragments" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) +endif() + +install(DIRECTORY "${AvogadroLibs_SOURCE_DIR}/../fragments" + DESTINATION "${INSTALL_DATA_DIR}/avogadro2" + PATTERN ".git" EXCLUDE ) diff --git a/avogadro/qtplugins/insertpeptide/getamino.py b/avogadro/qtplugins/insertpeptide/getamino.py deleted file mode 100644 index ab9c201210..0000000000 --- a/avogadro/qtplugins/insertpeptide/getamino.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python - -import os - -import requests - -from openbabel import pybel -from openbabel import openbabel as ob - -# URL for the ideal geometry (PDB) -pdbTemplate = "http://ligand-expo.rcsb.org/reports/{}/{}/{}_ideal.pdb" - -# default ligand list -ligands = [ - # 20 common amino acids - "ALA", - "ARG", - "ASP", - "ASN", - "CYS", - "GLU", - "GLN", - "GLY", - "HIS", - "ILE", - "LEU", - "LYS", - "MET", - "PHE", - "PRO", - "SER", - "THR", - "TRP", - "TYR", - "VAL", - # extra - "PYL", - "SEC", # "MLY", "MLZ", "PYL", - # caps - "NME", - "ACE", - # misc - "AIB", -] - -for ligand in ligands: - pdb = requests.get(pdbTemplate.format(ligand[0], ligand, ligand)) - with open("temp.pdb", "wb") as handle: - for block in pdb.iter_content(1024): - handle.write(block) - - try: - mol_pdb = next(pybel.readfile("pdb", "temp.pdb")) - except StopIteration: - continue - - # fix up some atom orders - if ligand == "ACE": - # reorder the atoms to make sure C=O are 3, 4 - # unfortunately, OB won't let H be the first atom - new_order = [3, 4, 1, 2, 5, 6, 7] - mol_pdb.OBMol.RenumberAtoms(new_order) - elif ligand == "SEC": - new_order = [1, 2, 5, 6, 3, 4, 7, 8, 9, 10, 11, 12, 13, 14] - mol_pdb.OBMol.RenumberAtoms(new_order) - elif ligand == "PYL": - new_order = [18, 14, 15, 17, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,36, 37, 38, 39] - mol_pdb.OBMol.RenumberAtoms(new_order) - # TODO: MLY, MLZ and others - - # remove the "extra" atoms (H2, OXT, HXT) - removeAtoms = [] - for atom in mol_pdb.atoms: - name = atom.OBAtom.GetResidue().GetAtomID(atom.OBAtom) - -# if name.find("HXT") != -1 or name.find("OXT") != -1: -# removeAtoms.append(atom.OBAtom) - # NME is tricky - if ligand == "NME" and name.find("HN2") != -1: - removeAtoms.append(atom.OBAtom) - if ligand != "NME" and name.find("H2") != -1: - removeAtoms.append(atom.OBAtom) - - for atom in removeAtoms: - mol_pdb.OBMol.DeleteAtom(atom, False) - - # convert to a MOPAC internal - internal = mol_pdb.write("mopin") - - # drop the first two lines of internal - with open(ligand + ".zmat", "w") as f: - i = 0 - # drop the first two lines - for line in internal.splitlines()[2:]: - items = line.split() - if len(items) < 10: - continue - - element = items[0] - length = items[1] - angle = items[3] - torsion = items[5] - atom1, atom2, atom3 = items[7], items[8], items[9] - - obatom = mol_pdb.atoms[i].OBAtom - name = obatom.GetResidue().GetAtomID(obatom) - i += 1 - - f.write( - f"{element:2} {name} {length:2.6} {angle:4.8} {torsion:4.8} {atom1:>3} {atom2:>3} {atom3:>3}\n" - ) - -os.remove("temp.pdb") diff --git a/avogadro/qtplugins/insertpeptide/insertpeptide.cpp b/avogadro/qtplugins/insertpeptide/insertpeptide.cpp index 6bf0d91df7..a5003f4a60 100644 --- a/avogadro/qtplugins/insertpeptide/insertpeptide.cpp +++ b/avogadro/qtplugins/insertpeptide/insertpeptide.cpp @@ -55,13 +55,17 @@ void InsertPeptide::setMolecule(QtGui::Molecule* mol) void InsertPeptide::showDialog() { - if (!m_molecule) + if (m_molecule == nullptr) return; - QWidget* parentAsWidget = qobject_cast(parent()); + if (m_dialog == nullptr) { + m_dialog = new InsertPeptideDialog(qobject_cast(parent())); + } + + m_dialog->show(); } -void InsertFragment::performInsert(const QString& sequence) +void InsertPeptide::performInsert(const QString& sequence) { if (m_molecule == nullptr) return; @@ -69,7 +73,7 @@ void InsertFragment::performInsert(const QString& sequence) // read the file into the new fragment Avogadro::QtGui::Molecule newMol(m_molecule->parent()); - m_molecule->undoMolecule()->appendMolecule(newMol, tr("Insert Peptide")); + //m_molecule->undoMolecule()->appendMolecule(newMol, tr("Insert Peptide")); emit requestActiveTool("Manipulator"); } From 4e52a46de52960b56c8dd0a0c61702dee0f836c0 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Tue, 28 Nov 2023 12:44:24 -0500 Subject: [PATCH 9/9] Generate the density matrix if needed for the electron density surface Fix #1480 and the bug report on the forum: https://discuss.avogadro.cc/t/visualize-electron-density-from-orca-molden-file/3750 Signed-off-by: Geoff Hutchison --- avogadro/core/gaussiansettools.cpp | 9 ++++++++- .../qtplugins/surfaces/gaussiansetconcurrent.cpp | 12 +++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/avogadro/core/gaussiansettools.cpp b/avogadro/core/gaussiansettools.cpp index 72382090f5..b15b8df117 100644 --- a/avogadro/core/gaussiansettools.cpp +++ b/avogadro/core/gaussiansettools.cpp @@ -55,7 +55,13 @@ double GaussianSetTools::calculateMolecularOrbital(const Vector3& position, } bool GaussianSetTools::calculateElectronDensity(Cube& cube) const -{ +{ + const MatrixX& matrix = m_basis->densityMatrix(); + if (matrix.rows() == 0 || matrix.cols() == 0) { + // we don't have a density matrix, so generate one + m_basis->generateDensityMatrix(); + } + for (size_t i = 0; i < cube.data()->size(); ++i) { Vector3 pos = cube.position(i); cube.setValue(i, calculateElectronDensity(pos)); @@ -67,6 +73,7 @@ double GaussianSetTools::calculateElectronDensity(const Vector3& position) const { const MatrixX& matrix = m_basis->densityMatrix(); int matrixSize(static_cast(m_basis->moMatrix().rows())); + if (matrix.rows() != matrixSize || matrix.cols() != matrixSize) { return 0.0; } diff --git a/avogadro/qtplugins/surfaces/gaussiansetconcurrent.cpp b/avogadro/qtplugins/surfaces/gaussiansetconcurrent.cpp index 7c3771fee1..099fc7dacd 100644 --- a/avogadro/qtplugins/surfaces/gaussiansetconcurrent.cpp +++ b/avogadro/qtplugins/surfaces/gaussiansetconcurrent.cpp @@ -56,8 +56,8 @@ void GaussianSetConcurrent::setMolecule(Core::Molecule* mol) if (!mol) return; m_set = dynamic_cast(mol->basisSet()); - - delete m_tools; + + delete m_tools; m_tools = new GaussianSetTools(mol); } @@ -76,6 +76,12 @@ bool GaussianSetConcurrent::calculateMolecularOrbital(Core::Cube* cube, bool GaussianSetConcurrent::calculateElectronDensity(Core::Cube* cube) { + const MatrixX& matrix = m_set->densityMatrix(); + if (matrix.rows() == 0 || matrix.cols() == 0) { + // we don't have a density matrix, so calculate one + m_set->generateDensityMatrix(); + } + return setUpCalculation(cube, 0, GaussianSetConcurrent::processDensity); } @@ -141,4 +147,4 @@ void GaussianSetConcurrent::processSpinDensity(GaussianShell& shell) Vector3 pos = shell.tCube->position(shell.pos); shell.tCube->setValue(shell.pos, shell.tools->calculateSpinDensity(pos)); } -} +} // namespace Avogadro::QtPlugins