Exemple #1
0
int main(int argc, char *argv[])
{  FILE *pdb_fp, *fp;
   PROT prot;
 
   
   db_open();
   if (get_env()) {
      printf("   This program needs run.prm in working directory.\n");
      return USERERR;
   }

   if (argc < 2) {
      printf("surfmcce mcce_pdb_file\n");
      return 0;
   }

   /* load parameters */
   if ((fp=fopen(env.new_tpl, "r"))) {
      fclose(fp);
      load_param(env.new_tpl);
      printf("%s loaded.\n",env.new_tpl);
   }
   if (strlen(env.param)) {
      if (load_all_param(env.param)) {
         printf("   Can't load parameter files in %s\n",env.param);
         return USERERR;
      }
   }
   
   /* load pdb */
   if ((pdb_fp=fopen(argv[1], "r"))) {
      prot = load_pdb(pdb_fp);
      fclose(pdb_fp);
      if (prot.n_res == 0) {
         printf("   Fail to load pdb file: %s\n",STEP2_OUT);
         return USERERR;
      }
   }
   else {
      printf("   Specified PDB file \"%s\" was not found\n",argv[1]);
      return USERERR;
   }
   
   surfw(prot, 1.4);
   print_surfw(prot);
   
   return 0;
}
// takes in assembly, name to call the file, list of residue names and number of residues in the list
void mergeAsmbly(assembly* merged, assembly* A, assembly *B){
//Tells the user what's going on
printf("Entered Merge Assembly function...\n");

char file_name[50];
strcpy(file_name,"temp.pdb");

outputMolPDB_NoRenameResid(&(*A).m[0][0], file_name); //Glycan should be all in one molecule from now on. outputAsmbl now adds TER cards and needs to to work
//outputAsmblPDB(A, file_name); // overwrites temp file and put A in there
appendAsmblPDB(B, file_name); // adds B onto the bottom of A. Written by Oliver so no TER cards need to be added for it to work.
load_pdb(file_name,merged); // loads in this pdb file into one assembly
int ri=0;
for (ri=0;ri<(*merged).m[0][0].nr;ri++){
        if ((*merged).m[0][0].r[ri].na>1){
                set_smallest_rings_from_residue_atom_nodes(&(*merged).m[0][0].r[ri]);
        }
}
return;
}