Exemplo n.º 1
0
 def run_FoldX_AnalyseComplex_And_Agadir(self):
     GUM.wait_for_grid_engine_job_to_complete(self.solubis_job_prefix,
                                              'all Solubis jobs to finish')
     self.all_mutants_in_Solubis_path = sorted(glob.glob('./*'))
     foldx_instance = FoldX()
     for mutant_in_Solubis_path in self.all_mutants_in_Solubis_path:
         if os.path.isdir(mutant_in_Solubis_path):
             mutant_folder_name = mutant_in_Solubis_path.split('/')[-1]
             os.chdir(mutant_folder_name)
             self._make_backup_of_runscript()
             foldx_instance.prepare_for_FoldX_AnalyseComplex(
                 self.RepairPDB_pdb_name)
             print os.getcwd()
             # Note: _1_0 is random choice, other two are same.
             # cwd is Results/pdbname/Runs/Solubis/mutant_name
             relative_path_of_pdb_to_read = './'
             relative_path_for_new_fasta_folder_to_write = './'
             pdb_name_chain_fasta_dict = GUM.extract_pdb_name_fasta_and_chains_from_pdb(
                 self.RepairPDB_pdb_name + '_1_0.pdb',
                 relative_path_of_pdb_to_read)
             GUM.write_fasta_to_folder(
                 pdb_name_chain_fasta_dict,
                 relative_path_for_new_fasta_folder_to_write)
             grid_engine_job_name = self.analyze_complex_job_prefix + mutant_folder_name
             agadir_results_path = os.getcwd()
             python_script_with_path = self.results_pdb_path + '/../../SourceFiles/Scripts/run_agadir.py ' + \
                                       agadir_results_path
             self._run_runscript_on_grid_engine(grid_engine_job_name,
                                                python_script_with_path)
             os.chdir('./..')  # is this Runs/Solubis folder ?
             cwd = os.getcwd()  # for debugging
         else:
             print mutant_in_Solubis_path
Exemplo n.º 2
0
 def run_yasara_agadir_repair(self):
     if not os.path.exists('Results'):
         os.makedirs('Results')
     for pdb in self.pdb_list:
         pdb_name = pdb.split('.')[0]
         self._build_results_directory_tree_for_each(pdb)
         # current directory Results/pdb
         # self._run_yasara_to_organise_pdb(pdb, pdb_name)
         self._copy_pdb_foldx_agadir_files_to_new_subdirectories(pdb)
         relative_path_of_pdb_to_read = './PDBs/'
         relative_path_for_new_fasta_folder_to_write = './'
         pdb_name_chain_fasta_dict = GUM.extract_pdb_name_fasta_and_chains_from_pdb(
             pdb, relative_path_of_pdb_to_read)
         GUM.write_fasta_to_folder(
             pdb_name_chain_fasta_dict,
             relative_path_for_new_fasta_folder_to_write)
         agadir_results_path = self.start_path + '/Results/' + pdb_name
         agadir_instance = Agadir(agadir_results_path)
         agadir_instance.run_agadir_with_fasta_files('./')
         self._run_repair_on_grid_engine(pdb_name)
     message_to_print = 'PDBs to be repaired'
     GUM.wait_for_grid_engine_job_to_complete(self.repair_job_prefix,
                                              message_to_print)