BALL  1.4.1
simpleBase.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2: -*-
00002 // vi: set ts=2:
00003 //
00004 //
00005 
00006 #ifndef BALL_QSAR_SIMPLEBASE_H
00007 #define BALL_QSAR_SIMPLEBASE_H
00008 
00009 #ifndef BALL_QSAR_DESCRIPTOR_H
00010 #include <BALL/QSAR/descriptor.h>
00011 #endif
00012 
00013 namespace BALL
00014 {
00020   class BALL_EXPORT SimpleBase
00021     : public Descriptor
00022   {
00023     public:
00024   
00030     SimpleBase();
00031 
00034     SimpleBase(const SimpleBase& sb);
00035 
00038     SimpleBase(const String& name);
00039 
00042     SimpleBase(const String& name, const String& unit);
00043 
00046     virtual ~SimpleBase();
00048     
00054     virtual SimpleBase& operator = (const SimpleBase& sb);
00055     
00056     
00060     void computeAllDescriptors(AtomContainer& ac);
00061     
00063     void setDataFolder(const char* folder);
00065 
00066 
00067     protected:
00068 
00072     /*_ Returns true if the data is calculated already, and the data is still correct,
00073         otherwise false is returned
00074         @param molecule to examine
00075     */
00076     bool isValid_(AtomContainer& ac);
00078 
00082     /*_ Performs the calculation of some of the simple descriptors.
00083     */
00084     void calculate_(AtomContainer& ac);
00086     
00087     
00088     private:
00089     
00094     /*_ This method calculates the pmi of the x, y and z axis, return the pmi 
00095         @param referenced double which holds the pmi x component after calculation
00096         @param referenced double which holds the pmi y component after calculation
00097         @param referenced double which holds the pmi z component after calculation
00098         @param molecule from which the pmi is calculated
00099     */
00100     double calcPrincipalMomentOfInertia_(double& pmi_x, double& pmi_y, double& pmi_z, AtomContainer& ac);
00101     
00102     /*_ Helper function that reads the atomic polarizabilities 
00103         from a file from the data section of BALL. It is called from
00104         getAtomicPolarizability_ and reads into a static variable, hence
00105         it is read one time per instance.
00106     */
00107     void readAtomicPolarizabilities_(std::vector<float>& polarizabilities);
00108 
00109     /*_ Method which returns the atomic polarizability of the element given as parameter
00110         @param the atomic number of the element
00111     */
00112     float getAtomicPolarizability_(int atomic_number);
00114 
00118     /*_ Predicate that returns true if the atom is a carbon and in an
00119         exclusively aromatic or aliphatic surrounding, means is only
00120         bound to carbon an hydrogen!
00121     */
00122     bool isHydrophobic_(const Atom* atom) const;
00123     
00124     String data_folder_;
00126   };
00127 } // namespace BALL
00128 
00129 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines