EMAN2
pdbreader.h
Go to the documentation of this file.
1/*
2 * Author: Muthu Alagappan, 07/14/2009, (m.alagappan901@gmail.com)
3 * Copyright (c) 2000-2006 Baylor College of Medicine
4 *
5 * This software is issued under a joint BSD/GNU license. You may use the
6 * source code in this file under either license. However, note that the
7 * complete EMAN2 and SPARX software packages have some GPL dependencies,
8 * so you are responsible for compliance with the licenses of these packages
9 * if you opt to use BSD licensing. The warranty disclaimer below holds
10 * in either instance.
11 *
12 * This complete copyright notice must be included in any revised version of the
13 * source code. Additional authorship citations may be added, but existing
14 * author citations must be preserved.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 *
30 * */
31
32#ifndef eman_pdbreader_h_
33#define eman_pdbreader_h_
34
35#include "emdata.h"
36#include "transform.h"
37#include "pointarray.h"
38
39#if defined USE_NFFT || USE_NFFT2
40extern "C"
41{
42 #include "nfft.h"
43 #include "utils.h"
44}
45#endif
46
47#include <sys/stat.h>
48#include <vector>
49
50
51namespace EMAN
52{
55 {
56 public:
58 {
60 };
61
62 public:
63 PDBReader();
64 explicit PDBReader(int nn);
65 ~PDBReader();
66 void zero();
67 PDBReader *copy();
69 size_t get_number_points() const;
70 void set_number_points(size_t nn);
71
76 bool read_from_pdb(const char *file);
77
82 void save_to_pdb(const char *file) const;
83
88 double *get_points_array();
89
94 void set_points_array(double *p);
95
100 vector<float> get_points();
101
105 void right_transform(const Transform& transform);
107
108 vector<float> get_x();
109 vector<float> get_y();
110 vector<float> get_z();
111 vector<string> get_atomName();
112 vector<string> get_resName();
113 vector<int> get_resNum();
114
115
116 private:
117 double *points;
118 vector<int> pointInfo;
119 vector<string> pWords;
120 vector<string> atomName;
121 vector<string> residueName;
122 vector<string> chainId;
123 vector<string> elementSym;
124 vector<string> tail;
125 vector<string> head;
126 vector<string> lines;
127 size_t n;
130
131 vector<float> x;
132 vector<float> y;
133 vector<float> z;
134 vector<int> resNum;
135 };
136}
137
138#endif
PointArray defines a double array of points with values in a 3D space.
Definition: pdbreader.h:55
bool read_from_pdb(const char *file)
Reads and parses all information from file.
Definition: pdbreader.cpp:163
vector< string > elementSym
Definition: pdbreader.h:123
vector< int > get_resNum()
Definition: pdbreader.cpp:157
PDBReader * copy()
Definition: pdbreader.cpp:71
vector< float > z
Definition: pdbreader.h:133
vector< string > chainId
Definition: pdbreader.h:122
vector< float > get_y()
Definition: pdbreader.cpp:139
void save_to_pdb(const char *file) const
Saves all atom information into a pdb in the official format.
Definition: pdbreader.cpp:280
vector< string > head
Definition: pdbreader.h:125
vector< float > x
Definition: pdbreader.h:131
vector< float > get_z()
Definition: pdbreader.cpp:145
vector< float > y
Definition: pdbreader.h:132
vector< string > lines
Definition: pdbreader.h:126
vector< string > pWords
Definition: pdbreader.h:119
PointArray * makePointArray(const PDBReader &p)
Definition: pdbreader.cpp:331
vector< string > atomName
Definition: pdbreader.h:120
void set_number_points(size_t nn)
Definition: pdbreader.cpp:105
vector< string > tail
Definition: pdbreader.h:124
void right_transform(const Transform &transform)
Does Transform*v as opposed to v*Transform (as in the transform function)
Definition: pdbreader.cpp:320
double * points
Definition: pdbreader.h:117
vector< float > get_points()
Returns all x,y,z triplets packed into a vector<float>
Definition: pdbreader.cpp:308
void set_points_array(double *p)
Allows the user to set the double array of points.
Definition: pdbreader.cpp:118
vector< int > resNum
Definition: pdbreader.h:134
Density2PointsArrayAlgorithm
Definition: pdbreader.h:58
vector< string > get_resName()
Definition: pdbreader.cpp:153
double * get_points_array()
Returns the double array of points.
Definition: pdbreader.cpp:113
PDBReader & operator=(PDBReader &pa)
Definition: pdbreader.cpp:90
vector< string > residueName
Definition: pdbreader.h:121
vector< int > pointInfo
Definition: pdbreader.h:118
size_t get_number_points() const
Definition: pdbreader.cpp:99
vector< string > get_atomName()
Definition: pdbreader.cpp:149
vector< float > get_x()
Definition: pdbreader.cpp:126
PointArray defines a double array of points with values in a 3D space.
Definition: pointarray.h:52
A Transform object is a somewhat specialized object designed specifically for EMAN2/Sparx storage of ...
Definition: transform.h:75
E2Exception class.
Definition: aligner.h:40