void setup(void)
{
	test_ag = read_pdb_nopar("1rei_nmin.pdb");
	read_ff_charmm("1rei_nmin.psf", "parm.prm", "pdbamino.rtf", test_ag);
	fixed_init(test_ag);
	fixed_update(test_ag, 0, NULL); // Make nothing fixed
}
Esempio n. 2
0
int main(int argc, char **argv)
{
  FIXED *fixed;
  RECORD *record;

  DBUG_ENTER("main");
  DBUG_PROCESS(argv[0]);
  DBUG_PUSH("d:t");

  if(!(fixed = fixed_init(0)))
  {
    fprintf(stderr, "Couldn't allocate FIXED\n");
    exit(1);
  }

  fixed_options(fixed)->gap = 1;

  fixed_file_def(fixed, usps_state, 36);

  fixed_dump(fixed);

  fixed_open(fixed, argv[1], 'r');
  while(record = fixed_read_next(fixed))
  {
    record_dump(record);
    record_free(record);
  }

  fixed_close(fixed);

  fixed_free(fixed);

  DBUG_RETURN(0);
}
int main(int argc, char* argv[]){

	// Input Files //
	/* Intro Message */
                printf("\n");
                printf("A Program to Repack Protein Side-chains for Protein Docking Refinement Procedures\n");
                printf("Copyright (c) 2014, Structural Bioinformatics Laboratory, Boston University\n");
                printf("Author: Mohammad Moghadasi ([email protected]) \n");	

	if(argc!=10){
		printf("Usage:\n ./main \n   Complex_IN.pdb Complex_IN.psf Complex_IN.mol2 Complex_IN_Ligand.pdb\n   Libmol-param-file charmm-param-file.prm  charmm-rtf-file.rtf rotamer-library-binary-file.txt\n   Complex_OUT.pdb\n \n");
		exit(EXIT_FAILURE);
	}

        char* ifile           = argv[1];       //pdb file of both receptor and ligand
        char* psffile         = argv[2];         //charmm type psf file
        char* mol2file        = argv[3];         //mol2 file
        char* pdbfilelig      = argv[4];         //pdb file of ligand
        char* atom_prm_file   = argv[5];         //libmol parameter file
              prmfile         = argv[6];         //charmm type parameter file
              rtffile         = argv[7];         //charmm type connectivity file
        char* rotamer_library_file  = argv[8]; //rotamer raw library file
        char* ofile           = argv[9];         //output file
	
	// Filling the atom_group struct //

	struct prm *atomprm    = read_prm(atom_prm_file,_MOL_VERSION_);
	struct atomgrp* ag     = read_file_atomgrp(ifile, atomprm, -1);
	read_ff_charmm(psffile, prmfile, rtffile, ag);

	if(!read_hybridization_states_from_mol2(mol2file,ag)){
	    exit (EXIT_FAILURE);             
	}                 
        fix_acceptor_bases(ag,atomprm);

        struct List lig_list;
	read_fix(pdbfilelig,&lig_list.n,&lig_list.K);

	fixed_init(ag);
        fixed_update_unfreeze_all(ag);
        zero_grads(ag);
        fill_ingrp(ag);

	struct agsetup* ags;
        ags     = malloc(sizeof(struct agsetup));
        init_nblst(ag,ags);
        update_nblst(ag,ags);

	// Mark interface residues //
	
        int num_of_res_interface;
        int res_list_interface[ag->nres];
        mark_interface_residues(ag,ags,lig_list, lig_rec_dist ,&num_of_res_interface,res_list_interface);

	// Initialize side chain rotamer library  //
	
	//nrotCoef = 3;
	nrotCoef = 1;
	MAX_ROT = 245;
	MAX_RES = ag->nres;//needed for full_pack
        cutoff = 3;

	// Reslist // 

	struct ifres_list* reslist;
	ifres_list_malloc( &reslist );
	reslist->num_of_ifres = num_of_res_interface;
	for(int r = 0; r < reslist->num_of_ifres ; r++)
		reslist->ifres_num[r] = res_list_interface[r];

	// Library //

	char *rotamer_lib;
	load_file_to_memory(rotamer_library_file, &rotamer_lib);
	struct rot_info *rotinf;
	init_rotinf(ag, num_of_res_interface, res_list_interface, rotamer_lib, &rotinf);

	struct ifres_list* reslist_minor;
	ifres_list_malloc( &reslist_minor ) ;

	// MAIN FUNCITION // 
	//
	clock_t start, finish;
	start = clock();

	full_pack(ag,lig_list,rotinf,num_of_res_interface, reslist_minor);

	finish = clock();
	if(0) printf("Processing Time = %f\n",((double)(finish-start)/CLOCKS_PER_SEC));

	// Writing the atom_group into a PDB //

	write_pdb_traj_nopar(ag,ifile,ofile);
	
	// Free memory //
        Free_ifres_list( &reslist_minor );	
	free(rotamer_lib);

	return 0;
}