PEATDB/Ekin/IO.py
def import_sparky(self,event=None):
        """Dialog showing selected directory containing Sparky peak files"""

        #
        # Show what we got
        #
        self.overwrite_all = IntVar()
        self.overwrite_all.set(0)
        self.removecurrent = IntVar()
        self.removecurrent.set(0)
        self.assigncol = self.assigncol_var.get()

        self.sparky_win=Toplevel()
        self.sparky_win.title('Titration curves read')
        self.sparky_win.geometry('+0+200')
        Label(self.sparky_win,text='I read titration curves for the following peaks').grid(row=0,column=0,columnspan=3)
        Label(self.sparky_win,text='Select one to analyse').grid(row=1,column=0,columnspan=3)
        #
        # List all of the groups
        #
        pHs=self.peaks.keys()
        pHs.sort()
        #
        # Loop over all pH values to get all the residues
        #
        residues=[]
        for pH in pHs:
            ress=self.peaks[pH].keys()
            for res in ress:
                if not res in residues:
                    residues.append(res)
        residues.sort()
        self.peak_residues=residues
        count=0
        self.peak=IntVar()
        self.peak.set(0)
        yscrollbar=Scrollbar(self.sparky_win,orient='vertical',width=10)
        yscrollbar.grid(row=2,column=3,sticky='nws')
        #
        self.peaks_read=Listbox(self.sparky_win,bg='white',
                                fg='black',
                                height=30,
                                width=20,
                                yscrollcommand=yscrollbar.set,
                                selectmode=EXTENDED)
        self.peaks_read.grid(row=2,column=0,columnspan=3,sticky='news',padx=3,pady=4)
        yscrollbar.config(command=self.peaks_read.yview)
        self.sparky_win.grid_rowconfigure(2, weight=1)
        #
        for residue in residues:
            self.peaks_read.insert(END,residue)

        overwritecheck = Checkbutton(self.sparky_win, text="Overwrite All", variable=self.overwrite_all)
        overwritecheck.grid(row=3,column=0,columnspan=1,padx=1,pady=1)
        removecurrentcheck = Checkbutton(self.sparky_win, text="Remove Current", variable=self.removecurrent)
        removecurrentcheck.grid(row=3,column=1,columnspan=2,padx=1,pady=1)

        #
        # Buttons for selecting
        #
        Button(self.sparky_win,text='Do Import',command=self.copy_peak).grid(row=4,column=0,sticky='news',padx=3,pady=4)
        #Button(self.sparky_win,text='Copy to pKaTool',command=self.copy_peaks_2pKaTool).grid(row=4,column=1,sticky='news',padx=3,pady=4)
        Button(self.sparky_win,text='Done',command=self.sparky_win.destroy).grid(row=4,column=2,sticky='news',padx=3,pady=4)

        #self.peaks_read.bind("<ButtonRelease-1>",self.copy_peak)
        return
Dialog showing selected directory containing Sparky peak files
Dialog showing selected directory containing Sparky peak files
Dialog showing selected directory containing Sparky peak files
def import_sparky(self,event=None):
         Show what we got
        self.overwrite_all = IntVar()
        self.overwrite_all.set(0)
        self.removecurrent = IntVar()
        self.removecurrent.set(0)
        self.assigncol = self.assigncol_var.get()
        self.sparky_win=Toplevel()
        self.sparky_win.title('Titration curves read')
        self.sparky_win.geometry('+0+200')
        Label(self.sparky_win,text='I read titration curves for the following peaks').grid(row=0,column=0,columnspan=3)
        Label(self.sparky_win,text='Select one to analyse').grid(row=1,column=0,columnspan=3)
         List all of the groups
        pHs=self.peaks.keys()
        pHs.sort()
         Loop over all pH values to get all the residues
        residues=[]
        for pH in pHs:
            ress=self.peaks[pH].keys()
            for res in ress:
                if not res in residues:
                    residues.append(res)
        residues.sort()
        self.peak_residues=residues
        count=0
        self.peak=IntVar()
        self.peak.set(0)
        yscrollbar=Scrollbar(self.sparky_win,orient='vertical',width=10)
        yscrollbar.grid(row=2,column=3,sticky='nws')
        self.peaks_read=Listbox(self.sparky_win,bg='white',
                                fg='black',
                                height=30,
                                width=20,
                                yscrollcommand=yscrollbar.set,
                                selectmode=EXTENDED)
        self.peaks_read.grid(row=2,column=0,columnspan=3,sticky='news',padx=3,pady=4)
        yscrollbar.config(command=self.peaks_read.yview)
        self.sparky_win.grid_rowconfigure(2, weight=1)
        for residue in residues:
            self.peaks_read.insert(END,residue)
        overwritecheck = Checkbutton(self.sparky_win, text="Overwrite All", variable=self.overwrite_all)
        overwritecheck.grid(row=3,column=0,columnspan=1,padx=1,pady=1)
        removecurrentcheck = Checkbutton(self.sparky_win, text="Remove Current", variable=self.removecurrent)
        removecurrentcheck.grid(row=3,column=1,columnspan=2,padx=1,pady=1)
         Buttons for selecting
        Button(self.sparky_win,text='Do Import',command=self.copy_peak).grid(row=4,column=0,sticky='news',padx=3,pady=4)
        Button(self.sparky_win,text='Copy to pKaTool',command=self.copy_peaks_2pKaTool).grid(row=4,column=1,sticky='news',padx=3,pady=4)
        Button(self.sparky_win,text='Done',command=self.sparky_win.destroy).grid(row=4,column=2,sticky='news',padx=3,pady=4)
        self.peaks_read.bind("<ButtonRelease-1>",self.copy_peak)
        return
