File: simpleBase.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 (129 lines) | stat: -rw-r--r-- 2,951 bytes parent folder | download | duplicates (8)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// -*- Mode: C++; tab-width: 2: -*-
// vi: set ts=2:
//
//

#ifndef BALL_QSAR_SIMPLEBASE_H
#define BALL_QSAR_SIMPLEBASE_H

#ifndef BALL_QSAR_DESCRIPTOR_H
#include <BALL/QSAR/descriptor.h>
#endif

namespace BALL
{
	/** QSAR molecular simple descriptors base class, this
			class implements some methods to calculate simple
			descriptors.
			\\
	*/
	class BALL_EXPORT SimpleBase
		:	public Descriptor
	{
		public:
	
		/** @name Constructors and Destructors
		*/
		//@{
		/** Default constructor
		*/
		SimpleBase();

		/** Copy constructor
		*/
		SimpleBase(const SimpleBase& sb);

		/** Named constructor
		*/
		SimpleBase(const String& name);

		/** Named unit constructor
		*/
		SimpleBase(const String& name, const String& unit);

		/** Destructor
		*/
		virtual ~SimpleBase();
		//@}
		
		/** @name Assignment
		*/
		//@{
		/** Assignment operator
		*/
		virtual SimpleBase& operator = (const SimpleBase& sb);
		
		
		/** @name Accessors
		*/
		//@{
		void computeAllDescriptors(AtomContainer& ac);
		
		/** allows to set the data-folder without using BALL_DATA_PATH enviroment variable, which is useful for standalone applications */
		void setDataFolder(const char* folder);
		//@}


		protected:

		/** @name Predicates
		*/
		//@{
		/*_ Returns true if the data is calculated already, and the data is still correct,
				otherwise false is returned
				@param molecule to examine
		*/
		bool isValid_(AtomContainer& ac);
		//@}

		/** @name Accessors
		*/
		//@{
		/*_ Performs the calculation of some of the simple descriptors.
		*/
		void calculate_(AtomContainer& ac);
		//@}
		
		
		private:
		
		/** @name Accessors
		*/
		
		//@{
		/*_ This method calculates the pmi of the x, y and z axis, return the pmi 
				@param referenced double which holds the pmi x component after calculation
				@param referenced double which holds the pmi y component after calculation
				@param referenced double which holds the pmi z component after calculation
				@param molecule from which the pmi is calculated
		*/
		double calcPrincipalMomentOfInertia_(double& pmi_x, double& pmi_y, double& pmi_z, AtomContainer& ac);
		
		/*_ Helper function that reads the atomic polarizabilities 
				from a file from the data section of BALL. It is called from
				getAtomicPolarizability_ and reads into a static variable, hence
				it is read one time per instance.
		*/
		void readAtomicPolarizabilities_(std::vector<float>& polarizabilities);

		/*_ Method which returns the atomic polarizability of the element given as parameter
				@param the atomic number of the element
		*/
		float getAtomicPolarizability_(int atomic_number);
		//@}

		/** @name Predicates
		*/
		//@{
		/*_ Predicate that returns true if the atom is a carbon and in an
				exclusively aromatic or aliphatic surrounding, means is only
				bound to carbon an hydrogen!
		*/
		bool isHydrophobic_(const Atom* atom) const;
		
		String data_folder_;
		//@}
	};
} // namespace BALL

#endif