pKarun/WI_tools.py
def relative_accessibility(pdbfile):
    """
    # This option runs DELLIG, INIACC, SETACC and VACACC
    """
    import os
    pdbfile=os.path.join(os.getcwd(),pdbfile)
    pdb=os.path.split(pdbfile)[1]
    command='getmol '+pdb+' \n X \n dellig \nset1 \n access \n setacc \n tot 0\n \n vacacc \n N \n tot \n'
    logfile=RunWI(command,None,None,[pdbfile])
    x=0
    resdict={}
    section_found=False
    while 1:
        sline=string.strip(logfile[x])
        if sline.find('vacacc')!=-1:
            section_found=True
        if not section_found:
            x=x+1
            continue
        if len(string.split(sline))>0:
            if string.split(sline)[0]=='Residue:':
                sline=string.replace(sline,'(',' ')
                sline=string.replace(sline,')',' ')
                split=string.split(sline)
                if split[3]=='OXT' or split=='O2':
                    break
                import pKarun.pKa_utility_functions
                residue=pKarun.pKa_utility_functions.getWI_resid3(sline)
                type=split[2]
                resdict[residue]={}
                while 1:
                    x=x+1
                    sline=string.strip(logfile[x])
                    split=string.split(sline)
                    if split[0][0] in string.letters and split[0][:3]!='Phi' and split[0][:4]!='Atom':
                        #
                        # The line below is a mess, it should be rewritten
                        # in a more sensible way to prevent character overflows
                        # in WHAT IF output to break it
                        #
                        resdict[residue][split[0]]={'rel':string.atof(string.split(sline)[-1]),'vac':string.atof(string.split(sline)[-2]),'prot':string.atof(string.split(sline)[4][:4]),'type':type}
                    if len(split)==3 and split[0][0] not in string.letters:
                        resdict[residue]['sum']={'rel':string.atof(string.split(sline)[2]),'vac':string.atof(string.split(sline)[1]),'prot':string.atof(string.split(sline)[0]),'type':type}
                        break
        x=x+1
        if x==len(logfile):
            break
    return resdict

    # This option runs DELLIG, INIACC, SETACC and VACACC
    
This option runs DELLIG, INIACC, SETACC and VACACC
This option runs DELLIG INIACC SETACC and VACACC
def relative_accessibility(pdbfile):
    import os
    pdbfile=os.path.join(os.getcwd(),pdbfile)
    pdb=os.path.split(pdbfile)[1]
    command='getmol '+pdb+' \n X \n dellig \nset1 \n access \n setacc \n tot 0\n \n vacacc \n N \n tot \n'
    logfile=RunWI(command,None,None,[pdbfile])
    x=0
    resdict={}
    section_found=False
    while 1:
        sline=string.strip(logfile[x])
        if sline.find('vacacc')!=-1:
            section_found=True
        if not section_found:
            x=x+1
            continue
        if len(string.split(sline))>0:
            if string.split(sline)[0]=='Residue:':
                sline=string.replace(sline,'(',' ')
                sline=string.replace(sline,')',' ')
                split=string.split(sline)
                if split[3]=='OXT' or split=='O2':
                    break
                import pKarun.pKa_utility_functions
                residue=pKarun.pKa_utility_functions.getWI_resid3(sline)
                type=split[2]
                resdict[residue]={}
                while 1:
                    x=x+1
                    sline=string.strip(logfile[x])
                    split=string.split(sline)
                    if split[0][0] in string.letters and split[0][:3]!='Phi' and split[0][:4]!='Atom':
                         The line below is a mess, it should be rewritten
                         in a more sensible way to prevent character overflows
                         in WHAT IF output to break it
                        resdict[residue][split[0]]={'rel':string.atof(string.split(sline)[-1]),'vac':string.atof(string.split(sline)[-2]),'prot':string.atof(string.split(sline)[4][:4]),'type':type}
                    if len(split)==3 and split[0][0] not in string.letters:
                        resdict[residue]['sum']={'rel':string.atof(string.split(sline)[2]),'vac':string.atof(string.split(sline)[1]),'prot':string.atof(string.split(sline)[0]),'type':type}
                        break
        x=x+1
        if x==len(logfile):
            break
    return resdict
def relative_accessibility ( pdbfile ) : import os pdbfile = os . path . join ( os . getcwd ( ) , pdbfile ) pdb = os . path . split ( pdbfile ) [ 1 ] command = 'getmol ' + pdb + ' \n X \n dellig \nset1 \n access \n setacc \n tot 0\n \n vacacc \n N \n tot \n' logfile = RunWI ( command , None , None , [ pdbfile ] ) x = 0 resdict = { } section_found = False while 1 : sline = string . strip ( logfile [ x ] ) if sline . find ( 'vacacc' ) != - 1 : section_found = True if not section_found : x = x + 1 continue if len ( string . split ( sline ) ) > 0 : if string . split ( sline ) [ 0 ] == 'Residue:' : sline = string . replace ( sline , '(' , ' ' ) sline = string . replace ( sline , ')' , ' ' ) split = string . split ( sline ) if split [ 3 ] == 'OXT' or split == 'O2' : break import pKarun . pKa_utility_functions residue = pKarun . pKa_utility_functions . getWI_resid3 ( sline ) type = split [ 2 ] resdict [ residue ] = { } while 1 : x = x + 1 sline = string . strip ( logfile [ x ] ) split = string . split ( sline ) if split [ 0 ] [ 0 ] in string . letters and split [ 0 ] [ : 3 ] != 'Phi' and split [ 0 ] [ : 4 ] != 'Atom' : resdict [ residue ] [ split [ 0 ] ] = { 'rel' : string . atof ( string . split ( sline ) [ - 1 ] ) , 'vac' : string . atof ( string . split ( sline ) [ - 2 ] ) , 'prot' : string . atof ( string . split ( sline ) [ 4 ] [ : 4 ] ) , 'type' : type } if len ( split ) == 3 and split [ 0 ] [ 0 ] not in string . letters : resdict [ residue ] [ 'sum' ] = { 'rel' : string . atof ( string . split ( sline ) [ 2 ] ) , 'vac' : string . atof ( string . split ( sline ) [ 1 ] ) , 'prot' : string . atof ( string . split ( sline ) [ 0 ] ) , 'type' : type } break x = x + 1 if x == len ( logfile ) : break return resdict
This option runs DELLIG, INIACC, SETACC and VACACC
This option runs DELLIG INIACC SETACC and VACACC
"""
    # This option runs DELLIG, INIACC, SETACC and VACACC
    """ # # The line below is a mess, it should be rewritten # in a more sensible way to prevent character overflows # in WHAT IF output to break it #
pdbfile