File: rGroupAssembler.h

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 239,888 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; makefile: 95
file content (48 lines) | stat: -rw-r--r-- 1,510 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// ----------------------------------------------------
// $Maintainer: Marc Röttig $
// $Authors: Michael Betz, Marc Röttig $
// ----------------------------------------------------

#ifndef BALL_STRUCTURE_RGROUP_ASSEMBLER_H
#define BALL_STRUCTURE_RGROUP_ASSEMBLER_H

#include <map>
#include <vector>
#include <BALL/KERNEL/forEach.h>
#include <BALL/STRUCTURE/smilesParser.h>
#include <BALL/KERNEL/molecule.h>
#include <BALL/KERNEL/system.h>
#include <BALL/DATATYPE/string.h>
#include <BALL/KERNEL/atom.h>


namespace BALL
{
		class BALL_EXPORT RGroupAssembler
		{
			public:
				RGroupAssembler(String& scaffold, std::map<String, std::vector<String> > & rgroups);
				RGroupAssembler(std::vector<String>& scaffolds, std::map<String, std::vector<String> > & rgroups);
				~RGroupAssembler();

				/** Generate the next combination of scaffold + R-group and return this molecule. If there are no more combination to be generated, null is returned. */
				Molecule* generateNextMolecule();

			private:
				void initCounter_();
				bool incrementCounter_();
				void appendMoiety_(AtomContainer* molecule, AtomContainer* moiety, String pm_atom);
				bool isPlacemark_(const String& s);

				std::vector<System*> scaffolds_;
				std::map<String, std::vector<System*> > moieties_;

				unsigned int scaffold_counter_;
				std::map<String, unsigned int> moiety_counter_;
				std::vector<std::map<String, unsigned int> > maxcounter_;

				bool not_finished_;
		};
}

#endif /* BALL_STRUCTURE_RGROUP_ASSEMBLER_H */