nanoPDB
UnitCell - a class that represents a unit cell of a PDB structure.
Atom - a class that represents an atom of a PDB structure.
Residue - a class that represents a residue of a PDB structure.
Returns a list of atoms that builds the residue.
Returns
list[Atom]
:
The list of atoms that builds the residue.
Examples
Retrieving the list of atoms that builds the residue.
>>> parser = Parser()
>>> structure = parser.fetch("1zhy")
>>> residue = structure[0][0]
...
>>> residue.get_atoms()
[Atom {
label: "ATOM",
number: 1,
name: "N",
element: "N",
position: (
42.854,
36.56,
10.394,
),
occupancy: 1.0,
}, Atom {
label: "ATOM",
number: 2,
name: "CA",
element: "C",
position: (
42.25,
35.232,
10.096,
),
occupancy: 1.0,
}, Atom {
label: "ATOM",
number: 3,
name: "C",
element: "C",
position: (
41.642,
34.623,
11.355,
),
occupancy: 1.0,
}
...
Chain - a class that represents a chain of a PDB structure.
Returns a list of atoms that builds the chain.
Returns
list[Atom]
The list of atoms that build the chain.
Examples
Retrieving the list of atoms that builds the chain.
>>> parser = Parser()
>>> structure = parser.fetch("1zhy")
>>> chain = structure[0]
...
>>> chain.get_atoms()
[Atom {
label: "ATOM",
number: 1,
name: "N",
element: "N",
position: (
42.854,
36.56,
10.394,
),
occupancy: 1.0,
}, Atom {
label: "ATOM",
number: 2,
name: "CA",
element: "C",
position: (
42.25,
35.232,
10.096,
),
occupancy: 1.0,
}, Atom {
label: "ATOM",
number: 3,
name: "C",
element: "C",
position: (
41.642,
34.623,
11.355,
),
occupancy: 1.0,
}
...
Returns the list of residues that builds the chain.
Returns
list[Residue]
The list of residues that builds the chain.
Examples
Retrieving the list of residues that builds the residue.
>>> parser = Parser()
>>> structure = parser.fetch("1zhy")
>>> chain = structure[0]
...
>>> chain.get_residues()
[Residue {
number: -1,
name: "MET",
}, Residue {
number: 0,
name: "ASP",
}, Residue {
number: 1,
name: "PRO",
}
...
Structure - a class that represents a PDB structure.
Returns a list of atoms that builds the structure.
Returns
list[Atom]
The list of atoms that build the structure.
Examples
Retrieving the list of atoms that builds the structure.
>>> parser = Parser()
>>> structure = parser.fetch("1zhy")
...
>>> structure.get_atoms()
[Atom {
label: "ATOM",
number: 1,
name: "N",
element: "N",
position: (
42.854,
36.56,
10.394,
),
occupancy: 1.0,
}, Atom {
label: "ATOM",
number: 2,
name: "CA",
element: "C",
position: (
42.25,
35.232,
10.096,
),
occupancy: 1.0,
}, Atom {
label: "ATOM",
number: 3,
name: "C",
element: "C",
position: (
41.642,
34.623,
11.355,
),
occupancy: 1.0,
}
...
Returns the list of chains that builds the chain.
Returns
list[Chain]
The list of chains that builds the structure.
Examples
Retrieving the list of chains that builds the structure.
>>> parser = Parser()
>>> structure = parser.fetch("1zhy")
...
>>> structure.get_chains()
[Chain {
name: 'A',
}]
Returns the list of residues that builds the structure.
Returns
list[Residue]
The list of residues that builds the structure.
Examples
Retrieving the list of residues that builds the structure.
>>> parser = Parser()
>>> structure = parser.fetch("1zhy")
...
>>> structure.get_residues()
[Residue {
number: -1,
name: "MET",
}, Residue {
number: 0,
name: "ASP",
}, Residue {
number: 1,
name: "PRO",
}
...
Parser - a class for parsing structures in PDB format.
Fetches structure from RCSB PDB database, parses it and returns Structure object.
Parameters
pdbid
: str
PDB ID of structure from RCSB PDB.
Returns
Structure
Parsed structure.
Examples
Fetching structure from RCSB PDB database.
>>> parser = Parser()
>>> structure = parser.fetch("1zhy")
...
>>> structure
Structure {
pdbid: "1ZHY",
classification: "LIPID BINDING PROTEIN",
date: "26-APR-05",
}
Parses PDB file and returns the Structure object.
Parameters
path
: str
The path to the PDB file.
Returns
Structure
Parsed structure.
Examples
Loading structure from file.
>>> parser = Parser()
>>> structure = parser.parse("tests/1zhy.pdb")
...
>>> structure
Structure {
pdbid: "1ZHY",
classification: "LIPID BINDING PROTEIN",
date: "26-APR-05",
}