Basic Example

API

A simple example of how to use Pypka as an API is provided below. In this snippet we are estimating the pKa values for all titrable sites in the 4lzt.pdb structure downloaded from the Protein Data Bank.

from pypka import Titration

params = {
 'structure'     : '4lzt.pdb',
 'ncpus'         : -1,
 'epsin'         : 15,
 'ionicstr'      : 0.1,
 'pbc_dimensions': 0
 #Set the ffinput when using PDB files from simulations
 #'ffinput': 'GROMOS' # options: GROMOS, AMBER, CHARMM
}

tit = Titration(params)

pH = 7.0
for site in tit:
    state = site.getProtState(pH)[0]
    print(site.res_name, site.res_number, site.pK, state)

You may also try it out on a online notebook.

CLI

The same calculation can be done via CLI by resorting to a input parameter file.

parameter.dat
structure       = 4lzt.pdb
epsin           = 15
ionicstr        = 0.1
pbc_dimensions  = 0
ncpus           = -1
sites           = all
#Set the ffinput when using PDB files from simulations
#Options: GROMOS, AMBER, CHARMM

To execute pypka simply type one of the two:

pypka parameters.dat
python3 -m pypka parameters.dat

Mandatory Parameters

structure
Type

str

the PDB filename

epsin
Type

float

internal dielectric to be used in the PB calculations.

ionicstr
Type

float

ionic strength of the medium

pbc_dimensions
Type

int

number of dimensions with periodic boundaries. 0 for solvated proteins and 2 for lipidic systems

ncpus
Type

int

number of CPUs to use in the calculations (-1 to use all available)