Documentation ¶
Index ¶
- func ConcMolRDF(traj chem.ConcTraj, mol *chem.Molecule, refindexes []int, residues []string, ...) ([]float64, []float64, error)
- func EllipsoidAxes(coords *v3.Matrix, epsilon float64, mol ...chem.Masser) ([]float64, error)
- func FrameUMolCRDF(coord *v3.Matrix, mol chem.Atomer, refindexes []int, residues []string, ...) []float64
- func FrameUMolSQRDF(coord *v3.Matrix, mol chem.Atomer, refindexes []int, residues []string, ...) ([]float64, []float64)
- func MDFFromCDF(ret []float64, framesread int, A, B, step float64) ([]float64, []float64, error)
- func MolRDF(traj chem.Traj, mol *chem.Molecule, refindexes []int, residues []string, ...) ([]float64, []float64, error)
- func MolShortestDist(test, ref *v3.Matrix) float64
- func SQRDF2RSDF(avs, sqavs []float64, framesread int, step float64) []float64
- type MolDistList
- func (M MolDistList) AtomIDs(mol chem.Atomer) []int
- func (M MolDistList) Data() ([]int, []float64)
- func (M MolDistList) Distance(i int) float64
- func (M MolDistList) Distances() []float64
- func (M MolDistList) Len() int
- func (M MolDistList) Less(i, j int) bool
- func (M MolDistList) Merge(list ...MolDistList)
- func (M MolDistList) MolID(i int) int
- func (M MolDistList) MolIDs() []int
- func (M MolDistList) String() string
- func (M MolDistList) Swap(i, j int)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcMolRDF ¶
func ConcMolRDF(traj chem.ConcTraj, mol *chem.Molecule, refindexes []int, residues []string, options ...*Options) ([]float64, []float64, error)
ConcMolRDF calculates the RDF for a trajectory given the indexes of the solute atoms, the solvent molecule name, the step for the "layers" and the cutoff. It processes several frames of the trajectory concurrently, depending on the logical CPUs available. The code includes some extra comments, so it can be used as a template for concurrent trajectory processing.
func EllipsoidAxes ¶
func FrameUMolCRDF ¶
func FrameUMolCRDF(coord *v3.Matrix, mol chem.Atomer, refindexes []int, residues []string, options ...*Options) []float64
FrameUMolCRDF Obtains the Unnormalized Cummulative Molecular RDF for one solvated structure. The RDF would be these values averaged over several structures.
func FrameUMolSQRDF ¶
func FrameUMolSQRDF(coord *v3.Matrix, mol chem.Atomer, refindexes []int, residues []string, options ...*Options) ([]float64, []float64)
FrameUMolCRDF Obtains the the number of solvent molecules in each solvent shell, and the sqare of that number for each shell in a given frame.
func MDFFromCDF ¶
MDDFFromCDF takes the sume of a cummulative distribution function over framesread frames. It obtaines the RDF/MDDF from there by dividing each "shell" by an approximation to the volume (the ellipsoid of inerta of the solute scaled to the corresponding radius) and divided by the frames read. It returns a slice with the average density per shell (divided by volume) and another with the average number of molecules per shell, in both cases, divided by the value of the last shell. The function also requires the ratio of the largest semiaxes of the ellipsoid of inertia to its smallest semiaxis, A and B. It returns an error and nil slices if A and B are smaller than 1. it overwrites the original slice CDF slice! API BREAK: The original function did not take A and B, and simply approximated the volume as a sphere. This departs from the behavior described in the publication, in a way that could create wrong results. The current implementation also departs from the publication, which approximated the volume by a parallelepiped. I think this behavior is better, as it allows the MDDF to reduce to the RDF for spherically symmetric systems.
func MolRDF ¶
func MolRDF(traj chem.Traj, mol *chem.Molecule, refindexes []int, residues []string, options ...*Options) ([]float64, []float64, error)
MolRDF calculates the RDF for a trajectory given the indexes of the solute atoms, the solvent molecule name, the step for the "layers" and the cutoff. API BREAK: mol used to be chem.Atomer.
func MolShortestDist ¶
MolShortestDistGiven two sets of coordinates, it obtains the distance between the two closest atoms in the 2 sets. This is probably not a very efficient way to do it. Note:This should probably be moved to the main gochem package, in geometric.go
Types ¶
type MolDistList ¶
type MolDistList []*molDist
A set of distances for different molecules to the same point
func DistRank ¶
func DistRank(coord *v3.Matrix, mol chem.Atomer, refindexes []int, residues []string, options ...*Options) MolDistList
DistRank determines, for a reference set of coordinates and a set of residue names, the minimum distance between any atom from the reference and any atom from each residue with one of the names given (or the centroid of each residue, if a variadic "com" bool is given) returns a list with ID and distances, which satisfies the sort interface and has several other useful methods.
func (MolDistList) AtomIDs ¶
func (M MolDistList) AtomIDs(mol chem.Atomer) []int
AtomIDs returns a list of all the atom IDs for all the residues in the list. Only a convenience function.
func (MolDistList) Data ¶
func (M MolDistList) Data() ([]int, []float64)
Data returns a list with all the MolIDs and a list with all the distances in the set
func (MolDistList) Distance ¶
func (M MolDistList) Distance(i int) float64
Distance returns the distance from the element i of the slice to the pre-defined point
func (MolDistList) Distances ¶
func (M MolDistList) Distances() []float64
Distances returns a slice with all the distances in the set
func (MolDistList) Len ¶
func (M MolDistList) Len() int
func (MolDistList) Less ¶
func (M MolDistList) Less(i, j int) bool
Less returns true if the distance of the element i to the pre-defined point is smallert than that of the element j, or false otherwise
func (MolDistList) Merge ¶
func (M MolDistList) Merge(list ...MolDistList)
Merge aggregates the receiver and the arguments in the receiver it removes entries with repeated MolIDs
func (MolDistList) MolID ¶
func (M MolDistList) MolID(i int) int
MolID resturns the MolID (the residue number, for a protein) of the i element of the slice
func (MolDistList) MolIDs ¶
func (M MolDistList) MolIDs() []int
MolIDs returns a slice with the molIDs in al the lists
func (MolDistList) String ¶
func (M MolDistList) String() string
String produces a string representation of a set of distances
func (MolDistList) Swap ¶
func (M MolDistList) Swap(i, j int)
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options contains options for the RDF/MDDF calculation
func (*Options) COM ¶
Returns whether to use center of mass for solvent in the calculations and sets the value to the one given, if any
func (*Options) Cpus ¶
Returns the current value of the Cpus options (the number of gorutines to use on the concurrent calculation) and sets it, if a valid value is given
func (*Options) End ¶
Returns the maximum distance from the solute to be considered in the RDF/MDDF calculation and sets if to a value, if given