NetSci
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Atom Class Reference

Public Member Functions

 Atom ()
 Default constructor for Atom.
 
 Atom (const std::string &pdbLine)
 Constructor for Atom with PDB line.
 
 Atom (const std::string &pdbLine, int atomIndex)
 Constructor for Atom with PDB line and atom index.
 
int index () const
 Get the atom index.
 
std::string name ()
 Get the atom name.
 
std::string element ()
 Get the atom element.
 
std::string residueName ()
 Get the residue name.
 
int residueId () const
 Get the residue ID.
 
std::string chainId ()
 Get the chain ID.
 
std::string segmentId ()
 Get the segment ID.
 
float temperatureFactor () const
 Get the temperature factor.
 
float occupancy () const
 Get the occupancy.
 
int serial () const
 Get the serial number.
 
std::string tag ()
 Get the atom tag.
 
float mass () const
 Get the mass of the atom.
 
unsigned int hash () const
 Get the hash of the atom.
 
float x (CuArray< float > *coordinates, int frame, int numFrames) const
 Get the x-coordinate of the atom.
 
float y (CuArray< float > *coordinates, int frame, int numFrames) const
 Get the y-coordinate of the atom.
 
float z (CuArray< float > *coordinates, int frame, int numFrames) const
 Get the z-coordinate of the atom.
 
void load (const std::string &jsonFile)
 Load atom information from a JSON file.
 

Private Attributes

int _index
 
std::string _name
 
std::string _element
 
std::string _residueName
 
int _residueId
 
std::string _chainId
 
std::string _segmentId
 
float _temperatureFactor
 
float _occupancy
 
int _serial
 
std::string _tag
 
float _mass
 
unsigned int _hash
 

Constructor & Destructor Documentation

◆ Atom() [1/3]

Atom::Atom ( )

Default constructor for Atom.

Constructs an empty Atom object.

◆ Atom() [2/3]

Atom::Atom ( const std::string &  pdbLine)
explicit

Constructor for Atom with PDB line.

Constructs an Atom object using the provided PDB line. The constructor parses the PDB line to extract the relevant atom information, such as index, name, element, residue name, residue ID, chain ID, segment ID, temperature factor, occupancy, serial number, atom tag, mass, and hash.

The PDB line should follow the standard PDB format for ATOM records as described in Section 9 of the PDB file format documentation:

See also
https://www.wwpdb.org/documentation/file-format-content/format33/sect9.html#ATOM
Parameters
pdbLineThe PDB line containing atom information in the standard PDB format.

◆ Atom() [3/3]

Atom::Atom ( const std::string &  pdbLine,
int  atomIndex 
)

Constructor for Atom with PDB line and atom index.

Constructs an Atom object using the provided PDB line and atom index.

Parameters
pdbLineThe PDB line containing atom information.
atomIndexThe atom index.

Member Function Documentation

◆ chainId()

std::string Atom::chainId ( )

Get the chain ID.

Returns the chain ID.

Returns
The chain ID.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom chainId method to get the chain ID of the atom.
"""
print(atom.chainId())
Definition network.h:12

◆ element()

std::string Atom::element ( )

Get the atom element.

Returns the atom element.

Returns
The atom element.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom element method to get the atom's element symbol.
"""
print(atom.element())

◆ hash()

unsigned int Atom::hash ( ) const

Get the hash of the atom.

Returns the hash of the atom, which is calculated from the atom tag concatenated with the atom index.

Returns
The hash of the atom.

◆ index()

int Atom::index ( ) const

Get the atom index.

Returns the atom index.

Returns
The atom index.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom index method to get the atom's index.
"""
print(atom.index())

◆ load()

void Atom::load ( const std::string &  jsonFile)

Load atom information from a JSON file.

Loads atom information from the specified JSON file.

Parameters
jsonFileThe name of the JSON file to load.

◆ mass()

float Atom::mass ( ) const

Get the mass of the atom.

Returns the mass of the atom.

Returns
The mass of the atom.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom mass method to get the atom's mass.
"""
print(atom.mass())

