pKa/pKD_tools.py
def findSequenceDifferences(child_sequence, parent_sequence,full_parent_sequence,ignoreCterm=False):
    """
    # Find all amino acid differences between child_sequence and parent_sequence
    Child sequence and parent sequence must be aligned and in 1-letter format:
    child_sequence, parent_sequence: AAADEFFG
    full parent sequence is a Protool.sequence object
    """
    #
    # Loop over the sequences - changes are record from parent -> child
    #
    import string
    operations=[]
    import Protool
    PI=Protool.structureIO()
    #
    Cterm_add=0
    insert_num=0
    full_parent_count=0
    #for count in range(len(record_sequence)):
    #    parent_aa=parent_sequence[count]
    #    child_aa=record_sequence[count]
    for parent_aa,child_aa in zip(parent_sequence,child_sequence):
        #
        #print parent_aa,child_aa
        if parent_aa!=child_aa:
            
            # Find the PDB file residue number
            if full_parent_count>=len(full_parent_sequence):
                # If we have an insertion at the Cterm
                aa_identifier=full_parent_sequence[-1][0]
                if ignoreCterm:
                    continue
            else:
                aa_identifier=full_parent_sequence[full_parent_count][0]
            #if aa_identifier[-1]==':':
            #    aa_identifier=aa_identifier[:-1]
            #
            # Convert to 3letter format
            #
            if parent_aa!='-':
                full_parent_count=full_parent_count+1
                parent_aa=PI.one_to_three[parent_aa]
            if child_aa!='-':
                child_aa=PI.one_to_three[child_aa]
            if parent_aa=='-':
                operations.append('insert%d:%s:%s' %(insert_num,aa_identifier,child_aa))
                insert_num=insert_num+1
            elif child_aa=='-':
                insert_num=0
                operations.append('delete:%s:%s' %(aa_identifier,parent_aa))
            else:
                insert_num=0
                operations.append('%s:%s:%s' %(aa_identifier,parent_aa,child_aa))
        else:
            full_parent_count=full_parent_count+1
    return operations

    # Find all amino acid differences between child_sequence and parent_sequence
    Child sequence and parent sequence must be aligned and in 1-letter format:
    child_sequence, parent_sequence: AAADEFFG
    full parent sequence is a Protool.sequence object
    
Find all amino acid differences between child_sequence and parent_sequence
Child sequence and parent sequence must be aligned and in 1-letter format:
child_sequence, parent_sequence: AAADEFFG
full parent sequence is a Protool.sequence object
Find all amino acid differences between child_sequence and parent_sequence Child sequence and parent sequence must be aligned and in 1 - letter format : child_sequence parent_sequence : AAADEFFG full parent sequence is a Protool . sequence object
def findSequenceDifferences(child_sequence, parent_sequence,full_parent_sequence,ignoreCterm=False):
     Loop over the sequences - changes are record from parent -> child
    import string
    operations=[]
    import Protool
    PI=Protool.structureIO()
    Cterm_add=0
    insert_num=0
    full_parent_count=0
    for count in range(len(record_sequence)):
        parent_aa=parent_sequence[count]
        child_aa=record_sequence[count]
    for parent_aa,child_aa in zip(parent_sequence,child_sequence):
        print parent_aa,child_aa
        if parent_aa!=child_aa:
             Find the PDB file residue number
            if full_parent_count>=len(full_parent_sequence):
                 If we have an insertion at the Cterm
                aa_identifier=full_parent_sequence[-1][0]
                if ignoreCterm:
                    continue
            else:
                aa_identifier=full_parent_sequence[full_parent_count][0]
            if aa_identifier[-1]==':':
                aa_identifier=aa_identifier[:-1]
             Convert to 3letter format
            if parent_aa!='-':
                full_parent_count=full_parent_count+1
                parent_aa=PI.one_to_three[parent_aa]
            if child_aa!='-':
                child_aa=PI.one_to_three[child_aa]
            if parent_aa=='-':
                operations.append('insert%d:%s:%s' %(insert_num,aa_identifier,child_aa))
                insert_num=insert_num+1
            elif child_aa=='-':
                insert_num=0
                operations.append('delete:%s:%s' %(aa_identifier,parent_aa))
            else:
                insert_num=0
                operations.append('%s:%s:%s' %(aa_identifier,parent_aa,child_aa))
        else:
            full_parent_count=full_parent_count+1
    return operations
def findSequenceDifferences ( child_sequence , parent_sequence , full_parent_sequence , ignoreCterm = False ) : import string operations = [ ] import Protool PI = Protool . structureIO ( ) Cterm_add = 0 insert_num = 0 full_parent_count = 0 for parent_aa , child_aa in zip ( parent_sequence , child_sequence ) : if parent_aa != child_aa : if full_parent_count >= len ( full_parent_sequence ) : aa_identifier = full_parent_sequence [ - 1 ] [ 0 ] if ignoreCterm : continue else : aa_identifier = full_parent_sequence [ full_parent_count ] [ 0 ] if parent_aa != '-' : full_parent_count = full_parent_count + 1 parent_aa = PI . one_to_three [ parent_aa ] if child_aa != '-' : child_aa = PI . one_to_three [ child_aa ] if parent_aa == '-' : operations . append ( 'insert%d:%s:%s' % ( insert_num , aa_identifier , child_aa ) ) insert_num = insert_num + 1 elif child_aa == '-' : insert_num = 0 operations . append ( 'delete:%s:%s' % ( aa_identifier , parent_aa ) ) else : insert_num = 0 operations . append ( '%s:%s:%s' % ( aa_identifier , parent_aa , child_aa ) ) else : full_parent_count = full_parent_count + 1 return operations
Find all amino acid differences between child_sequence and parent_sequence
Child sequence and parent sequence must be aligned and in 1-letter format:
child_sequence, parent_sequence: AAADEFFG
full parent sequence is a Protool.sequence object
Find all amino acid differences between child_sequence and parent_sequence Child sequence and parent sequence must be aligned and in 1 - letter format : child_sequence parent_sequence : AAADEFFG full parent sequence is a Protool . sequence object
"""
    # Find all amino acid differences between child_sequence and parent_sequence
    Child sequence and parent sequence must be aligned and in 1-letter format:
    child_sequence, parent_sequence: AAADEFFG
    full parent sequence is a Protool.sequence object
    """ # # Loop over the sequences - changes are record from parent -> child # # #for count in range(len(record_sequence)): #    parent_aa=parent_sequence[count] #    child_aa=record_sequence[count] # #print parent_aa,child_aa # Find the PDB file residue number # If we have an insertion at the Cterm #if aa_identifier[-1]==':': #    aa_identifier=aa_identifier[:-1] # # Convert to 3letter format #
child_sequence
parent_sequence
full_parent_sequence
ignoreCterm