X3dna

class rnamake.x3dna.Basepair(res1, res2, r, d)[source]

Bases: object

Container for basepairs from ref_frames and dssr files produced by x3dna. Should not be instantiated outside x3dna.X3dna class.

Attributes:
res1 : Residue
first residue in basepair
res2 : Residue
second residue in basepair
r : np.array
rotation matrix describing principle axies of orientation of basepair
d : np.array
center point of basepair
bp_type: str
x3dna dssr basepair type, see x3dna for more details
class rnamake.x3dna.Motif(residues, mtype)[source]

Bases: object

Container for motif residues from dssr files produceed by x3dna. Should not be instantiated outside x3dna.X3dna class.

Attributes:
residues : list of Residue objects
residues that belong to same motif
mtype: motif_type enum
the enum type of the given motif
class rnamake.x3dna.Residue(num, chain_id, i_code='')[source]

Bases: object

Container for residues from ref_frames and dssr files produced by x3dna. Should not be instantiated outside x3dna.X3dna class.

Attributes:
num : int
residue number
chain_id : str
residue chain id
i_code : str
residue insertion code
class rnamake.x3dna.X3dna[source]

Bases: object

a simple wrapper for interfacing with the x3dna package for determining the basepairing in a pdb structure. Please support the author of x3dna directory and cite his work and register on his site: http://x3dna.org/

Data is returned as a list of X3DNA basepair objects which are simplistic containers for storing which residues are contained in a basepair and what the reference frame and type of the basepair is. These are different from basepair.Basepair objects which store the actual atomic information of a basepair

>>> from rnamake.unittests import files
>>> from rnamake import x3dna
>>> x = x3dna.X3dna()
>>> basepairs = x.get_basepairs(files.P4P6_PDB_PATH)
>>> len(basepairs)
79

>>> basepairs[10]
<X3DNA Basepair(A131 A192 cW-W)>
generate_dssr_file(pdb_path)[source]

runs x3dna’s dssr which assigns the secondary structure and each of the motifs in a RNA structure

Parameters:pdb_name (str) – the pdb you want to run without the .pdb extension
generate_ref_frame(pdb_path)[source]

runs x3dna/find_pair and x3dna/analyze to get the basepairing information of a given pdb and it is updated to a ref_frames.dat file which can be parsed by get_basepair_info if necessary

Parameters:pdb_path (str) – the pdb you want to run without the .pdb extension
# after running should be a "ref_frames.dat" in current dir
>>> from rnamake import x3dna
>>> x = x3dna.X3dna()
>>> x.generate_ref_frame("test.pdb")
get_basepairs(pdb_path)[source]

generates and/or collects the information from the ref_frame.dat file and dssr output file to determine the basepairing between residues and what type each basepair is. Returns a list of basepair X3DNA objects.

Parameters:pdb_path (str) – path to the pdb file