Skip to content

Latest commit

 

History

History
96 lines (63 loc) · 2.03 KB

example.rst

File metadata and controls

96 lines (63 loc) · 2.03 KB

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.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.

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)