RDKit: RDKit::SmilesWriter Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Public Member Functions | List of all members
RDKit::SmilesWriter Class Reference

`#include <MolWriters.h>`

Inheritance diagram for RDKit::SmilesWriter:

## Public Member Functions
| SmilesWriter (const std::string &fileName, const std::string &delimiter=" ", const std::string &nameHeader="Name", bool includeHeader=true, bool isomericSmiles=true, bool kekuleSmiles=false)
| SmilesWriter (std::ostream *outStream, std::string delimiter=" ", std::string nameHeader="Name", bool includeHeader=true, bool takeOwnership=false, bool isomericSmiles=true, bool kekuleSmiles=false)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| ~SmilesWriter () override
void | setProps (const STR_VECT &propNames) override
| set a vector of property names that are need to be written out for each molecule
void | write (const ROMol &mol, int confId=defaultConfId) override
| write a new molecule to the file
void | flush () override
| flush the ostream
void | close () override
| close our stream (the writer cannot be used again)
unsigned int | numMols () const override
| get the number of molecules written so far
Public Member Functions inherited from RDKit::MolWriter
virtual | ~MolWriter ()

## Detailed Description

The SmilesWriter is for writing molecules and properties to delimited text files.

Definition at line 48 of file MolWriters.h.

## Constructor & Destructor Documentation

## ◆ SmilesWriter() [1/2]

RDKit::SmilesWriter::SmilesWriter | ( | const std::string & | fileName,
|  | const std::string & | delimiter = " ",
|  | const std::string & | nameHeader = "Name",
|  | bool | includeHeader = true,
|  | bool | isomericSmiles = true,
|  | bool | kekuleSmiles = false )

Parameters

  fileName | : filename to write to ("-" to write to stdout)
  delimiter | : delimiter to use in the text file
  nameHeader | : used to label the name column in the output. If this is provided as the empty string, no names will be written.
  includeHeader | : toggles inclusion of a header line in the output
  isomericSmiles | : toggles generation of isomeric SMILES
  kekuleSmiles | : toggles the generation of kekule SMILES

## ◆ SmilesWriter() [2/2]

RDKit::SmilesWriter::SmilesWriter | ( | std::ostream * | outStream,
|  | std::string | delimiter = " ",
|  | std::string | nameHeader = "Name",
|  | bool | includeHeader = true,
|  | bool | takeOwnership = false,
|  | bool | isomericSmiles = true,
|  | bool | kekuleSmiles = false )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## ◆ ~SmilesWriter()

RDKit::SmilesWriter::~SmilesWriter | ( |  | ) |
| override

## Member Function Documentation

## ◆ close()

void RDKit::SmilesWriter::close | ( |  | ) |
| inlineoverridevirtual

close our stream (the writer cannot be used again)

Implements RDKit::MolWriter.

Definition at line 105 of file MolWriters.h.

References flush().

## ◆ flush()

void RDKit::SmilesWriter::flush | ( |  | ) |
| inlineoverridevirtual

flush the ostream

Implements RDKit::MolWriter.

Definition at line 90 of file MolWriters.h.

References PRECONDITION.

Referenced by close().

## ◆ numMols()

unsigned int RDKit::SmilesWriter::numMols | ( |  | ) | const
| inlineoverridevirtual

get the number of molecules written so far

Implements RDKit::MolWriter.

Definition at line 117 of file MolWriters.h.

## ◆ setProps()

void RDKit::SmilesWriter::setProps | ( | const STR_VECT & | propNames | ) |
| overridevirtual

set a vector of property names that are need to be written out for each molecule

Implements RDKit::MolWriter.

## ◆ write()

void RDKit::SmilesWriter::write | ( | const ROMol & | mol,
|  | int | confId = defaultConfId )
| overridevirtual

write a new molecule to the file

Implements RDKit::MolWriter.

References RDKit::defaultConfId.

The documentation for this class was generated from the following file:

- MolWriters.h