Molassembler  3.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 
14 #ifndef INCLUDE_MOLASSEMBLER_IO_H
15 #define INCLUDE_MOLASSEMBLER_IO_H
16 
17 #include "Molassembler/Types.h"
18 #include "Utils/Typenames.h"
19 
20 #include <string>
21 #include <vector>
22 
23 namespace Scine {
24 namespace Utils {
25 
26 // Forward declarations
27 class AtomCollection;
28 class BondOrderCollection;
29 } // namespace Utils
30 
31 namespace Molassembler {
32 
33 // More forward declarations
34 class Molecule;
35 class AngstromPositions;
36 
38 namespace IO {
39 
44 class MASM_EXPORT LineNotation {
45 public:
50  static const bool& enabled();
55  static Molecule fromCanonicalSMILES(const std::string& can);
60  static Molecule fromIsomericSMILES(const std::string& smi);
66  static Molecule fromInChI(const std::string& inchi);
67 
68 private:
69  static Molecule fromFormat(const std::string& lineNotation, const std::string& format);
70 };
71 
76 MASM_EXPORT std::pair<Utils::AtomCollection, Utils::BondOrderCollection> exchangeFormat(
77  const Molecule& molecule,
78  const AngstromPositions& angstromWrapper
79 );
80 
82 MASM_EXPORT std::pair<Utils::AtomCollection, Utils::BondOrderCollection> exchangeFormat(
83  const Molecule& molecule,
84  const Utils::PositionCollection& positions
85 );
86 
91 MASM_EXPORT std::tuple<Utils::AtomCollection, Utils::BondOrderCollection, std::vector<AtomIndex>> shuffle(
92  const Utils::AtomCollection& ac,
94 );
95 
104 MASM_EXPORT Molecule read(const std::string& filename);
105 
113 MASM_EXPORT std::vector<Molecule> split(const std::string& filename);
114 
125 MASM_EXPORT void write(
126  const std::string& filename,
127  const Molecule& molecule,
128  const AngstromPositions& angstromWrapper
129 );
130 
132 MASM_EXPORT void write(
133  const std::string& filename,
134  const Molecule& molecule,
135  const Utils::PositionCollection& positions
136 );
137 
146 MASM_EXPORT void write(const std::string& filename, const Molecule& molecule);
147 
148 } // namespace IO
149 } // namespace Molassembler
150 } // namespace Scine
151 
152 #endif
Models a molecule as a graph (connectivity of atoms) and a list of stereopermutators.
Definition: Molecule.h:77
Molecule read(const std::string &filename)
Read a single molecule from a file.
std::pair< Utils::AtomCollection, Utils::BondOrderCollection > exchangeFormat(const Molecule &molecule, const AngstromPositions &angstromWrapper)
Extract exchange format information from a molecule and positional data.
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::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:44