GLYLIB  0.3.0b
ATYPE_init.c
Go to the documentation of this file.
00001 /* ATYPE_init.c -- begun 20071015 by BLFoley
00002  * This function initializes an atom type list with several
00003  * commonly-used atom types */
00004 #include <mylib.h>
00005 #include <molecules.h>
00006 #include <PDB.h>
00007 //#include "../inc/mylib.h" 
00008 //#include "../inc/molecules.h" 
00009 //#define NUMAT 15 // change this if you add more types
00010 //atype *ATYPE_init();
00011 /* For convenience:
00012         typedef struct {
00013                 int n; // atomic number
00014                 char N[21]; // element name
00015                 char NT[21]; // name for element type
00016                 double m; // mass of element type
00017                 char desc[301]; // brief free-form description field
00018                 int nb; // number of typical bonds for this atom type
00019                 double *bo; // typical bond orders (nb of these)
00020         } atype; // atom types, with other info
00021 */
00022 atype *ATYPE_init(){
00023 atype *A;
00024 
00025 NUMAT=15;
00026 
00027 A=(atype*)calloc(NUMAT,sizeof(atype));
00028 
00029 A[0].n=6;
00030 strcpy(A[0].N,"CG");
00031 strcpy(A[0].NT,"C");
00032 A[0].m=12.011;
00033 strcpy(A[0].desc,"sp3");
00034 A[0].nb=4;
00035 //
00036 A[1].n=6;
00037 strcpy(A[1].N,"CY");
00038 strcpy(A[1].NT,"C");
00039 A[1].m=12.011;
00040 strcpy(A[1].desc,"sp3");
00041 A[1].nb=4;
00042 //
00043 A[2].n=1;
00044 strcpy(A[2].N,"H");
00045 strcpy(A[2].NT,"H");
00046 A[2].m=1.00794;
00047 strcpy(A[2].desc,"sp3");
00048 A[2].nb=1;
00049 //
00050 A[3].n=1;
00051 strcpy(A[3].N,"H1");
00052 strcpy(A[3].NT,"H");
00053 A[3].m=1.00794;
00054 strcpy(A[3].desc,"sp3");
00055 A[3].nb=1;
00056 //
00057 A[4].n=1;
00058 strcpy(A[4].N,"H2");
00059 strcpy(A[4].NT,"H");
00060 A[4].m=1.00794;
00061 strcpy(A[4].desc,"sp3");
00062 A[4].nb=1;
00063 //
00064 A[5].n=1;
00065 strcpy(A[5].N,"HC");
00066 strcpy(A[5].NT,"H");
00067 A[5].m=1.00794;
00068 strcpy(A[5].desc,"sp3");
00069 A[5].nb=1;
00070 //
00071 A[6].n=1;
00072 strcpy(A[6].N,"HO");
00073 strcpy(A[6].NT,"H");
00074 A[6].m=1.00794;
00075 strcpy(A[6].desc,"sp3");
00076 A[6].nb=1;
00077 //
00078 A[7].n=1;
00079 strcpy(A[7].N,"HW");
00080 strcpy(A[7].NT,"H");
00081 A[7].m=1.00794;
00082 strcpy(A[7].desc,"sp3");
00083 A[7].nb=1;
00084 //
00085 A[8].n=7;
00086 strcpy(A[8].N,"N"); 
00087 strcpy(A[8].NT,"N");
00088 A[8].m=14.01;
00089 strcpy(A[8].desc,"sp2");
00090 A[8].nb=3;
00091 //
00092 A[9].n=8;
00093 strcpy(A[9].N,"OH");
00094 strcpy(A[9].NT,"O");
00095 A[9].m=15.994;
00096 strcpy(A[9].desc,"sp3");
00097 A[9].nb=2;
00098 //
00099 A[10].n=8;
00100 strcpy(A[10].N,"OS");
00101 strcpy(A[10].NT,"O");
00102 A[10].m=15.994;
00103 strcpy(A[10].desc,"sp3");
00104 A[10].nb=2;
00105 //
00106 A[11].n=8;
00107 strcpy(A[11].N,"O"); 
00108 strcpy(A[11].NT,"O");
00109 A[11].m=15.994;
00110 strcpy(A[11].desc,"sp2");
00111 A[11].nb=1;
00112 //
00113 A[12].n=8;
00114 strcpy(A[12].N,"O2");
00115 strcpy(A[12].NT,"O");
00116 A[12].m=15.994;
00117 strcpy(A[12].desc,"sp2");
00118 A[12].nb=1;
00119 //
00120 A[13].n=8;
00121 strcpy(A[13].N,"OW");
00122 strcpy(A[13].NT,"O");
00123 A[13].m=15.994;
00124 strcpy(A[13].desc,"sp3");
00125 A[13].nb=2;
00126 //
00127 A[14].n=11;
00128 strcpy(A[14].N,"IP");
00129 strcpy(A[14].NT,"Na+");
00130 A[14].m=15.994;
00131 strcpy(A[14].desc,"sp3");
00132 A[14].nb=0;
00133 
00134 //theoretically, something like this should work...
00135 //A[]={
00136 //{6,"C",  "C", 12.011, "sp2", 3, {1,1,2}},
00137 //{6,"CG", "C", 12.011, "sp3", 4, {1,1,1,1}},
00138 //{6,"CY", "C", 12.011, "sp3", 4}
00139 //{1,"H",  "H", 1.00794, "sp3", 1}
00140 //{1,"H1", "H", 1.00794, "sp3", 1}
00141 //{1,"H2", "H", 1.00794, "sp3", 1}
00142 //{1,"HC", "H", 1.00794, "sp3", 1}
00143 //{1,"HO", "H", 1.00794, "sp3", 1}
00144 //{1,"HW", "H", 1.00794, "sp3", 1}
00145 //{7,"N",  "N", 14.01,  "sp2", 3}
00146 //{8,"OH", "O", 15.994, "sp3", 2}
00147 //{8,"OS", "O", 15.994, "sp3", 2}
00148 //{8,"O",  "O", 15.994, "sp2", 1}
00149 //{8,"O2", "O", 15.994, "sp2", 1}
00150 //{8,"OW", "O", 15.994, "sp3", 2}
00151 //{11,"IP", "Na+", 15.994, "sp3", 0}
00152 //};
00153 
00154 return A;
00155 }
 All Classes Files Functions Variables Typedefs Defines