Пример #1
0
    def surfdist(self):
        if not self.vol_file:
            self.select_first_message(".vol file")
            return
        self.get_options()
        self.options['reportmode']='both'

        if self.vol_dataset:
            self.options['dataset'] = self.vol_dataset
            text,html = Voronoia.process_command('surfdist',self.vol_dataset,self.vol_dataset,self.options)
        else:
            text,html = Voronoia.process_command('surfdist',self.vol_file,self.out_path,self.options)
        self.text_dialog('Surface distance','Surface distance values for data from %s'%(self.vol_file),text,html)
Пример #2
0
    def write_avgpd(self):
        if not self.vol_file:
            self.select_first_message(".vol file")
            return
        self.get_options()
        self.options['reportmode']='both'

        if self.vol_dataset:
            self.options['dataset'] = self.vol_dataset
            text,html = Voronoia.process_command('average',self.vol_dataset,self.vol_dataset,self.options)
        else:
            text,html = Voronoia.process_command('average',self.vol_file,self.out_path,self.options)
        self.text_dialog('Average packing','Average packing values for data from %s'%(self.vol_file),text,html)
Пример #3
0
    def packing_report(self):
        if not self.vol_file:
            self.select_first_message(".vol file")
            return
        self.get_options()
        self.options['reportmode']='both'

        if self.vol_dataset:
            self.options['dataset'] = self.vol_dataset
            text,html = Voronoia.process_command('report',self.vol_dataset,self.vol_dataset,self.options)
        else:
            text,html = Voronoia.process_command('report',self.vol_file,self.out_path,self.options)
        self.text_dialog('Packing report','Packing report for %s'%(self.vol_file),text,html)
Пример #4
0
    def write_cav(self,response=1):
        if not self.vol_file:
            self.select_first_message(".vol file")
            return

        self.get_options()
        if self.vol_dataset:
            self.options['dataset'] = self.vol_dataset
            message = Voronoia.process_command('cavities',self.vol_dataset,self.vol_dataset,self.options)
        else:    
            message = Voronoia.process_command('cavities',self.vol_file,self.out_path,self.options)
        if response:
            ms = Pmw.MessageDialog(self.parent,title="Cavities written as PDB file",message_text=message[0])
            ms.activate()
            ms.withdraw()
        return message[1]
Пример #5
0
    def compare_ref(self):
        if not self.vol_file:
            self.select_first_message(".vol file")
            return
        if not self.options['reference_file']:
            self.select_first_message("reference file")
            return
        self.get_options()
        self.options['reportmode']='both'

        if self.vol_dataset:
            self.options['dataset'] = self.vol_dataset
            text,html = Voronoia.process_command('compare',self.vol_dataset,self.vol_dataset,self.options)
        else:
            text,html = Voronoia.process_command('compare',self.vol_file,self.out_path,self.options)        
        self.text_dialog('Packing compared to reference','Packing compared to reference values in\n%s'%(self.options['reference_file']),text,html)
Пример #6
0
    def calc_packing(self,show_message=1):
        # check for complete data
        self.get_options()
        if not self.input_file:
            self.select_first_message("PDB file")
            return
        if not self.out_path:
            self.select_first_message("output directory")
            return

        result = []
        for in_file in self.get_vol_files():
            # show calculation message
            ms = Pmw.MessageDialog(title="Calculation running",buttons=[],message_text="""Packing data for the structure
%s
is being calculated. Please wait.

The calculation takes 1-15 minutes per file, depending on the size of the structure
and your hardware."""%in_file)
            ms.show()
            self.approot.update()

            # calculate
            message = Voronoia.process_command('calc',in_file,self.out_path,self.options)
            result.append(message)

            # destroy old message
            ms.withdraw()
            ms.destroy()
            self.approot.update()            

        # set vol file variable
        if self.pdb_dataset:
            text = "%i packing files were calculated:\n"%len(result)
            text += string.join(['\t'+name[1] for name in result],'\n')
            if show_message:
                ms = Pmw.MessageDialog(title=".vol files calculated",message_text=text)
            self.vol_dataset = self.out_path
            self.vol_file = result[0][1]
            self.vol_file_var.set(self.vol_dataset)
            self.vol_dataset_radio.setvalue(['Process all .vol files in this directory'])
            return [name[1] for name in result]
        else:
            message = result[0]
            if show_message:
                ms = Pmw.MessageDialog(title=".vol file calculated",message_text=message[0])
            self.vol_file = message[1]            
            self.vol_file_var.set(self._short_name(message[1])) 
            return message[1]