PEATDB/PEATApp.py
def save_structure(self,protein,field_name,filename=None):
        """Save a PDB file from a Structure cell"""
        pdblines,X=self.DB.getStructure(protein,field_name)
        if not pdblines:
            return
        if filename==None:
            import tkFileDialog, os
            savedir=self.preferences.get('datadir')
            filename=tkFileDialog.asksaveasfilename(defaultextension='.pdb',
                                                    initialdir=savedir,
                                                    filetypes=[("PDB files","*.pdb"),
                                                               ("All files","*.*")])
        if filename:
            if filename[-4:]!='.pdb':
                filename=filename+'.pdb'
            fd=open(filename,'w')
            for line in pdblines:
                fd.write(line)
            fd.close()
        return
Save a PDB file from a Structure cell
Save a PDB file from a Structure cell
Save a PDB file from a Structure cell
def save_structure(self,protein,field_name,filename=None):
        pdblines,X=self.DB.getStructure(protein,field_name)
        if not pdblines:
            return
        if filename==None:
            import tkFileDialog, os
            savedir=self.preferences.get('datadir')
            filename=tkFileDialog.asksaveasfilename(defaultextension='.pdb',
                                                    initialdir=savedir,
                                                    filetypes=[("PDB files","*.pdb"),
                                                               ("All files","*.*")])
        if filename:
            if filename[-4:]!='.pdb':
                filename=filename+'.pdb'
            fd=open(filename,'w')
            for line in pdblines:
                fd.write(line)
            fd.close()
        return
def save_structure ( self , protein , field_name , filename = None ) : pdblines , X = self . DB . getStructure ( protein , field_name ) if not pdblines : return if filename == None : import tkFileDialog , os savedir = self . preferences . get ( 'datadir' ) filename = tkFileDialog . asksaveasfilename ( defaultextension = '.pdb' , initialdir = savedir , filetypes = [ ( "PDB files" , "*.pdb" ) , ( "All files" , "*.*" ) ] ) if filename : if filename [ - 4 : ] != '.pdb' : filename = filename + '.pdb' fd = open ( filename , 'w' ) for line in pdblines : fd . write ( line ) fd . close ( ) return
Save a PDB file from a Structure cell
Save a PDB file from a Structure cell
"""Save a PDB file from a Structure cell"""
self
protein
field_name
filename