pKa/pKD_tools.py
def shortenOperations(operations):
    """Provide the more conventional short form of the mutations"""
    new_ops=[]
    import DNAtool.mutation
    import pKa.pKD_tools as pKD_tools
    for operation in operations:
        if operation.find('insert')!=-1:
            text=operation.replace('insert','').split(':')
            insertnum=int(text[0])
            resnum='%s:%s' %(text[1],text[2])
            resnum=int(pKD_tools.get_intresnum_from_res(resnum))
            chainID=text[1]
            if len(chainID)!=0:
                chainID='(%s)' %chainID
            insertchar='abcdefghijklmnopqrstuvw'
            new=text[-1]
            new_ops.append('*%s%d%s%s' %(chainID,resnum,insertchar[insertnum],DNAtool.mutation.three_to_one[new]))
        elif operation.find('delete:')!=-1:
            text=operation.replace('delete:','')
            restext=text.split(':')
            chainID=restext[0]
            if len(chainID)!=0:
                chainID='(%s)' %chainID
            resnum=int(pKD_tools.get_intresnum_from_res(text))
            old=restext[-1]
            new_ops.append('%s%s%d*' %(DNAtool.mutation.three_to_one[old],chainID,resnum))
        else:
            new=pKD_tools.get_newrestyp_from_mut(operation)
            old=pKD_tools.get_oldrestyp_from_mut(operation)
            chainID=operation.split(':')[0]
            resnum=pKD_tools.get_intresnum_from_res(operation)
            if len(chainID)!=0:
                chainID='(%s)' %chainID
            new_ops.append('%s%s%d%s' %(DNAtool.mutation.three_to_one[old],
                                        chainID,
                                        resnum,
                                        DNAtool.mutation.three_to_one[new]))
    return new_ops
Provide the more conventional short form of the mutations
Provide the more conventional short form of the mutations
Provide the more conventional short form of the mutations
def shortenOperations(operations):
    new_ops=[]
    import DNAtool.mutation
    import pKa.pKD_tools as pKD_tools
    for operation in operations:
        if operation.find('insert')!=-1:
            text=operation.replace('insert','').split(':')
            insertnum=int(text[0])
            resnum='%s:%s' %(text[1],text[2])
            resnum=int(pKD_tools.get_intresnum_from_res(resnum))
            chainID=text[1]
            if len(chainID)!=0:
                chainID='(%s)' %chainID
            insertchar='abcdefghijklmnopqrstuvw'
            new=text[-1]
            new_ops.append('*%s%d%s%s' %(chainID,resnum,insertchar[insertnum],DNAtool.mutation.three_to_one[new]))
        elif operation.find('delete:')!=-1:
            text=operation.replace('delete:','')
            restext=text.split(':')
            chainID=restext[0]
            if len(chainID)!=0:
                chainID='(%s)' %chainID
            resnum=int(pKD_tools.get_intresnum_from_res(text))
            old=restext[-1]
            new_ops.append('%s%s%d*' %(DNAtool.mutation.three_to_one[old],chainID,resnum))
        else:
            new=pKD_tools.get_newrestyp_from_mut(operation)
            old=pKD_tools.get_oldrestyp_from_mut(operation)
            chainID=operation.split(':')[0]
            resnum=pKD_tools.get_intresnum_from_res(operation)
            if len(chainID)!=0:
                chainID='(%s)' %chainID
            new_ops.append('%s%s%d%s' %(DNAtool.mutation.three_to_one[old],
                                        chainID,
                                        resnum,
                                        DNAtool.mutation.three_to_one[new]))
    return new_ops
def shortenOperations ( operations ) : new_ops = [ ] import DNAtool . mutation import pKa . pKD_tools as pKD_tools for operation in operations : if operation . find ( 'insert' ) != - 1 : text = operation . replace ( 'insert' , '' ) . split ( ':' ) insertnum = int ( text [ 0 ] ) resnum = '%s:%s' % ( text [ 1 ] , text [ 2 ] ) resnum = int ( pKD_tools . get_intresnum_from_res ( resnum ) ) chainID = text [ 1 ] if len ( chainID ) != 0 : chainID = '(%s)' % chainID insertchar = 'abcdefghijklmnopqrstuvw' new = text [ - 1 ] new_ops . append ( '*%s%d%s%s' % ( chainID , resnum , insertchar [ insertnum ] , DNAtool . mutation . three_to_one [ new ] ) ) elif operation . find ( 'delete:' ) != - 1 : text = operation . replace ( 'delete:' , '' ) restext = text . split ( ':' ) chainID = restext [ 0 ] if len ( chainID ) != 0 : chainID = '(%s)' % chainID resnum = int ( pKD_tools . get_intresnum_from_res ( text ) ) old = restext [ - 1 ] new_ops . append ( '%s%s%d*' % ( DNAtool . mutation . three_to_one [ old ] , chainID , resnum ) ) else : new = pKD_tools . get_newrestyp_from_mut ( operation ) old = pKD_tools . get_oldrestyp_from_mut ( operation ) chainID = operation . split ( ':' ) [ 0 ] resnum = pKD_tools . get_intresnum_from_res ( operation ) if len ( chainID ) != 0 : chainID = '(%s)' % chainID new_ops . append ( '%s%s%d%s' % ( DNAtool . mutation . three_to_one [ old ] , chainID , resnum , DNAtool . mutation . three_to_one [ new ] ) ) return new_ops
Provide the more conventional short form of the mutations
Provide the more conventional short form of the mutations
"""Provide the more conventional short form of the mutations"""
operations