def import_sparky ( self , event = None ) : self . overwrite_all = IntVar ( ) self . overwrite_all . set ( 0 ) self . removecurrent = IntVar ( ) self . removecurrent . set ( 0 ) self . assigncol = self . assigncol_var . get ( ) self . sparky_win = Toplevel ( ) self . sparky_win . title ( 'Titration curves read' ) self . sparky_win . geometry ( '+0+200' ) Label ( self . sparky_win , text = 'I read titration curves for the following peaks' ) . grid ( row = 0 , column = 0 , columnspan = 3 ) Label ( self . sparky_win , text = 'Select one to analyse' ) . grid ( row = 1 , column = 0 , columnspan = 3 ) pHs = self . peaks . keys ( ) pHs . sort ( ) residues = [ ] for pH in pHs : ress = self . peaks [ pH ] . keys ( ) for res in ress : if not res in residues : residues . append ( res ) residues . sort ( ) self . peak_residues = residues count = 0 self . peak = IntVar ( ) self . peak . set ( 0 ) yscrollbar = Scrollbar ( self . sparky_win , orient = 'vertical' , width = 10 ) yscrollbar . grid ( row = 2 , column = 3 , sticky = 'nws' ) self . peaks_read = Listbox ( self . sparky_win , bg = 'white' , fg = 'black' , height = 30 , width = 20 , yscrollcommand = yscrollbar . set , selectmode = EXTENDED ) self . peaks_read . grid ( row = 2 , column = 0 , columnspan = 3 , sticky = 'news' , padx = 3 , pady = 4 ) yscrollbar . config ( command = self . peaks_read . yview ) self . sparky_win . grid_rowconfigure ( 2 , weight = 1 ) for residue in residues : self . peaks_read . insert ( END , residue ) overwritecheck = Checkbutton ( self . sparky_win , text = "Overwrite All" , variable = self . overwrite_all ) overwritecheck . grid ( row = 3 , column = 0 , columnspan = 1 , padx = 1 , pady = 1 ) removecurrentcheck = Checkbutton ( self . sparky_win , text = "Remove Current" , variable = self . removecurrent ) removecurrentcheck . grid ( row = 3 , column = 1 , columnspan = 2 , padx = 1 , pady = 1 ) Button ( self . sparky_win , text = 'Do Import' , command = self . copy_peak ) . grid ( row = 4 , column = 0 , sticky = 'news' , padx = 3 , pady = 4 ) Button ( self . sparky_win , text = 'Done' , command = self . sparky_win . destroy ) . grid ( row = 4 , column = 2 , sticky = 'news' , padx = 3 , pady = 4 ) return
Dialog showing selected directory containing Sparky peak files
Dialog showing selected directory containing Sparky peak files
"""Dialog showing selected directory containing Sparky peak files""" # # Show what we got # # # List all of the groups # # # Loop over all pH values to get all the residues # # # # # Buttons for selecting # #Button(self.sparky_win,text='Copy to pKaTool',command=self.copy_peaks_2pKaTool).grid(row=4,column=1,sticky='news',padx=3,pady=4) #self.peaks_read.bind("<ButtonRelease-1>",self.copy_peak)
self
event