How to use the pdb2pqr.propka30.Source.lib.pka_print function in pdb2pqr

To help you get started, we’ve selected a few pdb2pqr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Electrostatics / apbs-pdb2pqr / pdb2pqr / propka30 / Source / protonator.py View on Github external
def protonateBackBone(self, residue, C, O):
        """
        Protonates an atom, X1, given a direction (X2 -> X3) [X1, X2, X3]
        """
        N = residue.getAtom(name='N')

        if C == None and O == None:
            """ do nothing, first residue """
        elif N == None:
            pka_print("could not find N atom in '%s' (protonateBackBone())" % (residue.label))
            exit(9)
        elif residue.resName == "PRO":
            """ do nothing, proline doesn't have a proton """
        else:
            H = self.protonateDirection(atoms=[N, O, C])
            residue.atoms.append(H)

        return residue.getAtom(name='C'), residue.getAtom(name='O')
github Electrostatics / apbs-pdb2pqr / pdb2pqr / propka30 / Source / protonator.py View on Github external
for atom in residue.atoms:
                            if atom.name == 'N':
                                atom.charge = self.standard_charges['NTERM']
                                #pka_print('Charge', atom, atom.charge)

            # set c-terminal charges
            for chain in protein.chains:
                for residue in chain.residues:
                    if residue.resName.replace(' ', '') == 'C-':
                        for atom in residue.atoms:
                            if atom.name in self.my_bond_maker.terminal_oxygen_names:
                                atom.charge = self.standard_charges['CTERM']
                                #pka_print('Charge', atom, atom.charge)

        else:
            pka_print('Custom protonation state choosen - don\'t know what to do')

        return
github Electrostatics / apbs-pdb2pqr / pdb2pqr / propka30 / Source / protonator.py View on Github external
def set_bond_distance(self, a, element):
        d = 1.0
        if element in list(self.bond_lengths.keys()):
            d = self.bond_lengths[element]
        else:
            pka_print('WARNING: Bond length for %s not found, using the standard value of %f' % (element, d))

        a = a.rescale(d)

        return a
github Electrostatics / apbs-pdb2pqr / pdb2pqr / propka30 / Source / protonator.py View on Github external
def add_protons(self, atom):
        # decide which method to use
        # pka_print('PROTONATING',atom)
        if atom.steric_number in list(self.protonation_methods.keys()):
            self.protonation_methods[atom.steric_number](atom)
        else:
            pka_print('Warning: Do not have a method for protonating', atom, '(steric number: %d)' % atom.steric_number)

        return
github Electrostatics / apbs-pdb2pqr / pdb2pqr / propka30 / Source / calculator.py View on Github external
def radialVolumeDesolvation(residue, atoms, version, options=None):
    """
    calculates the desolvation according to the ScaledRadialVolumeModel
    """
    if residue.label == "BKB  50 A":
        pka_print("found %s [%6.3lf%6.3lf%6.3lf]!" % (residue.label, residue.x, residue.y, residue.z))
        pka_print("buried_cutoff_sqr = %s!" % (version.buried_cutoff_sqr))
        pka_print("desolv_cutoff_sqr = %s!" % (version.desolv_cutoff_sqr))
    scale_factor = 0.8527*1.36  # temporary weight for printing out contributions
    residue.Nlocl = 0
    residue.Nmass = 0
    residue.Elocl = 0.00
    dV = 0.00
    volume = 0.00
    min_distance_4th = pow(2.75, 4)
    for chainID in atoms.keys():
        for key in atoms[chainID]["keys"]:
            for atom in atoms[chainID][key]:
                if atom.element != "H":
                    if atom.resNumb != residue.resNumb or atom.chainID != residue.chainID:
                        # selecting atom type
                        if atom.name in ["C", "CA"]:
                            atomtype = "C"
github Electrostatics / apbs-pdb2pqr / pdb2pqr / propka30 / Source / coupled_residues.py View on Github external
tagged_pka_print(' Original|', residue2.getDeterminantString(), [residue1.label, residue2.label])

    # swap the interactions!
    transfer_determinant(residue1.determinants[2], residue2.determinants[2], residue1.label, residue2.label)
    if include_side_chain_hbs:
        transfer_determinant(residue1.determinants[0], residue2.determinants[0], residue1.label, residue2.label)

    # re-calculate pKa values
    residue1.calculateTotalPKA()
    residue2.calculateTotalPKA()

    if verbose:
        tagged_pka_print(' Swapped |', residue1.getDeterminantString(), [residue1.label, residue2.label])
        tagged_pka_print(' Swapped |', residue2.getDeterminantString(), [residue1.label, residue2.label])
        pka_print(' '+'='*113)
        pka_print('')
    return
github Electrostatics / apbs-pdb2pqr / pdb2pqr / propka30 / Source / coupled_residues.py View on Github external
""" Finds coupled residues in protein """

    verbose = options.display_coupled_residues

    if True:
        pka_print('')
        pka_print(' Detecting coupled residues')
        pka_print('   Maximum pKa difference:     %4.2f pKa units' % max_intrinsic_pKa_diff)
        pka_print('   Minimum interaction energy: %4.2f pKa units' % min_interaction_energy)
        pka_print('   Maximum free energy diff.:  %4.2f pKa units' % max_free_energy_diff)
        pka_print('   Minimum swap pKa shift:     %4.2f pKa units' % min_swap_pka_shift)
        pka_print('   pH:                         %6s ' % str(pH))
        pka_print('   Reference:                  %s' % reference)
        pka_print('   Min pKa:                    %4.2f' % min_pka)
        pka_print('   Max pKa:                    %4.2f' % max_pka)
        pka_print('')

    # make a single list of all residues in the protein
    all_residues = []
    for chain in protein.chains:
        for residue in chain.residues:
            if not residue in protein.residue_dictionary["ION"]:
                all_residues.append(residue)

    # find coupled residues
    for i in range(len(all_residues)):
        for j in range(len(all_residues)):
            if i == j:
                break
            swap = 0
            if do_intrinsic:
                (coupling_factor_intrinsic_pka, interaction_energy) = is_coupled_intrinsic_pka(all_residues[i], all_residues[j])