Molassembler  1.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
IO.h
Go to the documentation of this file.
1 
15 #ifndef INCLUDE_MOLASSEMBLER_IO_H
16 #define INCLUDE_MOLASSEMBLER_IO_H
17 
18 #include "Molassembler/Types.h"
19 #include "Utils/Typenames.h"
20 
21 #include <string>
22 #include <vector>
23 
24 namespace Scine {
25 namespace Utils {
26 
27 // Forward declarations
28 class AtomCollection;
29 class BondOrderCollection;
30 } // namespace Utils
31 
32 namespace Molassembler {
33 
34 // More forward declarations
35 class Molecule;
36 class AngstromPositions;
37 
39 namespace IO {
40 
45 class MASM_EXPORT LineNotation {
46 public:
51  static const bool& enabled();
56  static Molecule fromCanonicalSMILES(const std::string& can);
61  static Molecule fromIsomericSMILES(const std::string& smi);
67  static Molecule fromInChI(const std::string& inchi);
68 
69 private:
70  static Molecule fromFormat(const std::string& lineNotation, const std::string& format);
71 };
72 
77 MASM_EXPORT std::pair<Utils::AtomCollection, Utils::BondOrderCollection> exchangeFormat(
78  const Molecule& molecule,
79  AngstromPositions angstromWrapper
80 );
81 
83 MASM_EXPORT std::pair<Utils::AtomCollection, Utils::BondOrderCollection> exchangeFormat(
84  const Molecule& molecule,
85  const Utils::PositionCollection& positions
86 );
87 
92 MASM_EXPORT std::tuple<Utils::AtomCollection, Utils::BondOrderCollection, std::vector<AtomIndex>> shuffle(
93  const Utils::AtomCollection& ac,
95 );
96 
105 MASM_EXPORT Molecule read(const std::string& filename);
106 
114 MASM_EXPORT std::vector<Molecule> split(const std::string& filename);
115 
126 MASM_EXPORT void write(
127  const std::string& filename,
128  const Molecule& molecule,
129  const AngstromPositions& angstromWrapper
130 );
131 
133 MASM_EXPORT void write(
134  const std::string& filename,
135  const Molecule& molecule,
136  const Utils::PositionCollection& positions
137 );
138 
147 MASM_EXPORT void write(const std::string& filename, const Molecule& molecule);
148 
149 } // namespace IO
150 } // namespace Molassembler
151 } // namespace Scine
152 
153 #endif
Models a molecule as a graph (connectivity of atoms) and a list of stereopermutators.
Definition: Molecule.h:73
Molecule read(const std::string &filename)
Read a single molecule from a file.
Defines basic types widely shared across the project.
A wrapper class around Utils&#39; PositionCollection to emphasize that the positions stored therein are i...
Definition: AngstromPositions.h:25
void write(const std::string &filename, const Molecule &molecule, const AngstromPositions &angstromWrapper)
Writer function for various chemical formats.
std::pair< Utils::AtomCollection, Utils::BondOrderCollection > exchangeFormat(const Molecule &molecule, AngstromPositions angstromWrapper)
Extract exchange format information from a molecule and positional data.
std::tuple< Utils::AtomCollection, Utils::BondOrderCollection, std::vector< AtomIndex > > shuffle(const Utils::AtomCollection &ac, const Utils::BondOrderCollection &bos)
Applies a random atom index permutation to exchange data.
std::vector< Molecule > split(const std::string &filename)
Read multiple molecules from a file.
Provides Molecule instances from line notations of molecules such as SMILES and InChI.
Definition: IO.h:45