GLYLIB  0.3.0b
get_type.c
Go to the documentation of this file.
00001 /**************************  get_type() *******************************/
00002 /* get_type(mca) finds the entry type for that line based on the first word */
00003 /* Author: Lachele Foley*/
00004 #include <load_pdb.h>
00005 //#include "../inc/load_pdb.h"
00006 linetype get_type(char* gca){ 
00007 int gta=0;
00008 char gt_other[20];
00009 linetype gtlt;
00010 if(DEBUG>=1){printf("gca is >>>%s<<<\n", gca);}
00011 gtlt.a=-1;
00012 gtlt.b=-1;
00013 
00014 /* CLASS 0 */
00015 if(strcmp(gca,"CRYST1")==0){
00016         gtlt.a=0;
00017         gtlt.b=0;
00018         }  /* CRYST1 */
00019 if(strcmp(gca,"END   ")==0){
00020         gtlt.a=0;
00021         gtlt.b=1;
00022         }  /* END */
00023 if(strcmp(gca,"HEADER")==0){
00024         gtlt.a=0;
00025         gtlt.b=2;
00026         }  /* HEADER */
00027 if(strcmp(gca,"MASTER")==0){
00028         gtlt.a=0;
00029         gtlt.b=3;
00030         }  /* MASTER */
00031 /* In case ORIGXn and SCALEn are taken literally: */
00032 if(strcmp(gca,"ORIGXn")==0){
00033         gtlt.a=0;
00034         gtlt.b=4;
00035         }  /* ORIGXn */
00036 if(strcmp(gca,"SCALEn")==0){
00037         gtlt.a=0;
00038         gtlt.b=5;
00039         }  /* SCALEn */
00040 /* In case ORIGXn and SCALEn are given n=variable: */
00041 for(gta=0;gta<5;gta++){
00042         gt_other[gta]=gca[gta];
00043         }
00044 gt_other[5]='\0';
00045 if(strcmp(gt_other,"ORIGX")==0){
00046         gtlt.a=0;
00047         gtlt.b=4;
00048         }  /* ORIGXn */ 
00049 if(strcmp(gt_other,"SCALE")==0){
00050         gtlt.a=0;
00051         gtlt.b=5;
00052         }  /* ORIGXn */ 
00053 
00054 /* CLASS 1 */
00055 if(strcmp(gca,"AUTHOR")==0){
00056         gtlt.a=1;
00057         gtlt.b=0;
00058         }  /* AUTHOR */
00059 if(strcmp(gca,"CAVEAT")==0){
00060         gtlt.a=1;
00061         gtlt.b=1;
00062         }  /* CAVEAT */
00063 if(strcmp(gca,"COMPND")==0){
00064         gtlt.a=1;
00065         gtlt.b=2;
00066         }  /* COMPND */
00067 if(strcmp(gca,"EXPDTA")==0){
00068         gtlt.a=1;
00069         gtlt.b=3;
00070         }  /* EXPDTA */
00071 if(strcmp(gca,"KEYWDS")==0){
00072         gtlt.a=1;
00073         gtlt.b=4;
00074         }  /* KEYWDS */
00075 if(strcmp(gca,"OBSLTE")==0){
00076         gtlt.a=1;
00077         gtlt.b=5;
00078         }  /* OBSLTE */
00079 if(strcmp(gca,"SOURCE")==0){
00080         gtlt.a=1;
00081         gtlt.b=6;
00082         }  /* SOURCE */
00083 if(strcmp(gca,"SPRSDE")==0){
00084         gtlt.a=1;
00085         gtlt.b=7;
00086         }  /* SPRSDE */
00087 if(strcmp(gca,"TITLE ")==0){
00088         gtlt.a=1;
00089         gtlt.b=8;
00090         }  /* TITLE */
00091 
00092 /* CLASS 2 */
00093 if(strcmp(gca,"ANISOU")==0){
00094         gtlt.a=2;
00095         gtlt.b=0;
00096         }  /* ANISOU */
00097 if(strcmp(gca,"ATOM  ")==0){
00098         gtlt.a=2;
00099         gtlt.b=1;
00100         }  /* ATOM */
00101 if(strcmp(gca,"CISPEP")==0){
00102         gtlt.a=2;
00103         gtlt.b=2;
00104         }  /* CISPEP */
00105 if(strcmp(gca,"CONECT")==0){
00106         gtlt.a=2;
00107         gtlt.b=3;
00108         }  /* CONECT */
00109 if(strcmp(gca,"DBREF ")==0){
00110         gtlt.a=2;
00111         gtlt.b=4;
00112         }  /* DBREF */
00113 if(strcmp(gca,"HELIX ")==0){
00114         gtlt.a=2;
00115         gtlt.b=5;
00116         }  /* HELIX */
00117 if(strcmp(gca,"HET   ")==0){
00118         gtlt.a=2;
00119         gtlt.b=6;
00120         }  /* HET */
00121 if(strcmp(gca,"HETSYN")==0){
00122         gtlt.a=2;
00123         gtlt.b=7;
00124         }  /* HETSYN */
00125 if(strcmp(gca,"HYDBND")==0){
00126         gtlt.a=2;
00127         gtlt.b=8;
00128         }  /* HYDBND */
00129 if(strcmp(gca,"LINK  ")==0){
00130         gtlt.a=2;
00131         gtlt.b=9;
00132         }  /* LINK */
00133 if(strcmp(gca,"MODRES")==0){
00134         gtlt.a=2;
00135         gtlt.b=10;
00136         }  /* MODRES */
00137 if(strncmp(gca,"MTRIXn",5)==0){
00138         gtlt.a=2;
00139         gtlt.b=11;
00140         }  /* MTRIXn */
00141 if(strcmp(gca,"REVDAT")==0){
00142         gtlt.a=2;
00143         gtlt.b=12;
00144         }  /* REVDAT */
00145 if(strcmp(gca,"SEQADV")==0){
00146         gtlt.a=2;
00147         gtlt.b=13;
00148         }  /* SEQADV */
00149 if(strcmp(gca,"SEQRES")==0){
00150         gtlt.a=2;
00151         gtlt.b=14;
00152         }  /* SEQRES */
00153 if(strcmp(gca,"SHEET ")==0){
00154         gtlt.a=2;
00155         gtlt.b=15;
00156         }  /* SHEET */
00157 if(strcmp(gca,"SIGATM")==0){
00158         gtlt.a=2;
00159         gtlt.b=16;
00160         }  /* SIGATM */
00161 if(strcmp(gca,"SIGUIJ")==0){
00162         gtlt.a=2;
00163         gtlt.b=17;
00164         }  /* SIGUIJ */
00165 if(strcmp(gca,"SITE  ")==0){
00166         gtlt.a=2;
00167         gtlt.b=18;
00168         }  /* SITE */
00169 if(strcmp(gca,"SLTBRG")==0){
00170         gtlt.a=2;
00171         gtlt.b=19;
00172         }  /* SLTBRG */
00173 if(strcmp(gca,"SSBOND")==0){
00174         gtlt.a=2;
00175         gtlt.b=20;
00176         }  /* SSBOND */
00177 if(strcmp(gca,"TURN  ")==0){
00178         gtlt.a=2;
00179         gtlt.b=21;
00180         }  /* TURN */
00181 if(strcmp(gca,"TVECT ")==0){
00182         gtlt.a=2;
00183         gtlt.b=22;
00184         }  /* TVECT */
00185 
00186 /* CLASS 3 */
00187 if(strcmp(gca,"FORMUL")==0){
00188         gtlt.a=3;
00189         gtlt.b=0;
00190         }  /* FORMUL */
00191 if(strcmp(gca,"HETATM")==0){
00192         gtlt.a=3;
00193         gtlt.b=1;
00194         }  /* HETATM */
00195 if(strcmp(gca,"HETNAM")==0){
00196         gtlt.a=3;
00197         gtlt.b=2;
00198         }  /* HETNAM */
00199 
00200 /* CLASS 4 */
00201 if(strcmp(gca,"ENDMDL")==0){
00202         gtlt.a=4;
00203         gtlt.b=0;
00204         }  /* ENDMDL */
00205 if(strcmp(gca,"MODEL ")==0){
00206         gtlt.a=4;
00207         gtlt.b=1;
00208         }  /* MODEL */
00209 if(strcmp(gca,"TER   ")==0){
00210         gtlt.a=4;
00211         gtlt.b=2;
00212         }  /* TER */
00213 
00214 /* CLASS 5 */
00215 if(strcmp(gca,"JRNL  ")==0){
00216         gtlt.a=5;
00217         gtlt.b=0;
00218         }  /* JRNL */
00219 if(strcmp(gca,"REMARK")==0){
00220         gtlt.a=5;
00221         gtlt.b=1;
00222         }  /* REMARK */ 
00223 if(gtlt.a<0){
00224 printf("String type of %s found in file.  This type not supported.\n",gca);
00225 printf("    [feel free to write it in!]\n");
00226 printf("Deleting entry from output file.\n"); 
00227 gtlt.a=-1;
00228 gtlt.b=-1;
00229 }
00230 return gtlt;
00231 } 
00232 
 All Classes Files Functions Variables Typedefs Defines