PEATDB/DNA_sequence.py
def Seq2Pir(self,seq=None,name='Dummy_protein',description=' '):
        """
        # Translates self.seq or seq into pir format.
        # The pir file is returned as a list of strings
        """
        import string
        pir=[]
        pir.append('>P1;'+name+'\n')
        pir.append(description+'\n')
        if not seq:
            seq=''
            for x in self.sequence:
                if self.three_to_one.has_key(x[1]):
                    seq=seq+self.three_to_one[x[1]]
        seq=string.upper(seq)
        seq=string.strip(seq)
        seq=string.replace(seq,' ','')
        seq=string.replace(seq,'\n','')
        x=0
        s=' '
        for char in seq:
            s=s+char
            x=x+1
            if x==60:
                pir.append(s+'\n')
                s=' '
                x=0
        pir.append(s+'*\n')
        return pir

        # Translates self.seq or seq into pir format.
        # The pir file is returned as a list of strings
        
Translates self.seq or seq into pir format.
The pir file is returned as a list of strings
Translates self . seq or seq into pir format . The pir file is returned as a list of strings
def Seq2Pir(self,seq=None,name='Dummy_protein',description=' '):
        import string
        pir=[]
        pir.append('>P1;'+name+'\n')
        pir.append(description+'\n')
        if not seq:
            seq=''
            for x in self.sequence:
                if self.three_to_one.has_key(x[1]):
                    seq=seq+self.three_to_one[x[1]]
        seq=string.upper(seq)
        seq=string.strip(seq)
        seq=string.replace(seq,' ','')
        seq=string.replace(seq,'\n','')
        x=0
        s=' '
        for char in seq:
            s=s+char
            x=x+1
            if x==60:
                pir.append(s+'\n')
                s=' '
                x=0
        pir.append(s+'*\n')
        return pir
def Seq2Pir ( self , seq = None , name = 'Dummy_protein' , description = ' ' ) : import string pir = [ ] pir . append ( '>P1;' + name + '\n' ) pir . append ( description + '\n' ) if not seq : seq = '' for x in self . sequence : if self . three_to_one . has_key ( x [ 1 ] ) : seq = seq + self . three_to_one [ x [ 1 ] ] seq = string . upper ( seq ) seq = string . strip ( seq ) seq = string . replace ( seq , ' ' , '' ) seq = string . replace ( seq , '\n' , '' ) x = 0 s = ' ' for char in seq : s = s + char x = x + 1 if x == 60 : pir . append ( s + '\n' ) s = ' ' x = 0 pir . append ( s + '*\n' ) return pir
Translates self.seq or seq into pir format.
Translates self . seq or seq into pir format .
"""
        # Translates self.seq or seq into pir format.
        # The pir file is returned as a list of strings
        """
self
seq
name
description