EMAN2
pdbreader.h
Go to the documentation of this file.
00001 
00005 /*
00006  * Author: Muthu Alagappan, 07/14/2009, (m.alagappan901@gmail.com)
00007  * Copyright (c) 2000-2006 Baylor College of Medicine
00008  *
00009  * This software is issued under a joint BSD/GNU license. You may use the
00010  * source code in this file under either license. However, note that the
00011  * complete EMAN2 and SPARX software packages have some GPL dependencies,
00012  * so you are responsible for compliance with the licenses of these packages
00013  * if you opt to use BSD licensing. The warranty disclaimer below holds
00014  * in either instance.
00015  *
00016  * This complete copyright notice must be included in any revised version of the
00017  * source code. Additional authorship citations may be added, but existing
00018  * author citations must be preserved.
00019  *
00020  * This program is free software; you can redistribute it and/or modify
00021  * it under the terms of the GNU General Public License as published by
00022  * the Free Software Foundation; either version 2 of the License, or
00023  * (at your option) any later version.
00024  *
00025  * This program is distributed in the hope that it will be useful,
00026  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00027  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00028  * GNU General Public License for more details.
00029  *
00030  * You should have received a copy of the GNU General Public License
00031  * along with this program; if not, write to the Free Software
00032  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00033  *
00034  * */
00035 
00036 #ifndef eman_pdbreader_h_
00037 #define eman_pdbreader_h_
00038 
00039 #include "emdata.h"
00040 #include "transform.h"
00041 #include "pointarray.h"
00042 
00043 #if defined NFFT || NFFT2
00044 extern "C"
00045 {
00046         #include "nfft.h"
00047         #include "utils.h"
00048 }
00049 #endif
00050 
00051 #include <sys/stat.h>
00052 #include <vector>
00053 
00054 
00055 namespace EMAN
00056 {
00058         class PDBReader
00059         {
00060                 public:
00061                 enum Density2PointsArrayAlgorithm
00062                 {
00063                         PEAKS_SUB, PEAKS_DIV, KMEANS
00064                 };
00065 
00066                 public:
00067                 PDBReader();
00068                 explicit PDBReader(int nn);
00069                 ~PDBReader();
00070                 void zero();
00071                 PDBReader *copy();
00072                 PDBReader & operator=(PDBReader & pa);
00073                 size_t get_number_points() const;
00074                 void set_number_points(size_t nn);
00075 
00080                 bool read_from_pdb(const char *file);
00081 
00086                 void save_to_pdb(const char *file) const;
00087 
00092                 double *get_points_array();
00093 
00098                 void set_points_array(double *p);
00099 
00104                 vector<float> get_points();
00105 
00109                 void right_transform(const Transform& transform);
00110                 PointArray* makePointArray (const PDBReader& p);
00111 
00112                 vector<float> get_x();
00113                 vector<float> get_y();
00114                 vector<float> get_z();
00115                 vector<string> get_atomName();
00116                 vector<string> get_resName();
00117                 vector<int> get_resNum();
00118                 
00119 
00120                 private:
00121                 double *points;
00122                 vector<int> pointInfo;
00123                 vector<string> pWords;
00124                 vector<string> atomName;
00125                 vector<string> residueName;
00126                 vector<string> chainId;
00127                 vector<string> elementSym;
00128                 vector<string> tail;
00129                 vector<string> head;
00130                 vector<string> lines;
00131                 size_t n;
00132                 int ter_stop;
00133                 int count_stop;
00134 
00135                 vector<float> x;
00136                 vector<float> y;
00137                 vector<float> z;
00138                 vector<int> resNum;
00139         };
00140 }
00141 
00142 #endif