module Chem::AtomCollection
Direct including types
- Chem::AtomView
- Chem::Chain
- Chem::ChainView
- Chem::Residue
- Chem::ResidueView
- Chem::Structure
- Chem::Topology
Defined in:
chem/core/atom_collection.crchem/register_format.cr
Instance Method Summary
- #atoms : AtomView
- #bonds : Array(Bond)
- #coords : Spatial::CoordinatesProxy
-
#coords=(coords : Enumerable(Spatial::Vec3)) : Enumerable(Spatial::Vec3)
Sets the atom coordinates.
- #each_atom : Iterator(Atom)
- #each_atom(&block : Atom -> )
- #each_fragment(& : AtomView -> ) : Nil
- #formal_charge : Int32
- #formal_charges : Array(Int32)
- #fragments : Array(AtomView)
- #has_hydrogens? : Bool
- #n_atoms : Int32
-
#to_gen(fractional : Bool = false) : String
Returns a string representation of the atom collection using the
Chem::Gen
file format. -
#to_gen(output : IO | Path | String, fractional : Bool = false) : Nil
Writes the atom collection to output using the
Chem::Gen
file format. -
#to_mol2(output : IO | Path | String) : Nil
Writes the atom collection to output using the
Chem::Mol2
file format. -
#to_mol2 : String
Returns a string representation of the atom collection using the
Chem::Mol2
file format. -
#to_pdb(bonds : Chem::PDB::Writer::BondOptions = Chem::PDB::Writer::BondOptions.flags(Het, Disulfide), renumber : Bool = true, ter_on_fragment : Bool = false) : String
Returns a string representation of the atom collection using the
Chem::PDB
file format. -
#to_pdb(output : IO | Path | String, bonds : Chem::PDB::Writer::BondOptions = Chem::PDB::Writer::BondOptions.flags(Het, Disulfide), renumber : Bool = true, ter_on_fragment : Bool = false) : Nil
Writes the atom collection to output using the
Chem::PDB
file format. -
#to_xyz(extended : Bool = false, fields : Array(String) = [] of String) : String
Returns a string representation of the atom collection using the
Chem::XYZ
file format. -
#to_xyz(output : IO | Path | String, extended : Bool = false, fields : Array(String) = [] of String) : Nil
Writes the atom collection to output using the
Chem::XYZ
file format. -
#write(output : IO | Path | String, format : Chem::Format | String) : Nil
Writes the atom collection to output using format.
-
#write(path : Path | String) : Nil
Writes the atom collection to the specified file.
Instance Method Detail
Sets the atom coordinates.
Returns a string representation of the atom collection using
the Chem::Gen
file format. Arguments are fowarded to
Chem::Gen::Writer.open
.
Writes the atom collection to output using the Chem::Gen
file format. Arguments are fowarded to Chem::Gen::Writer.open
.
Writes the atom collection to output using the Chem::Mol2
file format. Arguments are fowarded to Chem::Mol2::Writer.open
.
Returns a string representation of the atom collection using
the Chem::Mol2
file format. Arguments are fowarded to
Chem::Mol2::Writer.open
.
Returns a string representation of the atom collection using
the Chem::PDB
file format. Arguments are fowarded to
Chem::PDB::Writer.open
.
Writes the atom collection to output using the Chem::PDB
file format. Arguments are fowarded to Chem::PDB::Writer.open
.
Returns a string representation of the atom collection using
the Chem::XYZ
file format. Arguments are fowarded to
Chem::XYZ::Writer.open
.
Writes the atom collection to output using the Chem::XYZ
file format. Arguments are fowarded to Chem::XYZ::Writer.open
.
Writes the atom collection to output using format. Raises
ArgumentError
if format has required arguments or cannot
write Chem::AtomCollection
.
The supported file formats are Chem::Gen
, Chem::Mol2
, Chem::PDB
, Chem::XYZ
. Use the
#to_*
methods to customize how the object is written in the
corresponding file format if possible.
Writes the atom collection to the specified file. The file
format is chosen based on the filename (see
Chem::Format#from_filename
). Raises ArgumentError
if the
file format cannot be determined.
The supported file formats are the following:
Chem::Gen
(.gen)Chem::Mol2
(.mol2)Chem::PDB
(.ent, .pdb)Chem::XYZ
(.xyz)
Use the #to_*
methods to customize how the object is written
in the corresponding file format if possible.