docs: def do_dock6_flexible(self, ligand_path, force_rerun=False):
          """Dock a ligand to the protein.
  
          Args:
              ligand_path (str): Path to ligand (mol2 format) to dock to protein
              force_rerun (bool): If method should be rerun even if output file exists
  
          """
          log.debug('{}: running DOCK6...'.format(self.id))
  
          ligand_name = os.path.basename(ligand_path).split('.')[0]
          in_name = op.join(self.dock_dir, "{}_{}_flexdock.in".format(self.id, ligand_name))
          out_name = op.join(self.dock_dir, "{}_{}_flexdock.out".format(self.id, ligand_name))
  
          conformers_out = op.join(self.dock_dir, '{}_{}_flexdock_conformers.mol2'.format(self.id, ligand_name))
          scored_out = op.join(self.dock_dir, '{}_{}_flexdock_scored.mol2'.format(self.id, ligand_name))
          ranked_out = op.join(self.dock_dir, '{}_{}_flexdock_ranked.mol2'.format(self.id, ligand_name))
  
          if ssbio.utils.force_rerun(flag=force_rerun, outfile=ranked_out):
              with open(in_name, "w") as f:
                  dock_text = """ligand_atom_file                                             {}
  limit_max_ligands                                            no
  skip_molecule                                                no
  read_mol_solvation                                           no
  calculate_rmsd                                               no
  use_database_filter                                          no
  orient_ligand                                                yes
  automated_matching                                           yes
  receptor_site_file                                           {}
  max_orientations                                             500
  critical_points                                              no
  chemical_matching                                            no
  use_ligand_spheres                                           no
  use_internal_energy                                          yes
  internal_energy_rep_exp                                      12
  flexible_ligand                                              yes
  user_specified_anchor                                        no
  limit_max_anchors                                            no
  min_anchor_size                                              5
  pruning_use_clustering                                       yes
  pruning_max_orients                                          100
  pruning_clustering_cutoff                                    100
  pruning_conformer_score_cutoff                               100
  use_clash_overlap                                            no
  write_growth_tree                                            no
  bump_filter                                                  yes
  bump_grid_prefix                                             {}
  score_molecules                                              yes
  contact_score_primary                                        no
  contact_score_secondary                                      no
  grid_score_primary                                           yes
  grid_score_secondary                                         no
  grid_score_rep_rad_scale                                     1
  grid_score_vdw_scale                                         1
  grid_score_es_scale                                          1
  grid_score_grid_prefix                                       {}
  multigrid_score_secondary                                    no
  dock3.5_score_secondary                                      no
  continuous_score_secondary                                   no
  descriptor_score_secondary                                   no
  gbsa_zou_score_secondary                                     no
  gbsa_hawkins_score_secondary                                 no
  SASA_descriptor_score_secondary                              no
  amber_score_secondary                                        no
  minimize_ligand                                              yes
  minimize_anchor                                              yes
  minimize_flexible_growth                                     yes
  use_advanced_simplex_parameters                              no
  simplex_max_cycles                                           1
  simplex_score_converge                                       0.1
  simplex_cycle_converge                                       1.0
  simplex_trans_step                                           1.0
  simplex_rot_step                                             0.1
  simplex_tors_step                                            10.0
  simplex_anchor_max_iterations                                500
  simplex_grow_max_iterations                                  500
  simplex_grow_tors_premin_iterations                          0
  simplex_random_seed                                          0
  simplex_restraint_min                                        yes
  simplex_coefficient_restraint                                10.0
  atom_model                                                   all
  vdw_defn_file                                                {}
  flex_defn_file                                               {}
  flex_drive_file                                              {}
  ligand_outfile_prefix                                        {}_{}_flexdock
  write_orientations                                           no
  num_scored_conformers                                        20
  write_conformations                                          yes
  cluster_conformations                                        yes
  rank_ligands                                                 yes
          """.format(ligand_path, op.basename(self.sphsel_path), op.splitext(op.basename(self.grid_path))[0],
                     op.splitext(op.basename(self.grid_path))[0], self.amb_file, self.flex1_file, self.flex2_file,
                     self.id, ligand_name)
  
                  f.write(dock_text)
  
              os.chdir(self.dock_dir)
              cmd = "dock6 -i {} -o {} -v".format(in_name, out_name)
              os.system(cmd)
  
          if ssbio.utils.is_non_zero_file(ranked_out):
              self.dock_flexible_outfile = out_name
              self.dock_flexible_conformers_result = conformers_out
              self.dock_flexible_scored_result = scored_out
              log.debug('{}: successful docking!'.format(self.dock_flexible_outfile))
          else:
              log.error('{}+{}: empty DOCK6 ranked file, execution error (or ligand failed to dock)'.format(self.id,
                                                                                                            op.basename(ligand_path)))