RDKit
Open-source cheminformatics and machine learning.
MolSGroupParsing.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2002-2018 Greg Landrum and T5 Informatics GmbH
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #pragma once
12 
13 namespace RDKit {
14 
15 namespace SGroupParsing {
16 typedef std::map<int, SubstanceGroup> IDX_TO_SGROUP_MAP;
17 typedef std::map<int, STR_VECT> IDX_TO_STR_VECT_MAP;
18 
19 /* ------------------ V2000 Utils ------------------ */
20 
21 unsigned int ParseSGroupIntField(const std::string &text, unsigned int line,
22  unsigned int &pos,
23  bool isFieldCounter = false);
24 
25 double ParseSGroupDoubleField(const std::string &text, unsigned int line,
26  unsigned int &pos);
27 
28 void ParseSGroupV2000STYLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
29  const std::string &text, unsigned int line);
30 
32  const std::string &text, unsigned int line);
33 
34 void ParseSGroupV2000SDILine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
35  const std::string &text, unsigned int line);
36 
37 void ParseSGroupV2000SSTLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
38  const std::string &text, unsigned int line);
39 
40 void ParseSGroupV2000SMTLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
41  const std::string &text, unsigned int line);
42 
43 void ParseSGroupV2000SLBLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
44  const std::string &text, unsigned int line);
45 
46 void ParseSGroupV2000SCNLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
47  const std::string &text, unsigned int line);
48 
49 void ParseSGroupV2000SDSLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
50  const std::string &text, unsigned int line);
51 void ParseSGroupV2000SBVLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
52  const std::string &text, unsigned int line);
53 
54 void ParseSGroupV2000SDTLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
55  const std::string &text, unsigned int line);
56 
57 void ParseSGroupV2000SDDLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
58  const std::string &text, unsigned int line);
59 
61  IDX_TO_STR_VECT_MAP &dataFieldsMap, RWMol *mol,
62  const std::string &text, unsigned int line,
63  bool strictParsing, unsigned int &counter,
64  unsigned int &lastDataSGroup,
65  std::ostringstream &currentDataField);
66 
67 void ParseSGroupV2000SPLLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
68  const std::string &text, unsigned int line);
69 
70 void ParseSGroupV2000SNCLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
71  const std::string &text, unsigned int line);
72 
73 void ParseSGroupV2000SAPLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
74  const std::string &text, unsigned int line);
75 
76 void ParseSGroupV2000SCLLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
77  const std::string &text, unsigned int line);
78 
79 void ParseSGroupV2000SBTLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol,
80  const std::string &text, unsigned int line);
81 
82 /* ------------------ V3000 Utils ------------------ */
83 
84 template <class T>
85 std::vector<T> ParseV3000Array(std::stringstream &stream);
86 
87 void ParseV3000CStateLabel(unsigned int line, const std::string &type,
88  SubstanceGroup *sgroup, std::stringstream &stream);
89 
90 void ParseV3000SAPLabel(RWMol *mol, SubstanceGroup *sgroup,
91  std::stringstream &stream);
92 
93 std::string ParseV3000StringPropLabel(std::stringstream &stream);
94 
95 void ParseV3000SGroupsBlock(std::istream *inStream, unsigned int &line,
96  unsigned int nSgroups, RWMol *mol,
97  bool &strictParsing);
98 
99 } // namespace SGroupParsing
100 } // namespace RDKit
RDKit::SGroupParsing::ParseSGroupV2000SDTLine
void ParseSGroupV2000SDTLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupDoubleField
double ParseSGroupDoubleField(const std::string &text, unsigned int line, unsigned int &pos)
RDKit::SGroupParsing::ParseSGroupV2000SSTLine
void ParseSGroupV2000SSTLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupV2000SBVLine
void ParseSGroupV2000SBVLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseV3000CStateLabel
void ParseV3000CStateLabel(unsigned int line, const std::string &type, SubstanceGroup *sgroup, std::stringstream &stream)
RDKit::SubstanceGroup
The class for representing SubstanceGroups.
Definition: SubstanceGroup.h:52
RDKit::SGroupParsing::ParseSGroupV2000SNCLine
void ParseSGroupV2000SNCLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:31
RDKit::SGroupParsing::ParseSGroupV2000SCDSEDLine
void ParseSGroupV2000SCDSEDLine(IDX_TO_SGROUP_MAP &sGroupMap, IDX_TO_STR_VECT_MAP &dataFieldsMap, RWMol *mol, const std::string &text, unsigned int line, bool strictParsing, unsigned int &counter, unsigned int &lastDataSGroup, std::ostringstream &currentDataField)
RDKit::SGroupParsing::ParseV3000SGroupsBlock
void ParseV3000SGroupsBlock(std::istream *inStream, unsigned int &line, unsigned int nSgroups, RWMol *mol, bool &strictParsing)
RDKit::SGroupParsing::ParseSGroupV2000SPLLine
void ParseSGroupV2000SPLLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupV2000SCNLine
void ParseSGroupV2000SCNLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseV3000StringPropLabel
std::string ParseV3000StringPropLabel(std::stringstream &stream)
RDKit::SGroupParsing::ParseSGroupV2000SAPLine
void ParseSGroupV2000SAPLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupV2000SMTLine
void ParseSGroupV2000SMTLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
SubstanceGroup.h
Defines the SubstanceGroup class.
RDKit::SGroupParsing::ParseSGroupV2000SLBLine
void ParseSGroupV2000SLBLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseV3000Array
std::vector< T > ParseV3000Array(std::stringstream &stream)
RDKit::SGroupParsing::ParseV3000SAPLabel
void ParseV3000SAPLabel(RWMol *mol, SubstanceGroup *sgroup, std::stringstream &stream)
RDKit::SGroupParsing::ParseSGroupV2000SDSLine
void ParseSGroupV2000SDSLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupV2000STYLine
void ParseSGroupV2000STYLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit
Std stuff.
Definition: Atom.h:30
RDKit::SGroupParsing::ParseSGroupV2000SDILine
void ParseSGroupV2000SDILine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupV2000SCLLine
void ParseSGroupV2000SCLLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupV2000VectorDataLine
void ParseSGroupV2000VectorDataLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupV2000SBTLine
void ParseSGroupV2000SBTLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupV2000SDDLine
void ParseSGroupV2000SDDLine(IDX_TO_SGROUP_MAP &sGroupMap, RWMol *mol, const std::string &text, unsigned int line)
RDKit::SGroupParsing::ParseSGroupIntField
unsigned int ParseSGroupIntField(const std::string &text, unsigned int line, unsigned int &pos, bool isFieldCounter=false)
RDKit::SGroupParsing::IDX_TO_STR_VECT_MAP
std::map< int, STR_VECT > IDX_TO_STR_VECT_MAP
Definition: MolSGroupParsing.h:17
RDKit::SGroupParsing::IDX_TO_SGROUP_MAP
std::map< int, SubstanceGroup > IDX_TO_SGROUP_MAP
Definition: MolSGroupParsing.h:16