|
NuriKit v0.1.0b2
|
Namespaces | |
| namespace | constants |
Classes | |
| class | AtomData |
| class | Bfgs |
| BFGS minimizer. More... | |
| struct | BfgsResult |
| class | BondData |
| class | BoolMatrix |
| class | BoolMatrixKey |
| struct | BoostEdgeDesc |
| class | CifParser |
| class | CyclicIndex |
| Cyclic indexer for Eigen types with a given offset. More... | |
| class | CyclicIndex< 0, 0 > |
| class | CyclicIndex< O, 0 > |
| class | DefaultReaderFactoryImpl |
| class | DefaultReaderImpl |
| class | Element |
| The class for element data. More... | |
| struct | GAlignResult |
| struct | GAMinimizeArgs |
| class | GARigidMolInfo |
| struct | GASamplingArgs |
| class | Graph |
| Class for very sparse graphs, especially designed for the molecular graphs. More... | |
| struct | Isotope |
| class | LBfgs |
| L-BFGS(-B) minimizer. More... | |
| struct | LbfgsResult |
| class | MmcifReader |
| class | MmcifReaderFactory |
| struct | MmResult |
| class | Mol2Reader |
| class | Mol2ReaderFactory |
| class | Molecule |
| Read-only molecule class. More... | |
| class | MoleculeMutator |
| A class to mutate a molecule. More... | |
| class | MoleculeReader |
| class | MoleculeReaderFactory |
| class | MoleculeReaderWrapper |
| class | MoleculeReaderWrapper< std::ifstream, Reader > |
| class | MoleculeSanitizer |
| class | MoleculeStream |
| class | NelderMead |
| Nelder-Mead simplex algorithm for function minimization. More... | |
| struct | NMResult |
| class | OCTree |
| An octree implementation for 3D point clouds. More... | |
| class | PDBAtom |
| Represents a PDB atom with (possibly) multiple alternate locations. More... | |
| class | PDBAtomSite |
| Represents a single site with position and properties. More... | |
| class | PDBChain |
| Represents a PDB chain containing residues. More... | |
| class | PDBModel |
| Represents a PDB model containing chains. More... | |
| class | PDBReader |
| class | PDBReaderFactory |
| class | PDBResidue |
| Represents a PDB residue containing atoms. More... | |
| struct | PDBResidueId |
| class | PeriodicTable |
| The periodic table of elements. More... | |
| class | ReversedStream |
| class | RingSetsFinder |
| Wrapper class of the common routines of find_sssr() and find_relevant_rings(). More... | |
| class | SDFReader |
| class | SDFReaderFactory |
| class | SmilesReader |
| class | SmilesReaderFactory |
| class | Subgraph |
| A subgraph of a graph. More... | |
| class | TMAlign |
| TM-align algorithm. More... | |
| struct | TMAlignResult |
| Result of TM-align algorithm. More... | |
| class | VF2pp |
| An implementation of VF2++ algorithm for (sub)graph isomorphism. More... | |
| struct | VF2ppResult |
| class | VoxelGrid |
| A uniform voxel-grid (cell list) index for 3D point clouds with a fixed neighbor cutoff. More... | |
| class | ZippedIterator |
Typedefs | |
| using | Rings = std::vector<std::vector<int>> |
| using | NodesErased |
| template<class GT> | |
| using | SubgraphOf = typename internal::SubgraphTypeHelper<GT>::type |
| using | Substructure = internal::Substructure<false> |
| using | ConstSubstructure = internal::Substructure<true> |
| template<class Reader = MoleculeReader> | |
| using | FileMoleculeReader = MoleculeReaderWrapper<std::ifstream, Reader> |
| template<class Reader = MoleculeReader> | |
| using | StringMoleculeReader = MoleculeReaderWrapper<std::istringstream, Reader> |
Enumerations | |
| enum class | OptimResultCode { kSuccess , kMaxIterReached , kInvalidInput , kAbnormalTerm } |
| enum class | AlignMode : std::uint8_t { kMsdOnly = 0x1 , kXformOnly = 0x2 , kBoth = kMsdOnly | kXformOnly } |
| enum class | IsoMapType : int { kSubgraph , kInduced , kGraph } |
| The type of isomorphic map to find. More... | |
| enum class | AtomFlags : std::uint32_t { kAromatic = 0x1 , kConjugated = 0x2 , kRing = 0x4 , kChiral = 0x8 , kClockWise = 0x10 } |
| enum class | BondFlags : std::uint32_t { kRing = 0x1 , kAromatic = 0x2 , kConjugated = 0x4 , kConfigSpecified = 0x8 , kTransConfig = 0x10 } |
| enum class | SubstructCategory { kUnknown , kResidue , kChain } |
| enum class | SDFVersion { kAutomatic , kV2000 , kV3000 } |
Functions | |
| bool | generate_coords (const Molecule &mol, Matrix3Xd &conf, int max_trial=10) |
| Generate 3D coordinates for the molecule. | |
| bool | generate_coords (Molecule &mol, int max_trial=10) |
| Generate 3D coordinates for the molecule. | |
| ABSL_MUST_USE_RESULT bool | guess_everything (MoleculeMutator &mut, int conf=0, double threshold=kDefaultThreshold) |
| Guess bonds, types of atoms, and number of hydrogens of a molecule. | |
| void | guess_connectivity (MoleculeMutator &mut, int conf=0, double threshold=kDefaultThreshold) |
| Guess connectivity information of a molecule. | |
| ABSL_MUST_USE_RESULT bool | guess_all_types (Molecule &mol, int conf=0) |
| Guess types of atoms and bonds, and number of hydrogens of a molecule. | |
| void | guess_fcharge_2d (Molecule &mol) |
| Guess formal charges of a molecule. | |
| void | guess_hydrogens_2d (Molecule &mol) |
| Guess hydrogens of a molecule. | |
| void | guess_fcharge_hydrogens_2d (Molecule &mol) |
| Guess formal charges and implicit hydrogens of a molecule. | |
| template<class FuncGrad> | |
| LbfgsResult | l_bfgs_b (FuncGrad &&fg, MutRef< ArrayXd > x, const ArrayXi &nbd, const Array2Xd &bounds, const int m=10, const double factr=1e+7, const double pgtol=1e-5, const int maxiter=15000, const int maxls=20) |
| Minimize a function using L-BFGS-B algorithm. | |
| template<class FuncGrad> | |
| LbfgsResult | l_bfgs (FuncGrad &&fg, MutRef< ArrayXd > x, const int m=10, const double factr=1e+7, const double pgtol=1e-5, const int maxiter=15000, const int maxls=20) |
| Minimize a function using L-BFGS algorithm. | |
| template<class FuncGrad> | |
| BfgsResult | bfgs (FuncGrad &&fg, MutRef< ArrayXd > x, const double pgtol=1e-5, const double xrtol=0, int maxiter=-1, const int maxls=100, const double ftol=1e-4, const double gtol=0.9, const double xtol=1e-14) |
| Minimize a function using BFGS algorithm. | |
| template<class Func> | |
| NMResult | nelder_mead (Func &&f, MutRef< ArrayXXd > data, int maxiter=-1, const double ftol=1e-6, const double alpha=1, const double gamma=2, const double rho=0.5, const double sigma=0.5) |
| Minimize a function using Nelder-Mead simplex algorithm. | |
| ArrayXXd | nm_prepare_simplex (ConstRef< ArrayXd > x0, double eps=1e-6) |
| Prepare the initial simplex for Nelder-Mead algorithm. | |
| std::pair< Rings, bool > | find_all_rings (const Molecule &mol, int max_size=-1) |
| Find all elementary cycles in the molecular graph. | |
| std::pair< Rings, bool > | find_all_rings (const Substructure &sub, int max_size=-1) |
| Find all elementary cycles in the substructure. | |
| std::pair< Rings, bool > | find_all_rings (const ConstSubstructure &sub, int max_size=-1) |
| Find all elementary cycles in the substructure. | |
| template<class MoleculeLike> | |
| RingSetsFinder (const MoleculeLike &, int) -> RingSetsFinder< MoleculeLike > | |
| Rings | find_relevant_rings (const Molecule &mol, int max_size=-1) |
| Find union of the all SSSRs in the molecular graph. | |
| Rings | find_relevant_rings (const Substructure &sub, int max_size=-1) |
| Find union of the all SSSRs in the substructure. | |
| Rings | find_relevant_rings (const ConstSubstructure &sub, int max_size=-1) |
| Find union of the all SSSRs in the substructure. | |
| Rings | find_sssr (const Molecule &mol, int max_size=-1) |
| Find a smallest set of smallest rings (SSSR) of the molecular graph. | |
| Rings | find_sssr (const Substructure &sub, int max_size=-1) |
| Find a smallest set of smallest rings (SSSR) of the substructure. | |
| Rings | find_sssr (const ConstSubstructure &sub, int max_size=-1) |
| Find a smallest set of smallest rings (SSSR) of the substructure. | |
| template<class T, class Alloc, class U> | |
| std::vector< T, Alloc >::size_type | erase (std::vector< T, Alloc > &c, const U &value) |
| template<class T, class Alloc, class Pred> | |
| std::vector< T, Alloc >::size_type | erase_if (std::vector< T, Alloc > &c, Pred &&pred) |
| template<class T, class Alloc, class Pred> | |
| std::vector< T, Alloc >::iterator | erase_first (std::vector< T, Alloc > &c, Pred &&pred) |
| template<class T, size_t N> | |
| constexpr size_t | array_size (T(&)[N]) |
| constexpr bool | operator== (const Isotope &lhs, const Isotope &rhs) noexcept |
| constexpr bool | operator!= (const Isotope &lhs, const Isotope &rhs) noexcept |
| constexpr bool | operator== (const Element &lhs, const Element &rhs) noexcept |
| constexpr bool | operator!= (const Element &lhs, const Element &rhs) noexcept |
| template<class DT, std::enable_if_t< std::is_floating_point_v< DT >, int > = 0> | |
| constexpr DT | deg2rad (DT deg) |
| template<class DT, std::enable_if_t< std::is_integral_v< DT >, int > = 0> | |
| constexpr double | deg2rad (DT deg) |
| template<class DT, std::enable_if_t< std::is_floating_point_v< DT >, int > = 0> | |
| constexpr DT | rad2deg (DT rad) |
| template<class DT, std::enable_if_t< std::is_integral_v< DT >, int > = 0> | |
| constexpr double | rad2deg (DT rad) |
| template<class MatrixLike, class ArrayLike> | |
| void | pdistsq (ArrayLike &&distsq, const MatrixLike &m) |
| template<class MatrixLike> | |
| auto | pdistsq (const MatrixLike &m) |
| template<class MatrixLike, class ArrayLike> | |
| void | pdist (ArrayLike &&dist, const MatrixLike &m) |
| template<class MatrixLike> | |
| auto | pdist (const MatrixLike &m) |
| template<class AL, class DAL> | |
| void | to_square_form (DAL &&dists, const AL &pdists, Eigen::Index n) |
| template<class ArrayLike> | |
| auto | to_square_form (const ArrayLike &pdists, Eigen::Index n) |
| template<class ML1, class ML2, class DML, std::enable_if_t< internal::extract_if_enum_v(ML1::RowsAtCompileTime)==internal::extract_if_enum_v(ML2::RowsAtCompileTime), int > = 0> | |
| void | cdistsq (DML &&distsq, const ML1 &a, const ML2 &b) |
| template<class ML1, class ML2> | |
| auto | cdistsq (const ML1 &a, const ML2 &b) |
| template<class ML1, class ML2, class DML> | |
| void | cdist (DML &&dist, const ML1 &a, const ML2 &b) |
| template<class ML1, class ML2> | |
| auto | cdist (const ML1 &a, const ML2 &b) |
| template<class ML1, class ML2> | |
| auto | msd (const ML1 &a, const ML2 &b) |
| double | cos_angle (const Vector3d &oa, const Vector3d &ob) |
| Calculate the cosine of the angle between two vectors. | |
| double | cos_angle (const Vector3d &o, const Vector3d &a, const Vector3d &b) |
| Calculate the cosine of the angle between two vectors. | |
| template<class Scalar, class Indexer, int N, auto... Extra> | |
| std::pair< Scalar, Scalar > | sum_tan2_half (const Matrix< Scalar, 3, N, 0, Extra... > &m, const Indexer &idxs) |
| Calculate sin and cos of half an average angle between vectors, (0 - idxs[0]), (1 - idxs[1]), ..., (n-1 - idxs[n-1]). | |
| template<class Scalar, int N, auto... Extra> | |
| std::pair< Scalar, Scalar > | sum_tan2_half (const Matrix< Scalar, 3, N, 0, Extra... > &m) |
| Calculate sin and cos of half an average angle between consecutive vectors, i.e., (0, 1), (1, 2), ..., (n-1, 0). | |
| double | cos_dihedral (const Vector3d &axis, Vector3d v, Vector3d w) |
| Calculate A - (v) - B - (axis) - C - (w) - D dihedral angle along the axis. Axis should be normalized. | |
| double | cos_dihedral (const Vector3d &a, const Vector3d &b, const Vector3d &c, const Vector3d &d) |
| Calculate A -> - B -> C -> D dihedral angle. | |
| template<class MatrixLike> | |
| Vector4d | fit_plane (const MatrixLike &pts, bool normalize=true) |
| Perform a least-squares fit of a plane to a set of points. | |
| template<class VectorLike> | |
| Vector3d | any_perpendicular (const VectorLike &v, bool normalize=true) |
| Find a vector perpendicular to the given vector. | |
| std::pair< Isometry3d, double > | kabsch (ConstRef< Matrix3Xd > query, ConstRef< Matrix3Xd > templ, AlignMode mode=AlignMode::kBoth, bool reflection=false) |
| An implementation of the Kabsch algorithm for aligning two sets of points. This algorithm is based on the implementation in TM-align. | |
| std::pair< Isometry3d, double > | qcp (const Eigen::Ref< const Matrix3Xd > &query, const Eigen::Ref< const Matrix3Xd > &templ, AlignMode mode=AlignMode::kBoth, bool reflection=false, double evalprec=1e-11, double evecprec=1e-6, int maxiter=50) |
| Perform quaternion-based superposition of two sets of points. | |
| std::pair< Isometry3d, double > | qcp_inplace (MutRef< Matrix3Xd > query, MutRef< Matrix3Xd > templ, AlignMode mode=AlignMode::kBoth, bool reflection=false, double evalprec=1e-11, double evecprec=1e-6, int maxiter=50) |
| In-place version of qcp(). | |
| bool | embed_distances_3d (Eigen::Ref< Matrix3Xd > pts, MatrixXd &dsqs) |
| A routine for converting squared pairwise distances to cartesian coordinates. | |
| bool | embed_distances_4d (Eigen::Ref< Matrix4Xd > pts, MatrixXd &dsqs) |
| A routine for converting squared pairwise distances to cartesian coordinates. | |
| Matrix3Xd | canonical_fibonacci_lattice (int npts) |
| Generate points on a unit sphere using the "canonical" Fibonacci lattice method. | |
| template<class NT, class ET> | |
| auto | out_edges (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | source (typename boost::graph_traits< Graph< NT, ET > >::edge_descriptor e, const Graph< NT, ET > &) |
| template<class NT, class ET> | |
| boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | target (typename boost::graph_traits< Graph< NT, ET > >::edge_descriptor e, const Graph< NT, ET > &) |
| template<class NT, class ET> | |
| auto | out_degree (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | in_edges (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | in_degree (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | degree (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | adjacent_vertices (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | vertices (const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | num_vertices (const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | edges (const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | num_edges (const Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | add_vertex (Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| void | clear_vertex (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| void | remove_vertex (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | add_edge (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor u, typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| void | remove_edge (typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor u, typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v, Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| void | remove_edge (typename boost::graph_traits< Graph< NT, ET > >::edge_descriptor e, Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| void | remove_edge (typename boost::graph_traits< Graph< NT, ET > >::edge_iterator it, Graph< NT, ET > &g) |
| template<class NT, class ET> | |
| auto | get (boost::vertex_index_t, const Graph< NT, ET > &) |
| template<class NT, class ET> | |
| auto | get (boost::vertex_index_t, const Graph< NT, ET > &, typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor v) |
| template<class NT, class ET> | |
| auto | get (boost::edge_index_t, const Graph< NT, ET > &) |
| template<class NT, class ET> | |
| auto | get (boost::edge_index_t, const Graph< NT, ET > &, typename boost::graph_traits< Graph< NT, ET > >::edge_descriptor e) |
| template<class NT, class ET, bool is_const> | |
| auto | out_edges (typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor v, const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor | source (typename boost::graph_traits< Subgraph< NT, ET, is_const > >::edge_descriptor e, const Subgraph< NT, ET, is_const > &) |
| template<class NT, class ET, bool is_const> | |
| boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor | target (typename boost::graph_traits< Subgraph< NT, ET, is_const > >::edge_descriptor e, const Subgraph< NT, ET, is_const > &) |
| template<class NT, class ET, bool is_const> | |
| auto | out_degree (typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor v, const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| auto | in_edges (typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor v, const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| auto | in_degree (typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor v, const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| auto | degree (typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor v, const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| auto | adjacent_vertices (typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor v, const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| auto | vertices (const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| auto | num_vertices (const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| auto | edges (const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| auto | num_edges (const Subgraph< NT, ET, is_const > &g) |
| template<class NT, class ET, bool is_const> | |
| auto | get (boost::vertex_index_t, const Subgraph< NT, ET, is_const > &) |
| template<class NT, class ET, bool is_const> | |
| auto | get (boost::vertex_index_t, const Subgraph< NT, ET, is_const > &, typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor v) |
| template<class NT, class ET, bool is_const> | |
| auto | get (boost::edge_index_t, const Subgraph< NT, ET, is_const > &) |
| template<class NT, class ET, bool is_const> | |
| auto | get (boost::edge_index_t, const Subgraph< NT, ET, is_const > &, typename boost::graph_traits< Subgraph< NT, ET, is_const > >::edge_descriptor e) |
| template<class GT, bool is_const> | |
| internal::EigenNeighborIndexer< GT, is_const > | as_index (internal::NodeWrapper< GT, is_const > node) |
| template<class NT, class ET> | |
| absl::flat_hash_set< int > | connected_components (const Graph< NT, ET > &g, int begin) |
| Find connected components of a graph starting from a node. | |
| template<class NT, class ET> | |
| absl::flat_hash_set< int > | connected_components (const Graph< NT, ET > &g, int begin, int exclude) |
| Find connected components of a graph starting from a node, excluding an edge between the starting node and the excluded node (if present). | |
| template<class NT, class ET> | |
| Subgraph (Graph< NT, ET > &graph) -> Subgraph< NT, ET, false > | |
| template<class NT, class ET> | |
| Subgraph (Graph< NT, ET > &graph, const std::vector< int > &nodes) -> Subgraph< NT, ET, false > | |
| template<class NT, class ET> | |
| Subgraph (Graph< NT, ET > &graph, std::vector< int > &&nodes) noexcept -> Subgraph< NT, ET, false > | |
| template<class NT, class ET> | |
| Subgraph (const Graph< NT, ET > &graph) -> Subgraph< NT, ET, true > | |
| template<class NT, class ET> | |
| Subgraph (const Graph< NT, ET > &graph, const std::vector< int > &nodes) -> Subgraph< NT, ET, true > | |
| template<class NT, class ET> | |
| Subgraph (const Graph< NT, ET > &graph, std::vector< int > &&nodes) noexcept -> Subgraph< NT, ET, true > | |
| template<class GT> | |
| SubgraphOf< GT > | make_subgraph (GT &&graph) |
| Make an empty subgraph from a graph. | |
| template<class GT> | |
| SubgraphOf< GT > | make_subgraph (GT &&graph, internal::IndexSet &&nodes, internal::IndexSet &&edges) |
| Make a subgraph from list of nodes and edges. | |
| template<class GT> | |
| SubgraphOf< GT > | subgraph_from_nodes (GT &&graph, internal::IndexSet &&nodes) |
| Make a subgraph from list of nodes. | |
| template<class GT> | |
| SubgraphOf< GT > | subgraph_from_edges (GT &&graph, internal::IndexSet &&edges) |
| Make a subgraph from list of edges. | |
| template<IsoMapType kMt, class GT, class GU, class AL1, class AL2> | |
| VF2pp< kMt, GT, GU > | make_vf2pp (const GT &query, const GU &target, AL1 &&qlbl, AL2 &&tlbl) |
| Prepare VF2++ algorithm. | |
| template<IsoMapType kMt, class GT, class GU, class AL1, class AL2, class NodeMatch, class EdgeMatch> | |
| VF2ppResult | vf2pp (const GT &query, const GU &target, AL1 &&qlbl, AL2 &&tlbl, const NodeMatch &node_match, const EdgeMatch &edge_match) |
| Find a query-to-target subgraph mapping. | |
| template<class GT, class GU, class NodeMatch, class EdgeMatch, class AL1, class AL2> | |
| VF2ppResult | vf2pp (const GT &query, const GU &target, AL1 &&qlbl, AL2 &&tlbl, const NodeMatch &node_match, const EdgeMatch &edge_match, IsoMapType mt) |
| Find a query-to-target subgraph mapping. | |
| template<IsoMapType kMt, class GT, class GU, class NodeMatch, class EdgeMatch> | |
| VF2ppResult | vf2pp (const GT &query, const GU &target, const NodeMatch &node_match, const EdgeMatch &edge_match) |
| Find a query-to-target subgraph mapping assuming all node labels are equal. | |
| template<class GT, class GU, class NodeMatch, class EdgeMatch> | |
| VF2ppResult | vf2pp (const GT &query, const GU &target, const NodeMatch &node_match, const EdgeMatch &edge_match, IsoMapType mt) |
| Find a query-to-target subgraph mapping assuming all node labels are equal. | |
| constants::Hybridization | clamp_hyb (int hyb) |
| constants::BondOrder | clamp_ord (int ord) |
| bool | operator== (const AtomData &lhs, const AtomData &rhs) |
| int | all_neighbors (Molecule::Atom atom) |
| Get the number of all neighbors of an atom. | |
| int | count_heavy (Molecule::Atom atom) |
| Get the number of heavy atoms bonded to an atom. | |
| int | count_hydrogens (Molecule::Atom atom) |
| Count the number of hydrogens of the atom. | |
| int | sum_bond_order (Molecule::Atom atom) |
| Get the approximate total bond order of the atom. | |
| int | nonbonding_electrons (Molecule::Atom atom) |
| Get the predicted non-bonding electron count of the atom. | |
| int | steric_number (Molecule::Atom atom) |
| Get the predicted steric number of the atom. | |
| const Element * | effective_element (const AtomData &data) |
| Get "effective" element of the atom. | |
| const Element * | effective_element (Molecule::Atom atom) |
| Get "effective" element of the atom. | |
| std::vector< std::vector< int > > | fragments (const Molecule &mol) |
| Get fragments of the molecule. | |
| ABSL_MUST_USE_RESULT bool | assign_charges_gasteiger (Molecule &mol, int relaxation_steps=12) |
| Assign Marsili-Gasteiger charges to the molecule. | |
| ArrayXd | shrake_rupley_sasa (const Molecule &mol, const Matrix3Xd &conf, int nprobe=92, double rprobe=1.4, internal::SrSasaMethod method=internal::SrSasaMethod::kAuto) |
| Calculate the Solvent-Accessible Surface Area (SASA) of a molecule conformation using the Shrake-Rupley algorithm. | |
| template<class Stream> | |
| Stream & | operator>> (Stream &stream, Molecule &mol) |
| template<class ReaderFactoryImpl> | |
| bool | register_reader_factory (const std::vector< std::string > &names) |
| internal::CifValue | cif_value (std::string_view value) |
| Create a string CIF value from text. | |
| template<class T, std::enable_if_t< std::is_same_v< T, bool >, int > = 0> | |
| internal::CifValue | cif_value (T value, bool short_form=false) |
| Create a boolean CIF value. | |
| template<class T, std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, bool >, int > = 0> | |
| internal::CifValue | cif_value (T value, int width=0) |
| Create an integral CIF value. | |
| template<class T, std::enable_if_t< std::is_floating_point_v< T >, int > = 0> | |
| internal::CifValue | cif_value (T value, int precision=-1, bool coerce_nonfinite=false, bool is_unk=true) |
| Create a floating-point CIF value. | |
| template<class T, std::enable_if_t<!std::is_arithmetic_v< std::decay_t< T > > &&!std::is_convertible_v< T, std::string_view >, int > = 0> | |
| internal::CifValue | cif_value (T &&value) |
| Create a string CIF value from any absl::StrCat-able type. | |
| bool | write_cif_table (std::string &out, const internal::CifTable &table, bool align=false) |
Serialize a CIF table (key-value pairs or a loop_), appending to out. | |
| bool | write_cif_frame (std::string &out, const internal::CifFrame &frame, internal::CifFrame::Type type=internal::CifFrame::Type::kData, bool align=false) |
Serialize a CIF frame, appending to out. | |
| bool | write_cif_block (std::string &out, const internal::CifBlock &block, bool align=false) |
Serialize a CIF block (a data or global block plus its save frames), appending to out. | |
| std::vector< Molecule > | mmcif_load_frame (const internal::CifFrame &frame) |
| std::vector< Molecule > | mmcif_read_next_block (CifParser &parser) |
| Molecule | read_mol2 (const std::vector< std::string > &mol2) |
| Read a single Mol2 string and return a molecule. | |
| bool | write_mol2 (std::string &out, const Molecule &mol, int conf=-1, bool write_sub=true) |
| Molecule | read_pdb (const std::vector< std::string > &pdb) |
| Read a single PDB string and return a molecule. | |
| int | write_pdb (std::string &out, const Molecule &mol, int model=-1, int conf=-1) |
| std::ostream & | operator<< (std::ostream &os, const PDBResidueId &id) |
| template<class Hash> | |
| Hash | AbslHashValue (Hash h, PDBResidueId id) |
| bool | operator== (PDBResidueId lhs, PDBResidueId rhs) |
| PDBModel | read_pdb_model (const std::vector< std::string > &pdb) |
| Molecule | read_sdf (const std::vector< std::string > &sdf) |
| Read a single sdf string and return a molecule. | |
| bool | write_sdf (std::string &out, const Molecule &mol, int conf=-1, SDFVersion ver=SDFVersion::kAutomatic) |
| Write a molecule to an SDF stream. | |
| Molecule | read_smiles (const std::vector< std::string > &smi_block) |
| Read a single SMILES string and return a molecule. | |
| bool | write_smiles (std::string &out, const Molecule &mol, bool canonical=false) |
| template<class... Iters> | |
| constexpr auto | make_zipped_iterator (Iters... iters) |
| MmResult | match_maker (ConstRef< Matrix3Xd > query, ConstRef< Matrix3Xd > templ, double cutoff=2.0, double global_ratio=0.1, double viol_ratio=0.5) |
| Match-Maker algorithm for structural alignment of two 3D point clouds. | |
| std::vector< GAlignResult > | galign (const Molecule &mol, const Matrix3Xd &seed, const GARigidMolInfo &templ, bool flexible=true, int max_conf=1, const GASamplingArgs &sampling={}, const GAMinimizeArgs &minimize={}) |
| TMAlignResult | tm_align (ConstRef< Matrix3Xd > query, ConstRef< Matrix3Xd > templ, TMAlign::InitFlags flags=TMAlign::InitFlags::kDefault, int l_norm=-1, double d0=-1) |
| Align two structures using TM-align algorithm. | |
| TMAlignResult | tm_align (ConstRef< Matrix3Xd > query, ConstRef< Matrix3Xd > templ, ConstRef< ArrayXc > secx, ConstRef< ArrayXc > secy, TMAlign::InitFlags flags=TMAlign::InitFlags::kDefault, int l_norm=-1, double d0=-1) |
| Align two structures using TM-align algorithm. | |
| TMAlignResult | tm_align (ConstRef< Matrix3Xd > query, ConstRef< Matrix3Xd > templ, ConstRef< ArrayXi > y2x, int l_norm=-1, double d0=-1, bool keep_alignment=true) |
| Align two structures using TM-align algorithm, with the given alignment. This is also known as the "TM-score" program in the TM-tools suite. | |
| template<class T, std::enable_if_t< std::is_trivially_copyable_v< T >, int > = 0> | |
| constexpr T | min (T a, T b) |
| template<class L, class R, std::enable_if_t< std::is_same_v< internal::remove_cvref_t< L >, internal::remove_cvref_t< R > > &&!std::is_trivially_copyable_v< internal::remove_cvref_t< L > > &&std::is_lvalue_reference_v< L > &&std::is_lvalue_reference_v< R >, int > = 0> | |
| constexpr const std::remove_reference_t< L > & | min (L &&a, R &&b) |
| template<class T, std::enable_if_t< std::is_trivially_copyable_v< T >, int > = 0> | |
| constexpr T | max (T a, T b) |
| template<class L, class R, std::enable_if_t< std::is_same_v< internal::remove_cvref_t< L >, internal::remove_cvref_t< R > > &&!std::is_trivially_copyable_v< internal::remove_cvref_t< L > > &&std::is_lvalue_reference_v< L > &&std::is_lvalue_reference_v< R >, int > = 0> | |
| constexpr const std::remove_reference_t< L > & | max (L &&a, R &&b) |
| template<class T, class Comp = std::less<>, std::enable_if_t< std::is_trivially_copyable_v< T >, int > = 0> | |
| constexpr std::pair< T, T > | minmax (T a, T b, Comp &&comp={}) |
| template<class L, class R, class Comp = std::less<>, std::enable_if_t< std::is_same_v< internal::remove_cvref_t< L >, internal::remove_cvref_t< R > > &&!std::is_trivially_copyable_v< internal::remove_cvref_t< L > > &&std::is_lvalue_reference_v< L > &&std::is_lvalue_reference_v< R >, int > = 0> | |
| constexpr std::pair< const std::remove_reference_t< L > &, const std::remove_reference_t< L > & > | minmax (L &&a, R &&b, Comp &&comp={}) |
| template<class T, std::enable_if_t< std::is_trivially_copyable_v< T >, int > = 0> | |
| constexpr T | clamp (T v, T l, T h) |
| template<class T, class L, class H, std::enable_if_t< std::is_same_v< internal::remove_cvref_t< T >, internal::remove_cvref_t< L > > &&std::is_same_v< internal::remove_cvref_t< L >, internal::remove_cvref_t< H > > &&!std::is_trivially_copyable_v< internal::remove_cvref_t< T > > &&std::is_lvalue_reference_v< T > &&std::is_lvalue_reference_v< L > &&std::is_lvalue_reference_v< H >, int > = 0> | |
| constexpr const std::remove_reference_t< T > & | clamp (T &&v, L &&l, H &&h) |
Variables | |
| constexpr double | kDefaultThreshold = 0.5 |
| using nuri::ConstSubstructure = internal::Substructure<true> |
| using nuri::FileMoleculeReader = MoleculeReaderWrapper<std::ifstream, Reader> |
| using nuri::NodesErased |
| using nuri::Rings = std::vector<std::vector<int>> |
| using nuri::StringMoleculeReader = MoleculeReaderWrapper<std::istringstream, Reader> |
| using nuri::SubgraphOf = typename internal::SubgraphTypeHelper<GT>::type |
| using nuri::Substructure = internal::Substructure<false> |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
| Hash nuri::AbslHashValue | ( | Hash | h, |
| PDBResidueId | id ) |
| auto nuri::add_edge | ( | typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | u, |
| typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | v, | ||
| Graph< NT, ET > & | g ) |
| auto nuri::add_vertex | ( | Graph< NT, ET > & | g | ) |
|
inline |
Get the number of all neighbors of an atom.
| atom | An atom. |
| Vector3d nuri::any_perpendicular | ( | const VectorLike & | v, |
| bool | normalize = true ) |
Find a vector perpendicular to the given vector.
| VectorLike | The type of the vector-like object. |
| v | A vector-like object to generate a perpendicular vector. |
| normalize | Whether to normalize the perpendicular vector. Defaults to true. |
This function is based on the algorithm proposed by K Whatmough on Mathematics Stack Exchange. [4]
|
constexpr |
| internal::EigenNeighborIndexer< GT, is_const > nuri::as_index | ( | internal::NodeWrapper< GT, is_const > | node | ) |
|
extern |
Assign Marsili-Gasteiger charges to the molecule.
| mol | The molecule to assign charges to. |
| relaxation_steps | The number of relaxation steps to perform after the initial charge assignment (default: 12). When set to 0, no relaxation is performed. |
This implements the original Gasteiger charge assignment algorithm [2], which is based on the charge distribution over the sigma bonds. This is the only version that is implemented in most other cheminformatics libraries, including RDKit and OpenBabel.
The Gasteiger parameters are taken from RDKit and support most hybridization states of H, Be, B, C, N, O, F, Mg, Al, Si, P, S, Cl, Br, I, and dummy atoms. Unsupported elements and/or hybridization states will be reported as a warning and the algorithm will abort without any charge assignment.
The Gasteiger algorithm requires initial "seed" charges to be assigned to atoms. In this implementation, the initial charges are assigned from the (localized) formal charges of the atoms, then a charge delocalization algorithm is applied to the terminal atoms of a conjugated system with the same Gasteiger type (e.g., oxygens of a carboxylate group will be assigned -0.5 charge each).
Sets mol2_charge_type to GASTEIGER in the molecule properties when successful.
|
inline |
Minimize a function using BFGS algorithm.
| FuncGrad | Function object that computes the function value and gradient. Function value should be returned and gradient should be updated in the input gradient vector. |
| fg | Function object. |
| x | Initial guess. Will be modified in-place. |
| pgtol | Stop when the projected gradient is less than this value. |
| xrtol | Stop when the relative change in x is less than this value. |
| maxiter | Maximum number of iterations. If negative, it will be set to 200 times the number of variables. |
| maxls | Maximum number of line search steps. |
| ftol | Tolerance for the relative change in the function value. |
| gtol | Gradient tolerance for the line search step. |
| xtol | Tolerance for the relative change in x. |
References:
This implementation is based on the Python implementation of BFGS in the SciPy library, with optimized Hessian update step suggested by the linked Wikipedia page. The original implementation is released under the BSD 3-Clause License (included below).
|
extern |
Generate points on a unit sphere using the "canonical" Fibonacci lattice method.
| npts | The number of points to generate. |
The points are placed on the sphere as the following equation:
\[t_i (\theta, \phi) = \left(\frac{i}{\varphi^2}, \frac{i + 0.5}{N} \right) \]
Where \(\varphi\) is the golden ratio, \(N\) is the number of points, and \(0 \leq i < N \). Note, for compatibility with other implementations, step size along \(\theta\) is defined as \(1 / \varphi^2\) instead of the complementary \(1 / \varphi\) used in some literature.
This implementation is based on the following references:
| auto nuri::cdist | ( | const ML1 & | a, |
| const ML2 & | b ) |
| void nuri::cdist | ( | DML && | dist, |
| const ML1 & | a, | ||
| const ML2 & | b ) |
| auto nuri::cdistsq | ( | const ML1 & | a, |
| const ML2 & | b ) |
| void nuri::cdistsq | ( | DML && | distsq, |
| const ML1 & | a, | ||
| const ML2 & | b ) |
|
inline |
Create a string CIF value from text.
| value | the string to store. |
| internal::CifValue nuri::cif_value | ( | T && | value | ) |
Create a string CIF value from any absl::StrCat-able type.
| value | the object to stringify and store. |
Participates in overload resolution only for non-arithmetic types that are not convertible to std::string_view.
| internal::CifValue nuri::cif_value | ( | T | value, |
| bool | short_form = false ) |
Create a boolean CIF value.
| value | the boolean to store. |
| short_form | if true, use y / n instead of yes / no. |
bool overload) so that pointers do not implicitly convert to bool and steal the std::string_view overload. | internal::CifValue nuri::cif_value | ( | T | value, |
| int | precision = -1, | ||
| bool | coerce_nonfinite = false, | ||
| bool | is_unk = true ) |
Create a floating-point CIF value.
| value | the number to store. |
| precision | if non-negative, format with this many digits after the decimal point; otherwise yields at most 6 significant digits. |
| coerce_nonfinite | if true, coerce non-finite values to a CIF-representable form that reparses faithfully:
|
| is_unk | if true (the default), NaN is coerced to ? (unknown); otherwise it is coerced to . (inapplicable). |
| internal::CifValue nuri::cif_value | ( | T | value, |
| int | width = 0 ) |
Create an integral CIF value.
| value | the integer to store. |
| width | if positive, zero-pad the number to at least this many digits. |
|
constexpr |
|
constexpr |
|
inline |
|
inline |
| void nuri::clear_vertex | ( | typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | v, |
| Graph< NT, ET > & | g ) |
| absl::flat_hash_set< int > nuri::connected_components | ( | const Graph< NT, ET > & | g, |
| int | begin ) |
Find connected components of a graph starting from a node.
| NT | The type of the node data |
| ET | The type of the edge data |
| g | The graph to find connected components of |
| begin | The node to start from |
| absl::flat_hash_set< int > nuri::connected_components | ( | const Graph< NT, ET > & | g, |
| int | begin, | ||
| int | exclude ) |
Find connected components of a graph starting from a node, excluding an edge between the starting node and the excluded node (if present).
| NT | The type of the node data |
| ET | The type of the edge data |
| g | The graph to find connected components of |
| begin | The node to start from |
| exclude | The node to exclude |
|
inline |
Calculate the cosine of the angle between two vectors.
| o | The origin of the angle. |
| a | The first point. |
| b | The second point. |
|
inline |
Calculate the cosine of the angle between two vectors.
| oa | The first vector. |
| ob | The second vector. |
|
inline |
Calculate A -> - B -> C -> D dihedral angle.
| a | The position of point A. |
| b | The position of point B. |
| c | The position of point C. |
| d | The position of point D. |
See https://stackoverflow.com/a/34245697 for the implementation(s) in python.
|
inline |
Calculate A - (v) - B - (axis) - C - (w) - D dihedral angle along the axis. Axis should be normalized.
| axis | The normalized axis of the dihedral angle. |
| v | The vector from A to B. |
| w | The vector from C to D. |
See https://stackoverflow.com/a/34245697 for the implementation(s) in python.
|
extern |
Get the number of heavy atoms bonded to an atom.
| atom | An atom. |
|
extern |
Count the number of hydrogens of the atom.
| atom | An atom. |
|
constexpr |
|
constexpr |
| auto nuri::degree | ( | typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | v, |
| const Graph< NT, ET > & | g ) |
| auto nuri::degree | ( | typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor | v, |
| const Subgraph< NT, ET, is_const > & | g ) |
| auto nuri::edges | ( | const Graph< NT, ET > & | g | ) |
| auto nuri::edges | ( | const Subgraph< NT, ET, is_const > & | g | ) |
Get "effective" element of the atom.
| data | Data of the atom. |
|
inline |
Get "effective" element of the atom.
| atom | An atom. |
|
extern |
A routine for converting squared pairwise distances to cartesian coordinates.
| pts | Destination to which save the generated coordinates (3d). |
| dsqs | The squared distances between points. Will be modified in-place. |
This implementation is based on the following reference: TF Havel, ID Kuntz, and GM Crippen. Bull. Math. Biol. 1983, 45 (5), 665-720. DOI:10.1007/BF02460044
|
extern |
A routine for converting squared pairwise distances to cartesian coordinates.
| pts | Destination to which save the generated coordinates (4d). |
| dsqs | The squared distances between points. Will be modified in-place. |
This implementation is based on the following reference: TF Havel, ID Kuntz, and GM Crippen. Bull. Math. Biol. 1983, 45 (5), 665-720. DOI:10.1007/BF02460044
| std::vector< T, Alloc >::size_type nuri::erase | ( | std::vector< T, Alloc > & | c, |
| const U & | value ) |
| std::vector< T, Alloc >::iterator nuri::erase_first | ( | std::vector< T, Alloc > & | c, |
| Pred && | pred ) |
| std::vector< T, Alloc >::size_type nuri::erase_if | ( | std::vector< T, Alloc > & | c, |
| Pred && | pred ) |
|
extern |
Find all elementary cycles in the substructure.
| sub | A substructure. |
| max_size | Maximum size of the rings to be found. If negative, all rings are found. |
This is based on the algorithm described in the following paper: Hanser, Th. et al. J. Chem. Inf. Comput. Sci. 1996, 36 (6), 1146-1152. DOI: 10.1021/ci960322f
The time complexity of this function is inherently exponential, but it is expected to run in a reasonable time ( \(\sim\mathcal{O}(V^2)\)) for most molecules in practice.
Find all elementary cycles in the molecular graph.
| mol | A molecule. |
| max_size | Maximum size of the rings to be found. If negative, all rings are found. |
This is based on the algorithm described in the following paper: Hanser, Th. et al. J. Chem. Inf. Comput. Sci. 1996, 36 (6), 1146-1152. DOI: 10.1021/ci960322f
The time complexity of this function is inherently exponential, but it is expected to run in a reasonable time ( \(\sim\mathcal{O}(V^2)\)) for most molecules in practice.
|
extern |
Find all elementary cycles in the substructure.
| sub | A substructure. |
| max_size | Maximum size of the rings to be found. If negative, all rings are found. |
This is based on the algorithm described in the following paper: Hanser, Th. et al. J. Chem. Inf. Comput. Sci. 1996, 36 (6), 1146-1152. DOI: 10.1021/ci960322f
The time complexity of this function is inherently exponential, but it is expected to run in a reasonable time ( \(\sim\mathcal{O}(V^2)\)) for most molecules in practice.
|
inline |
Find union of the all SSSRs in the substructure.
| sub | A substructure. |
| max_size | Maximum size of the rings to be found. If negative, all rings are found. |
This is a convenience wrapper of the nuri::RingSetsFinder::find_relevant_rings() member function.
Find union of the all SSSRs in the molecular graph.
| mol | A molecule. |
| max_size | Maximum size of the rings to be found. If negative, all rings are found. |
This is a convenience wrapper of the nuri::RingSetsFinder::find_relevant_rings() member function.
|
inline |
Find union of the all SSSRs in the substructure.
| sub | A substructure. |
| max_size | Maximum size of the rings to be found. If negative, all rings are found. |
This is a convenience wrapper of the nuri::RingSetsFinder::find_relevant_rings() member function.
|
inline |
Find a smallest set of smallest rings (SSSR) of the substructure.
| sub | A substructure. |
| max_size | Maximum size of the rings to be found. If negative, all rings are found. |
This is a convenience wrapper of the nuri::RingSetsFinder::find_sssr() member function.
Find a smallest set of smallest rings (SSSR) of the molecular graph.
| mol | A molecule. |
| max_size | Maximum size of the rings to be found. If negative, all rings are found. |
This is a convenience wrapper of the nuri::RingSetsFinder::find_sssr() member function.
|
inline |
Find a smallest set of smallest rings (SSSR) of the substructure.
| sub | A substructure. |
| max_size | Maximum size of the rings to be found. If negative, all rings are found. |
This is a convenience wrapper of the nuri::RingSetsFinder::find_sssr() member function.
| Vector4d nuri::fit_plane | ( | const MatrixLike & | pts, |
| bool | normalize = true ) |
Perform a least-squares fit of a plane to a set of points.
| MatrixLike | The type of the matrix-like object. |
| pts | The matrix-like object containing the points. Should be in a N x 3 shape, where N >= 3. |
| normalize | Whether to normalize the normal vector. Defaults to true. |
|
extern |
Get fragments of the molecule.
| mol | The molecule. |
|
extern |
|
extern |
Generate 3D coordinates for the molecule.
| mol | The molecule to generate coordinates. |
| conf | A matrix to store the generated coordinates. |
| max_trial | The maximum number of trials to generate trial distances. |
|
inline |
Generate 3D coordinates for the molecule.
| mol | The molecule to generate coordinates. |
| max_trial | The maximum number of trials to generate trial distances. |
| auto nuri::get | ( | boost::edge_index_t | , |
| const Graph< NT, ET > & | ) |
| auto nuri::get | ( | boost::edge_index_t | , |
| const Graph< NT, ET > & | , | ||
| typename boost::graph_traits< Graph< NT, ET > >::edge_descriptor | e ) |
| auto nuri::get | ( | boost::edge_index_t | , |
| const Subgraph< NT, ET, is_const > & | ) |
| auto nuri::get | ( | boost::edge_index_t | , |
| const Subgraph< NT, ET, is_const > & | , | ||
| typename boost::graph_traits< Subgraph< NT, ET, is_const > >::edge_descriptor | e ) |
| auto nuri::get | ( | boost::vertex_index_t | , |
| const Graph< NT, ET > & | ) |
| auto nuri::get | ( | boost::vertex_index_t | , |
| const Graph< NT, ET > & | , | ||
| typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | v ) |
| auto nuri::get | ( | boost::vertex_index_t | , |
| const Subgraph< NT, ET, is_const > & | ) |
| auto nuri::get | ( | boost::vertex_index_t | , |
| const Subgraph< NT, ET, is_const > & | , | ||
| typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor | v ) |
|
extern |
Guess types of atoms and bonds, and number of hydrogens of a molecule.
| mol | The molecule to be guessed. |
| conf | The index of the conformation used for guessing. |
This function assumes all connectivity information is present and correct, and all atom/bond types and implicit hydrogen counts are incorrect. The information present in the molecule could be overwritten by this function.
|
extern |
Guess connectivity information of a molecule.
| mut | The mutator of the molecule to be guessed. |
| conf | The index of the conformation used for guessing. |
| threshold | The threshold for guessing bonds. |
This function assumes all connectivity information is missing. The information present in the molecule could be overwritten by this function.
|
extern |
Guess bonds, types of atoms, and number of hydrogens of a molecule.
| mut | The mutator of the molecule to be guessed. |
| conf | The index of the conformation used for guessing. |
| threshold | The threshold for guessing bonds. |
This function find extra bonds that are not in the input molecule, and add them to the molecule. The information present in the molecule will be preserved, except the newly added bonds and atoms that are connected to them.
If connectivity information is already present and is correct, consider using guess_all_types().
|
extern |
Guess formal charges of a molecule.
| mol | The molecule to be guessed. |
This function assumses that all atoms >= group 15 satisfy octet rule, and <= group 13 has no non-bonding electrons. Skip charge calculation on group 3-12 & 14 atoms, dummy atom, and atoms with explicit formal charge.
|
extern |
Guess formal charges and implicit hydrogens of a molecule.
| mol | The molecule to be guessed. |
This function is equivalent to calling guess_fcharge() and guess_hydrogens() in sequence.
|
extern |
Guess hydrogens of a molecule.
| mol | The molecule to be guessed. |
Assumses that all (appropriate) atoms satisfy octet rule. Add hydrogens only to the main group elements.
| auto nuri::in_degree | ( | typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | v, |
| const Graph< NT, ET > & | g ) |
| auto nuri::in_degree | ( | typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor | v, |
| const Subgraph< NT, ET, is_const > & | g ) |
|
extern |
An implementation of the Kabsch algorithm for aligning two sets of points. This algorithm is based on the implementation in TM-align.
| query | The query points. |
| templ | The template points. |
| mode | Selects the return value. Defaults to AlignMode::kBoth. Note that even if AlignMode::kXformOnly is selected, the MSD value will report a negative value if the calculation fails. |
| reflection | Whether to allow reflection. Defaults to false. |
This implementation has improved stability compared to the TM-align code by integrating a slightly modified version of the A Robust Eigensover for 3 x 3 Symmetric Matrices algorithm proposed by D Eberly (see more details in the following references) and by improving the pivot selection strategy in the B matrix calculation step.
References:
The following is the full license text for the TM-align code:
This is the copyright text of D Eberly's algorithm:
| LbfgsResult nuri::l_bfgs | ( | FuncGrad && | fg, |
| MutRef< ArrayXd > | x, | ||
| const int | m = 10, | ||
| const double | factr = 1e+7, | ||
| const double | pgtol = 1e-5, | ||
| const int | maxiter = 15000, | ||
| const int | maxls = 20 ) |
Minimize a function using L-BFGS algorithm.
| FuncGrad | Function object that computes the function value and gradient. Function value should be returned and gradient should be updated in the input gradient vector. |
| fg | Function object. |
| x | Initial guess. Will be modified in-place. |
| m | The maximum number of variable metric corrections used to define the limited memory matrix. |
| factr | Stop when function value changes by less than this factor times the machine precision. |
| pgtol | Stop when the projected gradient is less than this value. |
| maxiter | Maximum number of iterations. |
| maxls | Maximum number of line search steps. |
References:
This implementation is based on the C implementation of L-BFGS-B in the SciPy library, which is a translation of the original Fortran code by Ciyou Zhu, Richard Byrd, and Jorge Noceda. Both are released under the BSD 3-Clause License and the original license is included below.
| LbfgsResult nuri::l_bfgs_b | ( | FuncGrad && | fg, |
| MutRef< ArrayXd > | x, | ||
| const ArrayXi & | nbd, | ||
| const Array2Xd & | bounds, | ||
| const int | m = 10, | ||
| const double | factr = 1e+7, | ||
| const double | pgtol = 1e-5, | ||
| const int | maxiter = 15000, | ||
| const int | maxls = 20 ) |
Minimize a function using L-BFGS-B algorithm.
| FuncGrad | Function object that computes the function value and gradient. Function value should be returned and gradient should be updated in the input gradient vector. |
| fg | Function object. |
| x | Initial guess. Will be modified in-place. |
| nbd | Bound type for each variable. 0x1 if has lower bound, 0x2 if has upper bound, 0x1 | 0x2 if both. |
| bounds | Bounds for each variable. First row is lower bound and second row is upper bound. |
| m | The maximum number of variable metric corrections used to define the limited memory matrix. |
| factr | Stop when function value changes by less than this factor times the machine precision. |
| pgtol | Stop when the projected gradient is less than this value. |
| maxiter | Maximum number of iterations. |
| maxls | Maximum number of line search steps. |
References:
This implementation is based on the C implementation of L-BFGS-B in the SciPy library, which is a translation of the original Fortran code by Ciyou Zhu, Richard Byrd, and Jorge Noceda. Both are released under the BSD 3-Clause License and the original license is included below.
| SubgraphOf< GT > nuri::make_subgraph | ( | GT && | graph | ) |
Make an empty subgraph from a graph.
| GT | The type of the graph |
| graph | The graph to make a subgraph of |
| SubgraphOf< GT > nuri::make_subgraph | ( | GT && | graph, |
| internal::IndexSet && | nodes, | ||
| internal::IndexSet && | edges ) |
Make a subgraph from list of nodes and edges.
| GT | The type of the graph |
| graph | The graph to make a subgraph of |
| nodes | The nodes to include in the subgraph |
| edges | The edges to include in the subgraph |
nodes.| VF2pp< kMt, GT, GU > nuri::make_vf2pp | ( | const GT & | query, |
| const GU & | target, | ||
| AL1 && | qlbl, | ||
| AL2 && | tlbl ) |
Prepare VF2++ algorithm.
| query | The query graph ("needle"). |
| target | The target graph ("haystack"). |
| qlbl | The query node labels. |
| tlbl | The target node labels. |
|
constexpr |
|
extern |
Match-Maker algorithm for structural alignment of two 3D point clouds.
Iteratively estimates a rigid transform by least-squares fitting and rejects outliers ("violations") whose post-fit pairwise distance exceeds a cutoff. In each iteration, the number of points rejected is capped by both ratio limits (the effective cap is the smaller of the two). The process repeats until no violations remain.
| query | The query points. |
| templ | The template points. |
| cutoff | Distance cutoff in angstroms. A point pair is counted as a violation if its post-fit distance exceeds this threshold. |
| global_ratio | Maximum fraction of currently considered aligned points that may be excluded as outliers in a single iteration. |
| viol_ratio | Maximum fraction of currently violating points that may be excluded in a single iteration. |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
| std::vector< Molecule > nuri::mmcif_load_frame | ( | const internal::CifFrame & | frame | ) |
| auto nuri::msd | ( | const ML1 & | a, |
| const ML2 & | b ) |
|
inline |
Minimize a function using Nelder-Mead simplex algorithm.
| Func | Function object that computes the function value. The function value should be returned. |
| f | Function object. |
| data | Initial simplex data. When the problem is N-dimensional, the data should be (N + 1, N + 1) matrix, where the first N rows form the N + 1 simplex vertices of dimension N. The last row need not be initialized, but will be populated with the function value of each vertex if the optimization is successful. |
| maxiter | Maximum number of iterations. If negative or zero, it will be set to N * 200, where N is the number of dimensions. |
| ftol | Tolerance for the absolute change in the function value. |
| alpha | Reflection coefficient. Must be > 0. |
| gamma | Expansion coefficient. Must be > 1. |
| rho | Contraction coefficient. Must be in range (0, 1). |
| sigma | Shrink coefficient. Must be in range (0, 1). |
References:
|
extern |
Prepare the initial simplex for Nelder-Mead algorithm.
| x0 | Initial guess of size N. |
| eps | Max absolute value to consider an element of x0 as zero. |
This function will follow the Matlab implementation of the simplex initialization. See G Fuchang and H Lixing [1] for details.
|
inline |
Get the predicted non-bonding electron count of the atom.
| atom | An atom. |
| auto nuri::num_edges | ( | const Graph< NT, ET > & | g | ) |
| auto nuri::num_edges | ( | const Subgraph< NT, ET, is_const > & | g | ) |
| auto nuri::num_vertices | ( | const Graph< NT, ET > & | g | ) |
| auto nuri::num_vertices | ( | const Subgraph< NT, ET, is_const > & | g | ) |
|
extern |
|
inline |
| Stream & nuri::operator>> | ( | Stream & | stream, |
| Molecule & | mol ) |
| auto nuri::out_degree | ( | typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | v, |
| const Graph< NT, ET > & | g ) |
| auto nuri::out_degree | ( | typename boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor | v, |
| const Subgraph< NT, ET, is_const > & | g ) |
| void nuri::pdist | ( | ArrayLike && | dist, |
| const MatrixLike & | m ) |
| auto nuri::pdist | ( | const MatrixLike & | m | ) |
| void nuri::pdistsq | ( | ArrayLike && | distsq, |
| const MatrixLike & | m ) |
| auto nuri::pdistsq | ( | const MatrixLike & | m | ) |
|
extern |
Perform quaternion-based superposition of two sets of points.
| query | The query points. |
| templ | The template points. |
| mode | Selects the return value. Defaults to AlignMode::kBoth. Note that even if AlignMode::kXformOnly is selected, the MSD value will report a negative value if the calculation fails. |
| reflection | Whether to allow reflection. Defaults to false. |
| evalprec | The precision of eigenvalue calculation. Defaults to 1e-11. |
| evecprec | The precision of eigenvector calculation. Defaults to 1e-6. |
| maxiter | The maximum number of Newton-Raphson iterations. Defaults to 50. |
This implementation is based on the reference implementation by P Liu and DL Theobald, but modified for better stability and error handling. Also, an option to allow reflection is added based on observations of EA Coutsias, C Seok, and KA Dill (see more details in the following references).
References:
The following is the full license text for the reference implementation:
|
extern |
In-place version of qcp().
| query | The query points. On return, the points will be centered at the origin (unless only single point is given). |
| templ | The template points. On return, the points will be centered at the origin (unless only single point is given). |
| mode | Selects the return value. Defaults to AlignMode::kBoth. Note that even if AlignMode::kXformOnly is selected, the MSD value will report a negative value if the calculation fails. |
| reflection | Whether to allow reflection. Defaults to false. |
| evalprec | The precision of eigenvalue calculation. Defaults to 1e-11. |
| evecprec | The precision of eigenvector calculation. Defaults to 1e-6. |
| maxiter | The maximum number of Newton-Raphson iterations. Defaults to 50. |
This implementation is based on the reference implementation by P Liu and DL Theobald, but modified for better stability and error handling. Also, an option to allow reflection is added based on observations of EA Coutsias, C Seok, and KA Dill (see more details in the following references).
References:
The following is the full license text for the reference implementation:
|
constexpr |
|
constexpr |
|
extern |
Read a single Mol2 string and return a molecule.
| mol2 | the Mol2 string to read. |
|
extern |
Read a single PDB string and return a molecule.
| pdb | the PDB string to read. |
|
extern |
|
extern |
Read a single sdf string and return a molecule.
| sdf | the sdf string to read. |
|
extern |
Read a single SMILES string and return a molecule.
| smi_block | the SMILES block to read. Only the first string is used; the rest are ignored. This is to support the interface of the reader. |
| bool nuri::register_reader_factory | ( | const std::vector< std::string > & | names | ) |
| void nuri::remove_edge | ( | typename boost::graph_traits< Graph< NT, ET > >::edge_descriptor | e, |
| Graph< NT, ET > & | g ) |
| void nuri::remove_edge | ( | typename boost::graph_traits< Graph< NT, ET > >::edge_iterator | it, |
| Graph< NT, ET > & | g ) |
| void nuri::remove_edge | ( | typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | u, |
| typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | v, | ||
| Graph< NT, ET > & | g ) |
| void nuri::remove_vertex | ( | typename boost::graph_traits< Graph< NT, ET > >::vertex_descriptor | v, |
| Graph< NT, ET > & | g ) |
| nuri::RingSetsFinder | ( | const MoleculeLike & | , |
| int | ) -> RingSetsFinder< MoleculeLike > |
|
extern |
Calculate the Solvent-Accessible Surface Area (SASA) of a molecule conformation using the Shrake-Rupley algorithm.
| mol | The input molecule. |
| conf | The conformation matrix. |
| nprobe | The number of probe spheres. Default is 92. |
| rprobe | The radius of the probe spheres. Default is 1.4 angstroms. |
| method | Whether prefer direct or octree method. Default is auto. This is mainly for testing purpose; in most cases, the auto method will choose the optimal method. |
| boost::graph_traits< Graph< NT, ET > >::vertex_descriptor nuri::source | ( | typename boost::graph_traits< Graph< NT, ET > >::edge_descriptor | e, |
| const Graph< NT, ET > & | ) |
| boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor nuri::source | ( | typename boost::graph_traits< Subgraph< NT, ET, is_const > >::edge_descriptor | e, |
| const Subgraph< NT, ET, is_const > & | ) |
|
inline |
Get the predicted steric number of the atom.
| atom | An atom. |
| nuri::Subgraph | ( | const Graph< NT, ET > & | graph | ) | -> Subgraph< NT, ET, true > |
| nuri::Subgraph | ( | const Graph< NT, ET > & | graph, |
| const std::vector< int > & | nodes ) -> Subgraph< NT, ET, true > |
|
noexcept |
| nuri::Subgraph | ( | Graph< NT, ET > & | graph | ) | -> Subgraph< NT, ET, false > |
| nuri::Subgraph | ( | Graph< NT, ET > & | graph, |
| const std::vector< int > & | nodes ) -> Subgraph< NT, ET, false > |
|
noexcept |
| SubgraphOf< GT > nuri::subgraph_from_edges | ( | GT && | graph, |
| internal::IndexSet && | edges ) |
Make a subgraph from list of edges.
| GT | The type of the graph |
| graph | The graph to make a subgraph of |
| edges | The edges to include in the subgraph |
| SubgraphOf< GT > nuri::subgraph_from_nodes | ( | GT && | graph, |
| internal::IndexSet && | nodes ) |
Make a subgraph from list of nodes.
| GT | The type of the graph |
| graph | The graph to make a subgraph of |
| nodes | The nodes to include in the subgraph |
|
inline |
Get the approximate total bond order of the atom.
| atom | An atom. |
|
inline |
Calculate sin and cos of half an average angle between consecutive vectors, i.e., (0, 1), (1, 2), ..., (n-1, 0).
| m | The vectors. |
|
inline |
Calculate sin and cos of half an average angle between vectors, (0 - idxs[0]), (1 - idxs[1]), ..., (n-1 - idxs[n-1]).
| m | The vectors. |
| idxs | The indices of the vectors to calculate the angle with. |
| boost::graph_traits< Graph< NT, ET > >::vertex_descriptor nuri::target | ( | typename boost::graph_traits< Graph< NT, ET > >::edge_descriptor | e, |
| const Graph< NT, ET > & | ) |
| boost::graph_traits< Subgraph< NT, ET, is_const > >::vertex_descriptor nuri::target | ( | typename boost::graph_traits< Subgraph< NT, ET, is_const > >::edge_descriptor | e, |
| const Subgraph< NT, ET, is_const > & | ) |
|
extern |
Align two structures using TM-align algorithm.
| query | The query structure. |
| templ | The template structure. |
| secx | Secondary structure of the query structure. |
| secy | Secondary structure of the template structure. |
| flags | Initialization flags. |
| l_norm | Length normalization factor. If negative, the length of the template structure is used. |
| d0 | Distance scale factor. If negative, the default value is calculated based on the length normalization factor. |
|
extern |
Align two structures using TM-align algorithm, with the given alignment. This is also known as the "TM-score" program in the TM-tools suite.
| query | The query structure. |
| templ | The template structure. |
| y2x | A map of the template structure to the query structure. Negative values indicate that the corresponding residue in the template structure is not aligned to any residue in the query structure. |
| l_norm | Length normalization factor. If negative, the length of the template structure is used. |
| d0 | Distance scale factor. If negative, the default value is calculated based on the length normalization factor. |
| keep_alignment | Whether to keep the given alignment without pruning during realignment step (-i vs -I in the original TM-align program). |
|
extern |
Align two structures using TM-align algorithm.
| query | The query structure. |
| templ | The template structure. |
| flags | Initialization flags. |
| l_norm | Length normalization factor. If negative, the length of the template structure is used. |
| d0 | Distance scale factor. If negative, the default value is calculated based on the length normalization factor. |
| auto nuri::to_square_form | ( | const ArrayLike & | pdists, |
| Eigen::Index | n ) |
| void nuri::to_square_form | ( | DAL && | dists, |
| const AL & | pdists, | ||
| Eigen::Index | n ) |
| auto nuri::vertices | ( | const Graph< NT, ET > & | g | ) |
| auto nuri::vertices | ( | const Subgraph< NT, ET, is_const > & | g | ) |
| VF2ppResult nuri::vf2pp | ( | const GT & | query, |
| const GU & | target, | ||
| AL1 && | qlbl, | ||
| AL2 && | tlbl, | ||
| const NodeMatch & | node_match, | ||
| const EdgeMatch & | edge_match ) |
Find a query-to-target subgraph mapping.
| query | The query graph ("needle"). |
| target | The target graph ("haystack"). |
| qlbl | The query node labels. |
| tlbl | The target node labels. |
| node_match | The node matching function. Must return true if the (query, target) node pair is matched. Is guaranteed to be called with topologically feasible and label-matching nodes. |
| edge_match | The edge matching function. Must return true if the (query, target) edge pair is matched. Each ends of the edge are guaranteed to be already-matched nodes. Note that depending on the query and target graphs, the edge may be matched in reverse order, i.e., target edge might have source and target nodes swapped compared to the query edge. |
| VF2ppResult nuri::vf2pp | ( | const GT & | query, |
| const GU & | target, | ||
| AL1 && | qlbl, | ||
| AL2 && | tlbl, | ||
| const NodeMatch & | node_match, | ||
| const EdgeMatch & | edge_match, | ||
| IsoMapType | mt ) |
Find a query-to-target subgraph mapping.
| query | The query graph ("needle"). |
| target | The target graph ("haystack"). |
| qlbl | The query node labels. |
| tlbl | The target node labels. |
| node_match | The node matching function. Must return true if the (query, target) node pair is matched. Is guaranteed to be called with topologically feasible and label-matching nodes. |
| edge_match | The edge matching function. Must return true if the (query, target) edge pair is matched. Each ends of the edge are guaranteed to be already-matched nodes. Note that depending on the query and target graphs, the edge may be matched in reverse order, i.e., target edge might have source and target nodes swapped compared to the query edge. |
| mt | The type of subgraph mapping. |
| VF2ppResult nuri::vf2pp | ( | const GT & | query, |
| const GU & | target, | ||
| const NodeMatch & | node_match, | ||
| const EdgeMatch & | edge_match ) |
Find a query-to-target subgraph mapping assuming all node labels are equal.
| query | The query graph ("needle"). |
| target | The target graph ("haystack"). |
| node_match | The node matching function. Must return true if the (query, target) node pair is matched. Is guaranteed to be called with topologically feasible and label-matching nodes. |
| edge_match | The edge matching function. Must return true if the (query, target) edge pair is matched. Each ends of the edge are guaranteed to be already-matched nodes. Note that depending on the query and target graphs, the edge may be matched in reverse order, i.e., target edge might have source and target nodes swapped compared to the query edge. |
| VF2ppResult nuri::vf2pp | ( | const GT & | query, |
| const GU & | target, | ||
| const NodeMatch & | node_match, | ||
| const EdgeMatch & | edge_match, | ||
| IsoMapType | mt ) |
Find a query-to-target subgraph mapping assuming all node labels are equal.
| query | The query graph ("needle"). |
| target | The target graph ("haystack"). |
| node_match | The node matching function. Must return true if the (query, target) node pair is matched. Is guaranteed to be called with topologically feasible and label-matching nodes. |
| edge_match | The edge matching function. Must return true if the (query, target) edge pair is matched. Each ends of the edge are guaranteed to be already-matched nodes. Note that depending on the query and target graphs, the edge may be matched in reverse order, i.e., target edge might have source and target nodes swapped compared to the query edge. |
| mt | The type of subgraph mapping. |
|
extern |
Serialize a CIF block (a data or global block plus its save frames), appending to out.
The block is not validated; pass a block that satisfies internal::CifBlock::validate (e.g. one built through the public API).
| out | the buffer to append to. On error, it is overwritten with the error message. |
| block | the block to serialize. EOF and error blocks cannot be serialized. |
| align | if true, pad columns/keys for readability. |
|
extern |
Serialize a CIF frame, appending to out.
Emits a data_, save_, or global_ heading followed by each table. The frame is not validated; pass a frame that satisfies internal::CifFrame::validate (e.g. one built through the public API).
| out | the buffer to append to. On error, it is overwritten with the error message. |
| frame | the frame to serialize. |
| type | the type of block to write: data_ (default), save_, or global_. |
| align | if true, pad columns/keys for readability. |
|
extern |
Serialize a CIF table (key-value pairs or a loop_), appending to out.
A single-row table is written as key-value pairs; otherwise a loop_ is emitted.
| out | the buffer to append to. On error, it is overwritten with the error message. |
| table | the table to serialize. |
| align | if true, pad columns/keys for readability. |
|
extern |
|
extern |
|
extern |
Write a molecule to an SDF stream.
| out | The string to write to. |
| mol | The molecule to write. |
| conf | The index of the conformation to write. If negative, all conformers are written in separate blocks. |
| ver | The SDF version to write. When set to kAutomatic, the version is determined by the molecule size. |
|
extern |
|
constexpr |