PEATDB/DNAtool/DNA_sequencing.py
def show_DNAseq(self,seqfile=None,usecurrent=0,clearprev=1,level=0):
        """Load and display a sequence from a file"""

        if seqfile==None:
            seqfile = self.main_self.dnaseq_read(newprotein=None,variable='seq_comp',var2='seq_comp_file')
        # Pass the file to dnaseq_read instead of getting it to open a dialog
        else:
            #print 'seqfile:',seqfile
            self.main_self.dnaseq_read(newprotein=None,fileinput=seqfile,variable='seq_comp',
                                        var2='seq_comp_file')
        #print self.main_self.data['seq_comp']
        # Clear previous seq first, this is default value in parameter list
        if clearprev==1:
            self.main_self.seqframe.delete('comparison_seq')
        #print self.main_self.data['seq_comp']
        #print
        #print self.main_self.data['DNAseq']

        #if usecurrent is 1, skip the calculation and use current seq (only for refresh)
        if usecurrent==0:
            sites=self.find_primer_binding_sites(self.main_self.data['seq_comp'],
                                                    self.main_self.data['DNAseq'])
            print sites
            #
            # Print the number of binding sites
            #
            best_score=0
            best_position=None
            scores=[]
            first_neg=1
            for position,score in sites:
                scores.append(score)
                #
                # Find the best position
                #
                if score>best_score:
                    best_score=score
                    best_position=position
            this_seq={'startpos':best_position}
            this_seq['sequence']=self.main_self.data['seq_comp']
            self.current_seq=this_seq

        if self.main_self.show_comp_sequence.get()==1:            
            x = os.path.split(seqfile)
            self.draw_primer(self.current_seq,colour='#800080',thetag='comparison_seq',seqname=x[1],lvl=level)
        return
Load and display a sequence from a file
Load and display a sequence from a file
Load and display a sequence from a file
def show_DNAseq(self,seqfile=None,usecurrent=0,clearprev=1,level=0):
        if seqfile==None:
            seqfile = self.main_self.dnaseq_read(newprotein=None,variable='seq_comp',var2='seq_comp_file')
        else:
            self.main_self.dnaseq_read(newprotein=None,fileinput=seqfile,variable='seq_comp',
                                        var2='seq_comp_file')
        if clearprev==1:
            self.main_self.seqframe.delete('comparison_seq')
         self.main_self.data['DNAseq']
        if usecurrent==0:
            sites=self.find_primer_binding_sites(self.main_self.data['seq_comp'],
                                                    self.main_self.data['DNAseq'])
            print sites
             Print the number of binding sites
            best_score=0
            best_position=None
            scores=[]
            first_neg=1
            for position,score in sites:
                scores.append(score)
                 Find the best position
                if score>best_score:
                    best_score=score
                    best_position=position
            this_seq={'startpos':best_position}
            this_seq['sequence']=self.main_self.data['seq_comp']
            self.current_seq=this_seq
        if self.main_self.show_comp_sequence.get()==1:            
            x = os.path.split(seqfile)
            self.draw_primer(self.current_seq,colour='800080',thetag='comparison_seq',seqname=x[1],lvl=level)
        return
def show_DNAseq ( self , seqfile = None , usecurrent = 0 , clearprev = 1 , level = 0 ) : if seqfile == None : seqfile = self . main_self . dnaseq_read ( newprotein = None , variable = 'seq_comp' , var2 = 'seq_comp_file' ) else : self . main_self . dnaseq_read ( newprotein = None , fileinput = seqfile , variable = 'seq_comp' , var2 = 'seq_comp_file' ) if clearprev == 1 : self . main_self . seqframe . delete ( 'comparison_seq' ) if usecurrent == 0 : sites = self . find_primer_binding_sites ( self . main_self . data [ 'seq_comp' ] , self . main_self . data [ 'DNAseq' ] ) print sites best_score = 0 best_position = None scores = [ ] first_neg = 1 for position , score in sites : scores . append ( score ) if score > best_score : best_score = score best_position = position this_seq = { 'startpos' : best_position } this_seq [ 'sequence' ] = self . main_self . data [ 'seq_comp' ] self . current_seq = this_seq if self . main_self . show_comp_sequence . get ( ) == 1 : x = os . path . split ( seqfile ) self . draw_primer ( self . current_seq , colour = '#800080' , thetag = 'comparison_seq' , seqname = x [ 1 ] , lvl = level ) return
Load and display a sequence from a file
Load and display a sequence from a file
"""Load and display a sequence from a file""" # Pass the file to dnaseq_read instead of getting it to open a dialog #print 'seqfile:',seqfile #print self.main_self.data['seq_comp'] # Clear previous seq first, this is default value in parameter list #print self.main_self.data['seq_comp'] #print #print self.main_self.data['DNAseq'] #if usecurrent is 1, skip the calculation and use current seq (only for refresh) # # Print the number of binding sites # # # Find the best position #
self
seqfile
usecurrent
clearprev
level