struct
Chem::Spatial::Positions3
- Chem::Spatial::Positions3
- Struct
- Value
- Object
Overview
TODO make compatible with Positions3Proxy
Included Modules
Defined in:
chem/register_format.crchem/spatial/positions3.cr
Constructors
-
.from_dcd(input : IO | Path | String) : self
Returns the positions3 encoded in input using the
Chem::DCD
file format. - .new(pos : Slice(Vec3), cell : Parallelepiped | Nil = nil)
-
.read(input : IO | Path | String, format : Chem::Format | String) : self
Returns the positions3 encoded in the specified file using format.
-
.read(path : Path | String) : self
Returns the positions3 encoded in the specified file.
Instance Method Summary
- #cell : Parallelepiped | Nil
- #cell? : Parallelepiped | Nil | Nil
- #size(*args, **options)
- #size(*args, **options, &)
-
#to_dcd(title : String | Nil = nil) : String
Returns a string representation of the positions3 using the
Chem::DCD
file format. -
#to_dcd(output : IO | Path | String, title : String | Nil = nil) : Nil
Writes the positions3 to output using the
Chem::DCD
file format. -
#to_slice : Slice(Vec3)
Returns a read-only slice of the positions.
- #unsafe_fetch(*args, **options)
- #unsafe_fetch(*args, **options, &)
-
#write(output : IO | Path | String, format : Chem::Format | String) : Nil
Writes the positions3 to output using format.
-
#write(path : Path | String) : Nil
Writes the positions3 to the specified file.
Instance methods inherited from module Indexable(Chem::Spatial::Vec3)
[](idxs : Tuple) : Tuple[](idxs : Enumerable(Int)) : Array(T)
[](*idxs : Int) : Tuple [], sentence(io : IO, separator : String = ", ", *, pair_separator : String = " and ", tail_separator : String = ", and ", & : T, IO -> ) : Nil
sentence(io : IO, separator : String = ", ", *, pair_separator : String = " and ", tail_separator : String = ", and ") : Nil
sentence(separator : String = ", ", *, pair_separator : String = " and ", tail_separator : String = ", and ", & : T -> ) : String
sentence(separator : String = ", ", *, pair_separator : String = " and ", tail_separator : String = ", and ") : String sentence
Instance methods inherited from module Enumerable(Chem::Spatial::Vec3)
===(atom : Chem::Atom) : Bool===(chain : Chem::Chain) : Bool
===(residue : Chem::Residue) : Bool ===, average(weights : Indexable(Number))
average(weights : Indexable(Number), & : T -> _) average, find(pattern, if_none default = nil) find, find!(pattern) find!, mean
mean(& : T -> _) mean
Constructor Detail
Returns the positions3 encoded in input using the
Chem::DCD
file format. Arguments are forwarded to
Chem::DCD::Reader.open
.
If input contains multiple entries, this method returns
the first one only. Use Array#from_dcd
or
Chem::DCD::Reader#each
to get multiple entries instead.
Returns the positions3 encoded in the specified file
using format. Raises ArgumentError
if format has
required arguments or cannot read Chem::Spatial::Positions3
.
If input contains multiple entries, this method returns
the first one only. Use Array.read
or
Chem::FormatReader::MultiEntry#each
(reader can be
obtained via Chem::Format.reader
) to get multiple entries
instead.
The supported file formats are Chem::DCD
. Use the
.from_*
methods to customize how the object is decoded in
the corresponding file format if possible.
Returns the positions3 encoded in 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.
If the file contains multiple entries, this method returns
the first one only. Use Array.read
to get multiple entries
instead.
The supported file formats are the following:
Chem::DCD
(.dcd)
Use the .from_*
methods to customize how the object is
decoded in the corresponding file format if possible.
Instance Method Detail
Returns a string representation of the positions3 using
the Chem::DCD
file format. Arguments are forwarded to
Chem::DCD::Writer.open
.
Writes the positions3 to output using the Chem::DCD
file format. Arguments are forwarded to Chem::DCD::Writer.open
.
Writes the positions3 to output using format. Raises
ArgumentError
if format has required arguments or cannot
write Chem::Spatial::Positions3
.
The supported file formats are Chem::DCD
. Use the
#to_*
methods to customize how the object is written in the
corresponding file format if possible.
Writes the positions3 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::DCD
(.dcd)
Use the #to_*
methods to customize how the object is written
in the corresponding file format if possible.