00001 // -*- mode: c++; -*- 00002 // 00003 //The Biomolecule Toolkit (BTK) is a C++ library for use in the 00004 //modeling, analysis, and design of biological macromolecules. 00005 //Copyright (C) 2001, Eric Alm <ealm3141@users.sourceforge.net> 00006 // 00007 //This program is free software; you can redistribute it and/or modify 00008 //it under the terms of the GNU Lesser General Public License as published 00009 //by the Free Software Foundation; either version 2.1 of the License, or (at 00010 //your option) any later version. 00011 // 00012 //This program is distributed in the hope that it will be useful, but 00013 //WITHOUT ANY WARRANTY; without even the implied warranty of 00014 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 //Lesser General Public License for more details. 00016 // 00017 //You should have received a copy of the GNU Lesser General Public License 00018 //along with this program; if not, write to the Free Software Foundation, 00019 //Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 00021 //pdb_reader.h 00022 00023 /*** PDBReader: 00024 00025 This class is designed to read in PDB files. 00026 00027 Its scope is limited to the folowing tasks: 00028 - read and parse every ATOM and HETATOM line into a record 00029 - return one polymer chain at a time 00030 - filter out all but the requested chain 00031 - provide the list of chains, the pdb header, and the remarks 00032 00033 TODO: add this functionallity 00034 - fix non-standard names for standard atoms?? 00035 - handle multiple models in a pdb (NMR structures) 00036 00037 If you want more specific behaviour, write a wrapper. 00038 00039 Many protein-specific fixes are relegated to later processing 00040 in pdb_reader customers, including renumbering residues, 00041 checking for continuity, and rebuilding missing atoms. 00042 00043 ***/ 00044 00045 #ifndef PDB_READER_H 00046 #define PDB_READER_H 00047 00048 #include "pdb_atom.h" 00049 00050 #include <iosfwd> 00051 #include <string> 00052 #include <vector> 00053 00054 00055 namespace BTK { 00056 00057 class PDBReader { 00058 00059 public: 00060 PDBReader(std::string const & filename) : 00061 _filename(filename), _stream(NULL), _buffer(), 00062 _model_loaded(false), _stream_loaded(false){} 00063 PDBReader(std::istream & stream) : 00064 _filename(), _stream(&stream), _buffer(), 00065 _model_loaded(false), _stream_loaded(false){} 00066 ~PDBReader(); 00067 00068 std::string get_header(); 00069 std::vector<PDBAtom> get_chain(const unsigned chain_index); 00070 std::vector<PDBAtom> get_chain(const char chain_id); 00071 // std::vector<PDBAtom> get_next_chain(); 00072 // std::vector<PDBAtom> get_chains(int chain_id=' '); 00073 // std::vector<string> get_remarks(); 00074 std::vector<char> get_chain_labels(); 00075 00077 // void SearchPDBPath(char *filename); // find the pdb file in 00078 00079 private: 00080 00081 void load_stream(); 00082 void load_model(); 00083 00084 std::string _filename; 00085 std::istream *_stream; 00086 std::vector<std::string> _buffer; 00087 bool _model_loaded; //keep track of whether data was read 00088 bool _stream_loaded; //keep track of whether stream is open 00089 }; 00090 00091 } 00092 00093 #endif // PDB_READER_H
1.3.6