PDBNucleicAcids package

Submodules

PDBNucleicAcids.BasePairRules module

Classes with rules for proper base pairing.

class PDBNucleicAcids.BasePairRules.BasePairRules[source]

Bases: object

Base class for base-pairing rules.

It contains only methods in common to most pairing rules, but doesn’t contain any parameter.

angle_between_bases(base1: Residue, base2: Residue) float | None[source]

Compute angle between between planes of two bases.

atom_from_central_hbond(base) Atom | None[source]

Get central H-bond atom of a base.

atoms_from_base_ring(base: Residue) tuple[Atom] | None[source]

Get atoms from the ring of a base.

distance(base1, base2) float | None[source]

Compute distance between central H-bond atoms of two bases.

is_candidate(base1: Residue, base2: Residue) bool[source]

Check if (base1, base2) is a likely base pair.

Use all the constraint methods to infer if base2 is likely to be paired with base1.

is_complementary(base1: Residue, base2: Residue) bool[source]

Check if two bases are complementary.

is_different_residue(base1: Residue, base2: Residue) bool[source]

Check if two bases are distinct bases.

is_from_different_chain(base1: Residue, base2: Residue) bool[source]

Check if two bases are from distinct chains.

is_valid_angle(base1: Residue, base2: Residue) bool[source]

Check validity of angle between between planes of the bases.

is_valid_distance(base1: Residue, base2: Residue) bool[source]

Check validity of distance between central two bases.

is_valid_stagger(base1: Residue, base2: Residue) bool[source]

Check validity of stagger between between planes of the bases.

stagger(base1: Residue, base2: Residue) float | None[source]

Compute vertical stagger between between planes of two bases.

class PDBNucleicAcids.BasePairRules.WatsonCrickBasePairRules(max_distance: float | int = 4, max_angle: float | int = 65, max_stagger: float | int = 2.5)[source]

Bases: BasePairRules

Rules for Watson-Crick base pairs for both RNA and DNA.

Parameters

max_distancefloat | int, optional

Maximum distance between nucleotide bases, in Armstrong. The default is 3.5.

max_anglefloat | int, optional

Maximum angle between the planes of the bases, in degrees. The default is 65.

max_staggerfloat | int, optional

Maximum vertical distance between the planes of the bases, in degrees. The default is 2.5.

atoms_from_base_ring(base: Residue) tuple[Atom] | None[source]

Get atoms from the ring of a base.

class PDBNucleicAcids.BasePairRules.dsDNAWatsonCrickBasePairRules(max_distance: float | int = 4, max_angle: float | int = 65, max_stagger: float | int = 2.5)[source]

Bases: WatsonCrickBasePairRules

Rules for Watson-Crick base pairs in double-strand DNA.

Parameters

max_distancefloat | int, optional

Maximum distance between nucleotide bases, in Armstrong. The default is 4.

max_anglefloat | int, optional

Maximum angle between the planes of the bases, in degrees. The default is 65.

max_staggerfloat | int, optional

Maximum vertical distance between the planes of the bases, in degrees. The default is 2.5.

PDBNucleicAcids.Geometry module

Functions that address atom geometry.

PDBNucleicAcids.Geometry.angle_between_planes(plane1, plane2) float64[source]

Compute angle between two planes, composed of three 3D points each.

PDBNucleicAcids.Geometry.angle_between_vectors(v1, v2) float64[source]

Compute angle between two vectors.

PDBNucleicAcids.Geometry.calculate_normal_vector(v1, v2, v3) float64[source]

Compute normal vector from three 3D points.

PDBNucleicAcids.Geometry.plane_separation(plane1, plane2) float64[source]

Calcola la distanza verticale tra due piani.

PDBNucleicAcids.MMCIF2DataFrame module

PDBNucleicAcids.NucleicAcid module

Nucleic Acids related classes and functions.

class PDBNucleicAcids.NucleicAcid.BasePair(i_res: Residue, j_res: Residue, pairing_rules)[source]

Bases: object

Pair of nucleotides.

check_validity(pairing_rules=None)[source]

