PDBNucleicAcids package¶
Submodules¶
PDBNucleicAcids.BasePairRules module¶
Classes with rules for proper base pairing.
- class PDBNucleicAcids.BasePairRules.dsDNAWatsonCrickBasePairRules(max_distance: float | int = 4, max_angle: float | int = 65, max_stagger: float | int = 2.5)[source]¶
Bases:
objectRules for Watson-Crick base pairs in double-strand 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 65.
- angle_between_bases(base1: Residue, base2: Residue) float | None[source]¶
Compute angle between between planes of two bases.
- 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.
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.MMCIF2DataFrame module¶
Extract basepair data from the NDB/NAKB Data Category in mmCif files.
- PDBNucleicAcids.MMCIF2DataFrame.basepair_dataframe_from_mmcif(mmcif_filepath: str | Path) DataFrame | None[source]¶
Return dataframe with base pairs data from a mmCif file.
Note: not all mmCif files contain Data Category “ndb_struct_na_base_pair”
Parameters¶
- mmcif_filepathstr | Path
mmCif filepath.
Returns¶
- pandas.DataFrame | None
Dataframe with base pairs data in the structure.
- PDBNucleicAcids.MMCIF2DataFrame.polymer_dataframe_from_mmcif(mmcif_filepath: str | Path) DataFrame | None[source]¶
Dataframe with polymer data from a mmCif file.
Parameters¶
- mmcif_filepathstr | Path
mmCif filepath.
Returns¶
- pandas.DataFrame | None
Dataframe with information about each polymer in the structure.
PDBNucleicAcids.NucleicAcid module¶
Nucleic Acids related classes and functions.
- class PDBNucleicAcids.NucleicAcid.BasePair(i_res: Residue, j_res: Residue, pairing_rules)[source]¶
Bases:
objectPair of nucleotides.
- class PDBNucleicAcids.NucleicAcid.DSNABuilder(radius: float | int = 1.8)[source]¶
Bases:
objectBase 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=<class 'PDBNucleicAcids.BasePairRules.dsDNAWatsonCrickBasePairRules'>) 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.dsWatsonCrickBasePairsRules is the default. Currently it might work only with those rules.
Returns¶
- all_dsna_listlist[DoubleStrandNucleicAcid]
list if all DoubleStrandNucleicAcid found in the input entity.
- class PDBNucleicAcids.NucleicAcid.DoubleStrandNucleicAcid(iterable=(), /)[source]¶
Bases:
listList of BasePairs.
- 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.
- class PDBNucleicAcids.NucleicAcid.NABuilder(radius: float | int = 1.8)[source]¶
Bases:
_NABuilderUse P–O3’ distance to find connected nucletides.
- class PDBNucleicAcids.NucleicAcid.NucleicAcid(iterable=(), /)[source]¶
Bases:
listA nucleic acid is simply a list of nucleic L{Residue} objects.
- PDBNucleicAcids.NucleicAcid.search_paired_base(residue: ~Bio.PDB.Residue.Residue, nucleic_chain_ids: list[str] | None = None, nucleic_atoms: list[~Bio.PDB.Atom.Atom] | None = None, pairing_rules=<class 'PDBNucleicAcids.BasePairRules.dsDNAWatsonCrickBasePairRules'>) 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.
- nucleic_chain_idslist[str], optional
List of ids for nucleic acid chains. If None they will be inferred using polymer_dataframe_from_structure(). 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(). Default is None.
- pairing_rulesoptional
Class instance with rules for proper pairing. PDBNucleicAcids.BasePairsRules.dsWatsonCrickBasePairsRules is the default. Currently it might work only with those rules
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¶
Utils.
- PDBNucleicAcids.utils.get_paired_segments(df: DataFrame) list[int][source]¶
Get paired segments indexes.
A - T 0 T - A 0 A - T 0 C C -> -> [0, 0, 0, 1, 1, 1] T A C - G 1 G - C 1 T - A 1
Parameters¶
- dfpd.DataFrame
Dataframe with basepairs data.
Returns¶
- list[int]
An array of integers of the same length of the input dataframe. Integers identify the uninterrupted segments of basepairs.
Module contents¶
Top-level package for basepairparser.