3 |
|
#include "pcmod.h" |
4 |
|
#include "field.h" |
5 |
|
#include "atom_k.h" |
6 |
– |
#include "pdb.h" |
6 |
|
|
7 |
|
void deleteatom(int); |
8 |
|
int make_atom(int, float, float, float,char *); |
18 |
|
void xaxis(float *,float *,float *); |
19 |
|
void getvec(void); |
20 |
|
void reseq(void); |
22 |
– |
void check_methane(void); |
21 |
|
void generate_bonds(void); |
22 |
|
void set_atomdata(int, int,int,int,int,int); |
23 |
|
void message_alert(char *, char *); |
114 |
|
{ |
115 |
|
newatom = make_atom(5,0.F,0.F,0.F,"H"); |
116 |
|
set_atomdata(newatom,5,5,5,34,29); |
119 |
– |
atom[newatom].molecule = atom[i].molecule; |
120 |
– |
atom[newatom].residue = atom[i].residue; |
121 |
– |
atom[newatom].biotype = atom[i].biotype; |
117 |
|
if (newatom == -1) |
118 |
|
{ |
119 |
|
message_alert("Error in nhadd newatom = -1","Error"); |
121 |
|
return; |
122 |
|
} |
123 |
|
make_bond(i,newatom,1); |
129 |
– |
for (j=0; j < MAXSS; j++) |
130 |
– |
atom[newatom].substr[j] = atom[i].substr[j]; |
124 |
|
} |
125 |
|
} |
126 |
|
} |
174 |
|
{ |
175 |
|
newatom = make_atom(20, 0.F,0.F,0.F,""); |
176 |
|
set_atomdata(newatom,20,0,0,0,0); |
184 |
– |
atom[newatom].molecule = atom[i].molecule; |
185 |
– |
atom[newatom].residue = atom[i].residue; |
186 |
– |
atom[newatom].biotype = atom[i].biotype; |
177 |
|
make_bond(i,newatom,1); |
188 |
– |
for (j=0; j < MAXSS; j++) |
189 |
– |
atom[newatom].substr[j] = atom[i].substr[j]; |
178 |
|
} |
179 |
|
} |
180 |
|
} |
573 |
|
/* *** reorient the structure in starting orientation and |
574 |
|
* turn off atom markers *** */ |
575 |
|
revec(); |
588 |
– |
check_methane(); |
576 |
|
return; |
577 |
|
} |
578 |
|
// ======================================================== |
745 |
|
L_10: |
746 |
|
continue; |
747 |
|
} |
761 |
– |
if (lptest == 2) // call only from amber |
762 |
– |
{ |
763 |
– |
for (i=1; i <= ntemp; i++) |
764 |
– |
{ |
765 |
– |
if (atom[i].type != 0 && ( atom[i].biotype == GLU || atom[i].biotype == ASP) ) |
766 |
– |
{ |
767 |
– |
if (atom[i].amber_type == 31) |
768 |
– |
{ |
769 |
– |
atom[atom[i].iat[0]].mmx_type = 42; |
770 |
– |
deleteatom(i); |
771 |
– |
} |
772 |
– |
} |
773 |
– |
if (atom[i].type != 0 && atom[i].biotype == LYS) |
774 |
– |
{ |
775 |
– |
if (atom[i].amber_type == 19) |
776 |
– |
atom[i].mmx_type = 41; // make N into n+ |
777 |
– |
} |
778 |
– |
if (atom[i].type != 0 && atom[i].biotype == ARG) |
779 |
– |
{ |
780 |
– |
if (atom[i].mmx_type == 37) |
781 |
– |
atom[i].mmx_type = 41; // make N into n+ |
782 |
– |
} |
783 |
– |
if (atom[i].amber_type == 31) // H-O |
784 |
– |
{ |
785 |
– |
jatom = atom[i].iat[0]; // jatom is Oxygen test for bonding to Carbonyl carbon |
786 |
– |
for (j=0; j < MAXIAT; j++) |
787 |
– |
{ |
788 |
– |
if (atom[jatom].iat[j] != 0 && atom[atom[jatom].iat[j]].atomnum == 6) |
789 |
– |
{ |
790 |
– |
if (atom[atom[jatom].iat[j]].amber_type == 2) |
791 |
– |
{ |
792 |
– |
atom[jatom].mmx_type = 42; |
793 |
– |
deleteatom(i); |
794 |
– |
break; |
795 |
– |
} |
796 |
– |
} |
797 |
– |
} |
798 |
– |
} |
799 |
– |
} |
800 |
– |
} |
748 |
|
reseq(); |
749 |
|
generate_bonds(); |
750 |
|
return; |
809 |
|
atom[i].iat[j] = atom[iplus].iat[j]; |
810 |
|
atom[i].bo[j] = atom[iplus].bo[j]; |
811 |
|
} |
865 |
– |
for ( j=0; j < MAXSSCLASS; j++) |
866 |
– |
atom[i].substr[j] = atom[iplus].substr[j]; |
812 |
|
|
813 |
|
atom[i].x = atom[iplus].x; |
814 |
|
atom[i].y = atom[iplus].y; |
821 |
|
atom[i].amber_type = atom[iplus].amber_type; |
822 |
|
atom[i].mmff_type = atom[iplus].mmff_type; |
823 |
|
atom[i].atomnum = atom[iplus].atomnum; |
879 |
– |
atom[i].serno = atom[iplus].serno; |
880 |
– |
atom[i].molecule = atom[iplus].molecule; |
881 |
– |
atom[i].residue = atom[iplus].residue; |
882 |
– |
atom[i].biotype = atom[iplus].biotype; |
824 |
|
atom[i].formal_charge = atom[iplus].formal_charge; |
825 |
|
atom[i].atomwt = atom[iplus].atomwt; |
826 |
|
atom[i].use = atom[iplus].use; |
886 |
– |
atom[i].color = atom[iplus].color; |
887 |
– |
atom[i].chrg_color = atom[iplus].chrg_color; |
827 |
|
strcpy(atom[i].name,atom[iplus].name); |
828 |
|
atom[i].charge = atom[iplus].charge; |
829 |
|
atom[i].flags = atom[iplus].flags; |
830 |
|
atom[i].radius = atom[iplus].radius; |
892 |
– |
atom[i].vdw_radius = atom[iplus].vdw_radius; |
831 |
|
atom[i].energy = atom[iplus].energy; |
832 |
|
/* *** delete the atom whose statistics were just |
833 |
|
* stored in the i-th atom's connection table *** */ |
846 |
|
atom[iplus].amber_type = 0; |
847 |
|
atom[iplus].mmff_type = 0; |
848 |
|
atom[iplus].atomnum = 0; |
911 |
– |
atom[iplus].serno = 0; |
912 |
– |
atom[iplus].molecule = 0; |
913 |
– |
atom[iplus].residue = 0; |
914 |
– |
atom[iplus].biotype = 0; |
849 |
|
atom[iplus].formal_charge = 0; |
850 |
|
atom[iplus].atomwt = 0.0F; |
851 |
|
atom[iplus].use = 0; |
918 |
– |
atom[iplus].color = 0; |
919 |
– |
atom[iplus].chrg_color = 7; |
852 |
|
atom[iplus].charge = 0.0F; |
853 |
|
atom[iplus].flags = 0; |
854 |
|
atom[iplus].radius = 0.0F; |
855 |
|
atom[iplus].energy = 0.0F; |
856 |
|
strcpy(atom[iplus].name,""); |
857 |
< |
for ( j=0; j < MAXSSCLASS; j++) |
926 |
< |
atom[iplus].substr[j] = 0; |
927 |
< |
|
857 |
> |
|
858 |
|
for( j = 0; j < MAXIAT; j++ ) |
859 |
|
{ |
860 |
|
if( atom[i].iat[j] != 0 ) |
879 |
|
} |
880 |
|
return; |
881 |
|
} |
952 |
– |
// =================================================== |
953 |
– |
void check_methane() |
954 |
– |
{ |
955 |
– |
int i, j, it, nhadds, i5, ianum, jji; |
956 |
– |
float xpnt, ypnt, zpnt; |
957 |
– |
|
958 |
– |
for( i = 1; i <= natom; i++ ) |
959 |
– |
{ |
960 |
– |
it = atom[i].type; |
961 |
– |
ianum = atom[i].atomnum; |
962 |
– |
if( it < 300) |
963 |
– |
{ |
964 |
– |
nhadds = 0; |
965 |
– |
jji = 0; |
966 |
– |
for( j = 0; j < MAXIAT; j++ ) |
967 |
– |
{ |
968 |
– |
if( atom[i].iat[j] != 0 && atom[i].bo[j] != 9 ) |
969 |
– |
{ |
970 |
– |
jji++; |
971 |
– |
if( atom[atom[i].iat[j]].mmx_type == 5 || atom[atom[i].iat[j]].mmx_type == 20 ) |
972 |
– |
nhadds++ ; |
973 |
– |
} |
974 |
– |
} |
975 |
– |
if (nhadds == 4) |
976 |
– |
{ |
977 |
– |
// move i to origin |
978 |
– |
xpnt = atom[i].x; |
979 |
– |
ypnt = atom[i].y; |
980 |
– |
zpnt = atom[i].z; |
981 |
– |
for (j=1; j <= natom; j++) |
982 |
– |
{ |
983 |
– |
atom[j].x -= xpnt; |
984 |
– |
atom[j].y -= ypnt; |
985 |
– |
atom[j].z -= zpnt; |
986 |
– |
} |
987 |
– |
// add hydrogens |
988 |
– |
i5 = atom[i].iat[0]; |
989 |
– |
atom[i5].x = 1.113F; |
990 |
– |
atom[i5].y = 0.0F; |
991 |
– |
atom[i5].z = 0.0F; |
992 |
– |
|
993 |
– |
i5 = atom[i].iat[1]; |
994 |
– |
atom[i5].x = -0.372F; |
995 |
– |
atom[i5].y = -0.524F; |
996 |
– |
atom[i5].z = 0.909F; |
997 |
– |
|
998 |
– |
i5 = atom[i].iat[2]; |
999 |
– |
atom[i5].x = -0.372F; |
1000 |
– |
atom[i5].y = -0.524F; |
1001 |
– |
atom[i5].z = -0.909F; |
1002 |
– |
|
1003 |
– |
i5 = atom[i].iat[3]; |
1004 |
– |
atom[i5].x = -0.373F; |
1005 |
– |
atom[i5].y = 1.049F; |
1006 |
– |
atom[i5].z = 0.0F; |
1007 |
– |
// move back |
1008 |
– |
for (j=1; j <= natom; j++) |
1009 |
– |
{ |
1010 |
– |
atom[j].x += xpnt; |
1011 |
– |
atom[j].y += ypnt; |
1012 |
– |
atom[j].z += zpnt; |
1013 |
– |
} |
1014 |
– |
} |
1015 |
– |
if (nhadds == 3 && jji == 3 && (ianum == 5 || ianum == 7 || ianum == 8 ||ianum == 15 || ianum == 16 || ianum == 6)) // bh3, sh3, ph3, ch3+, ch3- |
1016 |
– |
{ |
1017 |
– |
// move i to origin |
1018 |
– |
xpnt = atom[i].x; |
1019 |
– |
ypnt = atom[i].y; |
1020 |
– |
zpnt = atom[i].z; |
1021 |
– |
for (j=1; j <= natom; j++) |
1022 |
– |
{ |
1023 |
– |
atom[j].x -= xpnt; |
1024 |
– |
atom[j].y -= ypnt; |
1025 |
– |
atom[j].z -= zpnt; |
1026 |
– |
} |
1027 |
– |
// add hydrogens |
1028 |
– |
i5 = atom[i].iat[0]; |
1029 |
– |
atom[i5].x = 1.113F; |
1030 |
– |
atom[i5].y = 0.0F; |
1031 |
– |
atom[i5].z = 0.0F; |
1032 |
– |
|
1033 |
– |
i5 = atom[i].iat[1]; |
1034 |
– |
atom[i5].x = -0.5582F; |
1035 |
– |
atom[i5].y = 0.9478F; |
1036 |
– |
atom[i5].z = 0.0F; |
1037 |
– |
|
1038 |
– |
i5 = atom[i].iat[2]; |
1039 |
– |
atom[i5].x = -0.5582F; |
1040 |
– |
atom[i5].y = -0.9478F; |
1041 |
– |
atom[i5].z = 0.0F; |
1042 |
– |
|
1043 |
– |
// move back |
1044 |
– |
for (j=1; j <= natom; j++) |
1045 |
– |
{ |
1046 |
– |
atom[j].x += xpnt; |
1047 |
– |
atom[j].y += ypnt; |
1048 |
– |
atom[j].z += zpnt; |
1049 |
– |
} |
1050 |
– |
} |
1051 |
– |
if (nhadds == 2 && ianum == 8) |
1052 |
– |
{ |
1053 |
– |
// move i to origin |
1054 |
– |
xpnt = atom[i].x; |
1055 |
– |
ypnt = atom[i].y; |
1056 |
– |
zpnt = atom[i].z; |
1057 |
– |
for (j=1; j <= natom; j++) |
1058 |
– |
{ |
1059 |
– |
atom[j].x -= xpnt; |
1060 |
– |
atom[j].y -= ypnt; |
1061 |
– |
atom[j].z -= zpnt; |
1062 |
– |
} |
1063 |
– |
// add hydrogens |
1064 |
– |
i5 = atom[i].iat[0]; |
1065 |
– |
atom[i5].x = 1.113F; |
1066 |
– |
atom[i5].y = 0.0F; |
1067 |
– |
atom[i5].z = 0.0F; |
1068 |
– |
|
1069 |
– |
i5 = atom[i].iat[1]; |
1070 |
– |
atom[i5].x = -0.5582F; |
1071 |
– |
atom[i5].y = 0.9478F; |
1072 |
– |
atom[i5].z = 0.0F; |
1073 |
– |
// move back |
1074 |
– |
for (j=1; j <= natom; j++) |
1075 |
– |
{ |
1076 |
– |
atom[j].x += xpnt; |
1077 |
– |
atom[j].y += ypnt; |
1078 |
– |
atom[j].z += zpnt; |
1079 |
– |
} |
1080 |
– |
} |
1081 |
– |
} |
1082 |
– |
} |
1083 |
– |
} |