◆ name()

std::string Atom::name ( )

Get the atom name.

Returns the atom name.

Returns
The atom name.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom name method to get the PDB name of the atom.
"""
print(atom.name())

◆ occupancy()

float Atom::occupancy ( ) const

Get the occupancy.

Returns the occupancy.

Returns
The occupancy.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom occupancy method to get the atom's occupancy number.
"""
print(atom.occupancy())

◆ residueId()

int Atom::residueId ( ) const

Get the residue ID.

Returns the residue ID.

Returns
The residue ID.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom residueId method to get the residue ID that the atom belongs to.
"""
print(atom.residueId())

◆ residueName()

std::string Atom::residueName ( )

Get the residue name.

Returns the residue name.

Returns
The residue name.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom residueName method to get the name of the residue that the atom belongs to.
"""
print(atom.residueName())

◆ segmentId()

std::string Atom::segmentId ( )

Get the segment ID.

Returns the segment ID.

Returns
The segment ID.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom segmentId method to get the ID of the segment that the atom belongs to.
"""
print(atom.segmentId())

◆ serial()

int Atom::serial ( ) const

Get the serial number.

Returns the serial number, which is one greater than the atom index.

Returns
The serial number.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom serial method to get the atom's serial number, which is 1 greater than the atom's index.
"""
print(atom.serial())

◆ tag()

std::string Atom::tag ( )

Get the atom tag.

Returns the atom tag, which is the concatenation of the residue name, residue ID, chain ID, and segment ID.

Returns
The atom tag.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom tag method to get the atom's node identifier tag, which is used to determine which
node the atom belongs to. The tag is a concatenation of the atom's residue name, residue id,
chain id, and segment id.
"""
print(atom.residueId())

◆ temperatureFactor()

float Atom::temperatureFactor ( ) const

Get the temperature factor.

Returns the temperature factor.

Returns
The temperature factor.

Python Example

from netchem import Network, data_files
"""
1000 frame Molecular Dynamics trajectory of a pyrophosphatase system.
The dcd is a binary coordinate file, and the pdb is a single frame
topology file.
"""
dcd, pdb = data_files('pyro')
"""
Construct a network using the entire trajectory.
If you want to use only a subset of the trajectory, you can specify
the first frame, last frame, and stride.
"""
network = Network()
network.init(
trajectoryFile=str(dcd), # Convert the dcd Path object to a string
topologyFile=str(pdb), # Convert the pdb Path object to a string
firstFrame=0,
lastFrame=999,
stride=1
)
"""
We will use the first atom in the first node for this example.
"""
atom = network.nodes()[0].atoms()[0]
"""
Use the Atom temperatureFactor method to get the atom's temperature factor.
"""
print(atom.temperatureFactor())

◆ x()

float Atom::x ( CuArray< float > *  coordinates,
int  frame,
int  numFrames 
) const

Get the x-coordinate of the atom.

Returns the x-coordinate of the atom at the specified frame.

Parameters
coordinatesThe CuArray containing the coordinates.
frameThe frame index.
numFramesThe total number of frames.
Returns
The x-coordinate of the atom.

◆ y()

float Atom::y ( CuArray< float > *  coordinates,
int  frame,
int  numFrames 
) const

Get the y-coordinate of the atom.

Returns the y-coordinate of the atom at the specified frame.

Parameters
coordinatesThe CuArray containing the coordinates.
frameThe frame index.
numFramesThe total number of frames.
Returns
The y-coordinate of the atom.

◆ z()

float Atom::z ( CuArray< float > *  coordinates,
int  frame,
int  numFrames 
) const

Get the z-coordinate of the atom.

Returns the z-coordinate of the atom at the specified frame.

Parameters
coordinatesThe CuArray containing the coordinates.
frameThe frame index.
numFramesThe total number of frames.
Returns
The z-coordinate of the atom.

The documentation for this class was generated from the following file: