PEATDB/DNAtool/primer_database.py
def find_primer_inpDB(self,event=None):
        """Find the primers in pDB that fulfills the criteria"""

        # Find all matches
        searchtext=(self.find_var.get()).upper()
        searchtype=self.find_type.get()

        solutions=[]
        for primer in self.primer_order:
            if searchtype=='Find name':
                if (primer.upper()).find(searchtext)!=-1:
                    solutions.append(primer)
            elif searchtype=='Find sequence':
                if (self.parent.data['primer_dict'][primer]['sequence']).upper().find(searchtext)!=-1:
                    solutions.append(primer)
            else:
                import tkMessageBox
                tkMessageBox.showwarning('not implemented yet','I never thought anyone would use this, so send me an email with a good reason why you need this, and I will fix it.\nJens.Nielsen@ucd.ie')
                return

        if not self.find_solution is None:
            self.find_solution=self.find_solution+1
            if self.find_solution>=len(solutions):
                self.find_solution=0
        else:
            self.find_solution=0

        # Highlight the solution and scroll the listbox

        self.primers.selection_clear(first=0,last=len(self.primer_order)-1)
        if len(solutions)>0 and searchtext!='':
            pname=solutions[self.find_solution]
            index=0
            for primer in self.primer_order:
                if primer==pname:
                    self.primers.see(index)
                if primer in solutions:
                    self.primers.selection_set(index)
                index=index+1
        return
Find the primers in pDB that fulfills the criteria
Find the primers in pDB that fulfills the criteria
Find the primers in pDB that fulfills the criteria
def find_primer_inpDB(self,event=None):
        searchtext=(self.find_var.get()).upper()
        searchtype=self.find_type.get()
        solutions=[]
        for primer in self.primer_order:
            if searchtype=='Find name':
                if (primer.upper()).find(searchtext)!=-1:
                    solutions.append(primer)
            elif searchtype=='Find sequence':
                if (self.parent.data['primer_dict'][primer]['sequence']).upper().find(searchtext)!=-1:
                    solutions.append(primer)
            else:
                import tkMessageBox
                tkMessageBox.showwarning('not implemented yet','I never thought anyone would use this, so send me an email with a good reason why you need this, and I will fix it.\nJens.Nielsen@ucd.ie')
                return
        if not self.find_solution is None:
            self.find_solution=self.find_solution+1
            if self.find_solution>=len(solutions):
                self.find_solution=0
        else:
            self.find_solution=0
        self.primers.selection_clear(first=0,last=len(self.primer_order)-1)
        if len(solutions)>0 and searchtext!='':
            pname=solutions[self.find_solution]
            index=0
            for primer in self.primer_order:
                if primer==pname:
                    self.primers.see(index)
                if primer in solutions:
                    self.primers.selection_set(index)
                index=index+1
        return
def find_primer_inpDB ( self , event = None ) : searchtext = ( self . find_var . get ( ) ) . upper ( ) searchtype = self . find_type . get ( ) solutions = [ ] for primer in self . primer_order : if searchtype == 'Find name' : if ( primer . upper ( ) ) . find ( searchtext ) != - 1 : solutions . append ( primer ) elif searchtype == 'Find sequence' : if ( self . parent . data [ 'primer_dict' ] [ primer ] [ 'sequence' ] ) . upper ( ) . find ( searchtext ) != - 1 : solutions . append ( primer ) else : import tkMessageBox tkMessageBox . showwarning ( 'not implemented yet' , 'I never thought anyone would use this, so send me an email with a good reason why you need this, and I will fix it.\nJens.Nielsen@ucd.ie' ) return if not self . find_solution is None : self . find_solution = self . find_solution + 1 if self . find_solution >= len ( solutions ) : self . find_solution = 0 else : self . find_solution = 0 self . primers . selection_clear ( first = 0 , last = len ( self . primer_order ) - 1 ) if len ( solutions ) > 0 and searchtext != '' : pname = solutions [ self . find_solution ] index = 0 for primer in self . primer_order : if primer == pname : self . primers . see ( index ) if primer in solutions : self . primers . selection_set ( index ) index = index + 1 return
Find the primers in pDB that fulfills the criteria
Find the primers in pDB that fulfills the criteria
"""Find the primers in pDB that fulfills the criteria""" # Find all matches # Highlight the solution and scroll the listbox
self
event