1 |
tim |
746 |
/********************************************************************** |
2 |
|
|
Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc. |
3 |
|
|
Some portions Copyright (C) 2003-2005 Geoffrey R. Hutchison |
4 |
|
|
Some portions Copyright (C) 2004 by Chris Morley |
5 |
|
|
|
6 |
|
|
This program is free software; you can redistribute it and/or modify |
7 |
|
|
it under the terms of the GNU General Public License as published by |
8 |
|
|
the Free Software Foundation version 2 of the License. |
9 |
|
|
|
10 |
|
|
This program is distributed in the hope that it will be useful, |
11 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
|
|
GNU General Public License for more details. |
14 |
|
|
***********************************************************************/ |
15 |
|
|
#ifndef OB_PDBFORMAT_HPP
|
16 |
|
|
#define OB_PDBFORMAT_HPP
|
17 |
|
|
|
18 |
gezelter |
751 |
#include "config.h" |
19 |
tim |
746 |
#include "mol.hpp" |
20 |
|
|
#include "obconversion.hpp" |
21 |
|
|
#include "obmolecformat.hpp" |
22 |
|
|
|
23 |
|
|
#if !HAVE_SNPRINTF |
24 |
|
|
extern "C" int snprintf( char *, size_t, const char *, /* args */ ...); |
25 |
|
|
#endif |
26 |
|
|
|
27 |
|
|
#include <vector> |
28 |
|
|
#include <map> |
29 |
|
|
|
30 |
|
|
#ifdef HAVE_SSTREAM |
31 |
|
|
#include <sstream> |
32 |
|
|
#else |
33 |
|
|
#include <strstream> |
34 |
|
|
#endif |
35 |
|
|
|
36 |
|
|
using namespace std; |
37 |
|
|
namespace OpenBabel |
38 |
|
|
{ |
39 |
|
|
|
40 |
|
|
class PDBFormat : public OBMoleculeFormat |
41 |
|
|
{ |
42 |
|
|
public: |
43 |
|
|
//Register this format type ID |
44 |
|
|
PDBFormat() |
45 |
|
|
{ |
46 |
|
|
OBConversion::RegisterFormat("pdb",this, "chemical/x-pdb"); |
47 |
|
|
OBConversion::RegisterFormat("ent",this, "chemical/x-pdb"); |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
virtual const char* Description() //required |
51 |
|
|
{ |
52 |
|
|
return |
53 |
|
|
"Protein Data Bank format\n \ |
54 |
|
|
Read Options e.g. -as\n\ |
55 |
|
|
s Output single bonds only\n\ |
56 |
|
|
b Disable bonding entirely\n\n"; |
57 |
|
|
}; |
58 |
|
|
|
59 |
|
|
virtual const char* SpecificationURL() |
60 |
|
|
{ return "http://www.rcsb.org/pdb/docs/format/pdbguide2.2/guide2.2_frame.html";}; |
61 |
|
|
|
62 |
|
|
virtual const char* GetMIMEType() |
63 |
|
|
{ return "chemical/x-pdb"; }; |
64 |
|
|
|
65 |
|
|
//Flags() can return be any the following combined by | or be omitted if none apply |
66 |
|
|
// NOTREADABLE READONEONLY NOTWRITABLE WRITEONEONLY |
67 |
|
|
virtual unsigned int Flags() |
68 |
|
|
{ |
69 |
|
|
return READONEONLY; |
70 |
|
|
}; |
71 |
|
|
|
72 |
|
|
//*** This section identical for most OBMol conversions *** |
73 |
|
|
//////////////////////////////////////////////////// |
74 |
|
|
/// The "API" interface functions |
75 |
|
|
virtual bool ReadMolecule(OBBase* pOb, OBConversion* pConv); |
76 |
|
|
virtual bool WriteMolecule(OBBase* pOb, OBConversion* pConv); |
77 |
|
|
|
78 |
|
|
};
|
79 |
|
|
|
80 |
|
|
}
|
81 |
|
|
#endif
|