PEATDB/DNAtool/primer_database.py
def write_current_primers(self,filename='current_order.txt'):
        """Write currently selected primers to a space-delimited file
           This is formatted to be uploaded to the MGW website for ordering"""

        if not filename:
            print 'no filename given'
            return

        if not self.primers.curselection():
            print 'primer database is empty or no selection'
            return

        # Get currently selected primers into a list
        tmp_selection=self.primers.curselection()
        selection=[]
        for num in tmp_selection:
            selection.append(int(num))
        primers={}
        first=1
        # Now figure out the selected primers and store them in primers
        for primer_num in selection:
            name_selected=self.primer_order[primer_num]
            primers[name_selected]=self.parent.data['primer_dict'][name_selected]


        #fd=open(filename,'wb')

        self.DumpPDB = []
        import mutation
        for entry in primers:
            tmp = []
            tmp.append(entry+'_for')
            tmp.append(' ')
            tmp.append(primers[entry]['sequence'])
            reverse=mutation.get_reverse_complementary(primers[entry]['sequence'])
            tmp.append('\n')
            tmp.append(entry+'_rev')
            tmp.append(' ')
            tmp.append(reverse)
            tmp.append('\n')
            self.DumpPDB.append(tmp)
        try:
            fd=open(filename,'a')
            for line in self.DumpPDB:
                str = ''
                for S in line:
                    str = str+S
                fd.write(str+'\n')
            fd.close()
            print "File written ",filename
        except:
            print "error: could not write file ",filename

        from PEATDB.textFrame import textFrame
        self.order_frame = textFrame(self, 'Current primers')
        self.order_frame.load_text(self.DumpPDB)
        fd.close()

        return
Write currently selected primers to a space-delimited file
           This is formatted to be uploaded to the MGW website for ordering
Write currently selected primers to a space-delimited file
This is formatted to be uploaded to the MGW website for ordering
Write currently selected primers to a space - delimited file This is formatted to be uploaded to the MGW website for ordering
def write_current_primers(self,filename='current_order.txt'):
        if not filename:
            print 'no filename given'
            return
        if not self.primers.curselection():
            print 'primer database is empty or no selection'
            return
        tmp_selection=self.primers.curselection()
        selection=[]
        for num in tmp_selection:
            selection.append(int(num))
        primers={}
        first=1
        for primer_num in selection:
            name_selected=self.primer_order[primer_num]
            primers[name_selected]=self.parent.data['primer_dict'][name_selected]
        self.DumpPDB = []
        import mutation
        for entry in primers:
            tmp = []
            tmp.append(entry+'_for')
            tmp.append(' ')
            tmp.append(primers[entry]['sequence'])
            reverse=mutation.get_reverse_complementary(primers[entry]['sequence'])
            tmp.append('\n')
            tmp.append(entry+'_rev')
            tmp.append(' ')
            tmp.append(reverse)
            tmp.append('\n')
            self.DumpPDB.append(tmp)
        try:
            fd=open(filename,'a')
            for line in self.DumpPDB:
                str = ''
                for S in line:
                    str = str+S
                fd.write(str+'\n')
            fd.close()
            print "File written ",filename
        except:
            print "error: could not write file ",filename
        from PEATDB.textFrame import textFrame
        self.order_frame = textFrame(self, 'Current primers')
        self.order_frame.load_text(self.DumpPDB)
        fd.close()
        return
def write_current_primers ( self , filename = 'current_order.txt' ) : if not filename : print 'no filename given' return if not self . primers . curselection ( ) : print 'primer database is empty or no selection' return tmp_selection = self . primers . curselection ( ) selection = [ ] for num in tmp_selection : selection . append ( int ( num ) ) primers = { } first = 1 for primer_num in selection : name_selected = self . primer_order [ primer_num ] primers [ name_selected ] = self . parent . data [ 'primer_dict' ] [ name_selected ] self . DumpPDB = [ ] import mutation for entry in primers : tmp = [ ] tmp . append ( entry + '_for' ) tmp . append ( ' ' ) tmp . append ( primers [ entry ] [ 'sequence' ] ) reverse = mutation . get_reverse_complementary ( primers [ entry ] [ 'sequence' ] ) tmp . append ( '\n' ) tmp . append ( entry + '_rev' ) tmp . append ( ' ' ) tmp . append ( reverse ) tmp . append ( '\n' ) self . DumpPDB . append ( tmp ) try : fd = open ( filename , 'a' ) for line in self . DumpPDB : str = '' for S in line : str = str + S fd . write ( str + '\n' ) fd . close ( ) print "File written " , filename except : print "error: could not write file " , filename from PEATDB . textFrame import textFrame self . order_frame = textFrame ( self , 'Current primers' ) self . order_frame . load_text ( self . DumpPDB ) fd . close ( ) return
Write currently selected primers to a space-delimited file
This is formatted to be uploaded to the MGW website for ordering
Write currently selected primers to a space - delimited file This is formatted to be uploaded to the MGW website for ordering
"""Write currently selected primers to a space-delimited file
           This is formatted to be uploaded to the MGW website for ordering""" # Get currently selected primers into a list # Now figure out the selected primers and store them in primers #fd=open(filename,'wb')
self
filename