Check for validity for base pair, using input rules.

get_atoms()[source]

Return atoms in the nucleic acid.

get_i_res()[source]

Return i-th nucleotide.

get_j_res()[source]

Return j-th nucleotide.

get_stagger(pairing_rules=None)[source]

Return stagger value from base pair.

class PDBNucleicAcids.NucleicAcid.DSNABuilder(radius: float | int = 1.9)[source]

Bases: object

Base class to extract double-stranded nucleic acids.

This assumes you want both standard and non-standard amino acids.

build_double_strands(entity: ~Bio.PDB.Structure.Structure | ~Bio.PDB.Model.Model | ~Bio.PDB.Chain.Chain, pairing_rules=<PDBNucleicAcids.BasePairRules.WatsonCrickBasePairRules object>) list[DoubleStrandNucleicAcid][source]

Build and return a list of DoubleStrandNucleicAcid objects.

Parameters

entityL{Structure}, L{Model} or L{Chain}

Double-stranded nucleic acids are searched for in this object.

pairing_rulesoptional

Class instance with rules for proper pairing. PDBNucleicAcids.BasePairsRules.WatsonCrickBasePairRules is the default.

Returns

all_dsna_listlist[DoubleStrandNucleicAcid]

list if all DoubleStrandNucleicAcid found in the input entity.

class PDBNucleicAcids.NucleicAcid.DoubleStrandNucleicAcid(iterable=(), /)[source]

Bases: list

List of BasePairs.

get_atoms() list[Atom][source]

Return atoms in the double stranded nucleic acid.

get_dataframe() DataFrame[source]

Return dataframe with base pairs data.

Returns

pandas.DataFrame

Dataframe with base pairs data in the structure.

get_i_strand() NucleicAcid[source]

Get i-th strand as NucleicAcid object.

get_j_strand() NucleicAcid[source]

Get j-th strand as NucleicAcid objects.

get_na_complex_type() str[source]

Return nucleic acid complex type.

i.e. DNA/DNA, DNA/RNA, etc

get_stagger_values()[source]

Get stagger value for every base pair.

class PDBNucleicAcids.NucleicAcid.NABuilder(radius: float | int = 1.9)[source]

Bases: _NABuilder

Use P–O3’ distance to find connected nucletides.

class PDBNucleicAcids.NucleicAcid.NucleicAcid(iterable=(), /)[source]

Bases: list

A nucleic acid is simply a list of nucleic L{Residue} objects.

get_atoms()[source]

Return atoms in the nucleic acid.

get_chain_id()[source]

Return chain id of the nucleic acid.

get_na_type() str[source]

Return type of nucleic acid: DNA or RNA.

get_seq() Seq[source]

Return the nucleotide sequence as a Seq object.

Returns

Bio.Seq.Seq

Sequence of nucleotides in a continous strand.

PDBNucleicAcids.NucleicAcid.search_paired_base(residue: ~Bio.PDB.Residue.Residue, pairing_rules=<PDBNucleicAcids.BasePairRules.WatsonCrickBasePairRules object>, nucleic_chain_ids: list[str] | None = None, nucleic_atoms: list[~Bio.PDB.Atom.Atom] | None = None) Residue | None[source]

Search in the vicinity of a given base for its paired base.

Parameters

residueBio.PDB.Residue.Residue

A Biopython nucleic acid residue (nucleotide) taken from a Biopython structure.

pairing_rulesoptional

Class instance with rules for proper pairing. PDBNucleicAcids.BasePairsRules.WatsonCrickBasePairRules is the default.

nucleic_chain_idslist[str], optional

List of ids for nucleic acid chains. If None they will be inferred using NABuilder class. Default is None.

nucleic_atomslist[Atom], optional

List of atoms from the nucleic acid chains. If None they will be inferred using nucleic_chain_ids parameter. Default is None.

Returns

Bio.PDB.Residue.Residue | None

Nucleotide that binds to the input nucleotide residue. None in the case there is no nucleotide paired to the input nucleotide.

PDBNucleicAcids.utils module

Module contents

Top-level package for basepairparser.