pKa/pKD_tools.py
def convert_classic_to_PEAT(operations):
    """Convert a set of classic mutations to a set of PEAT operations
    The classic operations are in the format: A12G+R45V etc."""
    #
    # Do a quick sanity check
    #
    for junk in ['?','unknown','empty']:
        if operations.lower().find(junk)!=-1:
            return False
    #
    # Deal with the operations
    #
    sp=operations.split('+')
    import Protool, string
    P=Protool.structureIO()
    POP=[]
    for op in sp:
        if op=='wt':
            continue
        old=op[0]
        new=op[-1]
        number=int(op[1:-1])
        try:
            POP.append('%s:%s:%s:%s' %('',string.zfill(number,P.length_of_residue_numbers),P.one_to_three[old],P.one_to_three[new]))
        except KeyError:
            return False
    return string.join(POP,'+')
Convert a set of classic mutations to a set of PEAT operations
    The classic operations are in the format: A12G+R45V etc.
Convert a set of classic mutations to a set of PEAT operations
The classic operations are in the format: A12G+R45V etc.
Convert a set of classic mutations to a set of PEAT operations The classic operations are in the format : A12G + R45V etc .
def convert_classic_to_PEAT(operations):
     Do a quick sanity check
    for junk in ['?','unknown','empty']:
        if operations.lower().find(junk)!=-1:
            return False
     Deal with the operations
    sp=operations.split('+')
    import Protool, string
    P=Protool.structureIO()
    POP=[]
    for op in sp:
        if op=='wt':
            continue
        old=op[0]
        new=op[-1]
        number=int(op[1:-1])
        try:
            POP.append('%s:%s:%s:%s' %('',string.zfill(number,P.length_of_residue_numbers),P.one_to_three[old],P.one_to_three[new]))
        except KeyError:
            return False
    return string.join(POP,'+')
def convert_classic_to_PEAT ( operations ) : for junk in [ '?' , 'unknown' , 'empty' ] : if operations . lower ( ) . find ( junk ) != - 1 : return False sp = operations . split ( '+' ) import Protool , string P = Protool . structureIO ( ) POP = [ ] for op in sp : if op == 'wt' : continue old = op [ 0 ] new = op [ - 1 ] number = int ( op [ 1 : - 1 ] ) try : POP . append ( '%s:%s:%s:%s' % ( '' , string . zfill ( number , P . length_of_residue_numbers ) , P . one_to_three [ old ] , P . one_to_three [ new ] ) ) except KeyError : return False return string . join ( POP , '+' )
Convert a set of classic mutations to a set of PEAT operations
The classic operations are in the format: A12G+R45V etc.
Convert a set of classic mutations to a set of PEAT operations The classic operations are in the format : A12G + R45V etc .
"""Convert a set of classic mutations to a set of PEAT operations
    The classic operations are in the format: A12G+R45V etc.""" # # Do a quick sanity check # # # Deal with the operations #
operations