def showbox(self, force_rerun=False):
        """Create the dummy PDB box around the selected spheres.

        Args:
            force_rerun (bool): If method should be rerun even if output file exists

        """
        log.debug('{}: running box maker...'.format(self.id))

        if not self.sphsel_path:
            return ValueError('Please run sphere_selector_using_residues')

        boxfile = op.join(self.dock_dir, "{}_box.pdb".format(self.id))
        boxscript = op.join(self.dock_dir, "{}_box.in".format(self.id))

        if ssbio.utils.force_rerun(flag=force_rerun, outfile=boxfile):
            with open(boxscript, "w") as f:
                f.write("Y\n")
                f.write("0\n")
                f.write("{}\n".format(op.basename(self.sphsel_path)))
                f.write("1\n")
                f.write("{}".format(op.basename(boxfile)))

            cmd = "showbox < {}".format(boxscript)
            os.chdir(self.dock_dir)
            os.system(cmd)

        if ssbio.utils.is_non_zero_file(boxfile):
            self.box_path = boxfile
            log.debug('{}: successful box creation'.format(self.box_path))
        else:
            log.critical('{}: showbox failed to run on selected spheres file'.format(self.sphsel_path))
def showbox ( self , force_rerun = False ) : log . debug ( '{}: running box maker...' . format ( self . id ) ) if not self . sphsel_path : return ValueError ( 'Please run sphere_selector_using_residues' ) boxfile = op . join ( self . dock_dir , "{}_box.pdb" . format ( self . id ) ) boxscript = op . join ( self . dock_dir , "{}_box.in" . format ( self . id ) ) if ssbio . utils . force_rerun ( flag = force_rerun , outfile = boxfile ) : with open ( boxscript , "w" ) as f : f . write ( "Y\n" ) f . write ( "0\n" ) f . write ( "{}\n" . format ( op . basename ( self . sphsel_path ) ) ) f . write ( "1\n" ) f . write ( "{}" . format ( op . basename ( boxfile ) ) ) cmd = "showbox < {}" . format ( boxscript ) os . chdir ( self . dock_dir ) os . system ( cmd ) if ssbio . utils . is_non_zero_file ( boxfile ) : self . box_path = boxfile log . debug ( '{}: successful box creation' . format ( self . box_path ) ) else : log . critical ( '{}: showbox failed to run on selected spheres file' . format ( self . sphsel_path ) )
Create the dummy PDB box around the selected spheres.

        Args:
            force_rerun (bool): If method should be rerun even if output file exists