1 |
tim |
746 |
/********************************************************************** |
2 |
|
|
Copyright (C) 2005 by Chris Morley |
3 |
|
|
|
4 |
|
|
This program is free software; you can redistribute it and/or modify |
5 |
|
|
it under the terms of the GNU General Public License as published by |
6 |
|
|
the Free Software Foundation version 2 of the License. |
7 |
|
|
|
8 |
|
|
This program is distributed in the hope that it will be useful, |
9 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 |
|
|
GNU General Public License for more details. |
12 |
|
|
***********************************************************************/ |
13 |
|
|
#ifndef OB_FINGERPRINTFORMAT_HPP |
14 |
|
|
#define OB_FINGERPRINTFORMAT_HPP |
15 |
|
|
|
16 |
|
|
#include "mol.hpp" |
17 |
|
|
#include "obconversion.hpp" |
18 |
|
|
#include "obmolecformat.hpp" |
19 |
|
|
#include "fingerprint.hpp" |
20 |
|
|
#include <vector> |
21 |
|
|
#include <string> |
22 |
|
|
#include <iomanip> |
23 |
|
|
|
24 |
|
|
using namespace std; |
25 |
|
|
namespace OpenBabel { |
26 |
|
|
|
27 |
|
|
/// \brief Constructs and displays fingerprints. For details see OBFingerprint class |
28 |
|
|
class FingerprintFormat : public OBMoleculeFormat |
29 |
|
|
{ |
30 |
|
|
public: |
31 |
|
|
//Register this format type ID |
32 |
|
|
FingerprintFormat() {OBConversion::RegisterFormat("fpt",this);} |
33 |
|
|
|
34 |
|
|
virtual const char* Description() //required |
35 |
|
|
{ return |
36 |
|
|
"Fingerprint format\n \ |
37 |
|
|
Constructs and displays fingerprints and (for multiple input objects)\n \ |
38 |
|
|
the Tanimoto coefficient and whether a superstructure of the first object\n \ |
39 |
|
|
Options e.g. -xfFP3 -xn128\n \ |
40 |
|
|
f<id> fingerprint type\n \ |
41 |
|
|
N# fold to specified number of bits, 32, 64, 128, etc.\n \ |
42 |
|
|
h hex output when multiple molecules\n \ |
43 |
|
|
F displays the available fingerprint types\n \ |
44 |
|
|
"; |
45 |
|
|
}; |
46 |
|
|
|
47 |
|
|
virtual unsigned int Flags(){return NOTREADABLE;}; |
48 |
|
|
virtual bool WriteMolecule(OBBase* pOb, OBConversion* pConv); |
49 |
|
|
|
50 |
|
|
private: |
51 |
|
|
vector<unsigned int> firstfp; |
52 |
|
|
string firstname; |
53 |
|
|
bool IsPossibleSubstructure(vector<unsigned int>Mol, vector<unsigned int>Frag); |
54 |
|
|
}; |
55 |
|
|
|
56 |
|
|
} |
57 |
|
|
#endif |