66 unsigned int nAtoms = coords.GetNumber_of_points();
67 TRACEMSG(
"model has " << nAtoms <<
" atomic coords");
69 bool haveTemp = coords.IsSetTemperature_factors(),
70 haveOccup = coords.IsSetOccupancies(),
71 haveAlt = coords.IsSetAlternate_conf_ids();
74 if (coords.GetAtoms().GetMolecule_ids().size()!=nAtoms ||
75 coords.GetAtoms().GetResidue_ids().size()!=nAtoms ||
76 coords.GetAtoms().GetAtom_ids().size()!=nAtoms ||
77 coords.GetSites().GetX().size()!=nAtoms ||
78 coords.GetSites().GetY().size()!=nAtoms ||
79 coords.GetSites().GetZ().size()!=nAtoms ||
81 ((coords.GetTemperature_factors().IsIsotropic() &&
82 coords.GetTemperature_factors().GetIsotropic().GetB().size()!=nAtoms) ||
83 (coords.GetTemperature_factors().IsAnisotropic() &&
84 (coords.GetTemperature_factors().GetAnisotropic().GetB_11().size()!=nAtoms ||
85 coords.GetTemperature_factors().GetAnisotropic().GetB_12().size()!=nAtoms ||
86 coords.GetTemperature_factors().GetAnisotropic().GetB_13().size()!=nAtoms ||
87 coords.GetTemperature_factors().GetAnisotropic().GetB_22().size()!=nAtoms ||
88 coords.GetTemperature_factors().GetAnisotropic().GetB_23().size()!=nAtoms ||
89 coords.GetTemperature_factors().GetAnisotropic().GetB_33().size()!=nAtoms)))) ||
90 (haveOccup && coords.GetOccupancies().GetO().size()!=nAtoms) ||
91 (haveAlt && coords.GetAlternate_conf_ids().Get().size()!=nAtoms))
92 ERRORMSG(
"AtomSet: confused by list length mismatch");
95 CAtom_pntrs::TMolecule_ids::const_iterator
96 i_mID = coords.GetAtoms().GetMolecule_ids().begin();
97 CAtom_pntrs::TResidue_ids::const_iterator
98 i_rID = coords.GetAtoms().GetResidue_ids().begin();
99 CAtom_pntrs::TAtom_ids::const_iterator
100 i_aID = coords.GetAtoms().GetAtom_ids().begin();
103 double siteScale =
static_cast<double>(coords.GetSites().GetScale_factor());
104 CModel_space_points::TX::const_iterator i_X = coords.GetSites().GetX().begin();
105 CModel_space_points::TY::const_iterator i_Y = coords.GetSites().GetY().begin();
106 CModel_space_points::TZ::const_iterator i_Z = coords.GetSites().GetZ().begin();
109 CAtomic_occupancies::TO::const_iterator i_occup;
110 double occupScale = 0.0;
112 occupScale =
static_cast<double>(coords.GetOccupancies().GetScale_factor());
113 i_occup = coords.GetOccupancies().GetO().begin();
117 CAlternate_conformation_ids::Tdata::const_iterator i_alt;
118 if (haveAlt) i_alt = coords.GetAlternate_conf_ids().Get().begin();
121 double tempScale = 0.0;
122 CIsotropic_temperature_factors::TB::const_iterator i_tempI;
123 CAnisotropic_temperature_factors::TB_11::const_iterator i_tempA11;
124 CAnisotropic_temperature_factors::TB_12::const_iterator i_tempA12;
125 CAnisotropic_temperature_factors::TB_13::const_iterator i_tempA13;
126 CAnisotropic_temperature_factors::TB_22::const_iterator i_tempA22;
127 CAnisotropic_temperature_factors::TB_23::const_iterator i_tempA23;
128 CAnisotropic_temperature_factors::TB_33::const_iterator i_tempA33;
130 if (coords.GetTemperature_factors().IsIsotropic()) {
131 tempScale =
static_cast<double>
132 (coords.GetTemperature_factors().GetIsotropic().GetScale_factor());
133 i_tempI = coords.GetTemperature_factors().GetIsotropic().GetB().begin();
135 tempScale =
static_cast<double>
136 (coords.GetTemperature_factors().GetAnisotropic().GetScale_factor());
137 i_tempA11 = coords.GetTemperature_factors().GetAnisotropic().GetB_11().begin();
138 i_tempA12 = coords.GetTemperature_factors().GetAnisotropic().GetB_12().begin();
139 i_tempA13 = coords.GetTemperature_factors().GetAnisotropic().GetB_13().begin();
140 i_tempA22 = coords.GetTemperature_factors().GetAnisotropic().GetB_22().begin();
141 i_tempA23 = coords.GetTemperature_factors().GetAnisotropic().GetB_23().begin();
142 i_tempA33 = coords.GetTemperature_factors().GetAnisotropic().GetB_33().begin();
147 if (!GetParentOfType(&constObject))
return;
151 for (
unsigned int i=0;
i<nAtoms; ++
i) {
154 atom->
site.
x = (
static_cast<double>(*(i_X++)))/siteScale;
155 atom->
site.
y = (
static_cast<double>(*(i_Y++)))/siteScale;
156 atom->
site.
z = (
static_cast<double>(*(i_Z++)))/siteScale;
158 atom->
occupancy = (
static_cast<double>(*(i_occup++)))/occupScale;
162 if (coords.GetTemperature_factors().IsIsotropic()) {
164 (
static_cast<double>(*(i_tempI++)))/tempScale;
167 (
static_cast<double>(*(i_tempA11++))) +
168 (
static_cast<double>(*(i_tempA12++))) +
169 (
static_cast<double>(*(i_tempA13++))) +
170 (
static_cast<double>(*(i_tempA22++))) +
171 (
static_cast<double>(*(i_tempA23++))) +
172 (
static_cast<double>(*(i_tempA33++)))) / (tempScale * 6.0);
188 if (atomMap.find(
key) != atomMap.end()) {
189 AtomAltList::const_iterator i_atom, e=atomMap[
key].end();
190 for (i_atom=atomMap[
key].begin(); i_atom!=e; ++i_atom) {
191 if ((*i_atom)->altConfID == atom->
altConfID)
192 ERRORMSG(
"confused by multiple atoms of same pntr+altConfID");
195 atomMap[
key].push_back(atom);
198 ", y " << atom->
site.
y <<
199 ", z " << atom->
site.
z <<
201 ", altConfId '" << atom->
altConfID <<
"'" <<
206 if (haveAlt && coords.IsSetConf_ensembles()) {
207 CAtomic_coordinates::TConf_ensembles::const_iterator i_ensemble,
208 e_ensemble = coords.GetConf_ensembles().end();
209 for (i_ensemble=coords.GetConf_ensembles().begin(); i_ensemble!=e_ensemble; ++i_ensemble) {
211 string *ensembleStr =
new string();
212 CConformation_ensemble::TAlt_conf_ids::const_iterator i_altIDs,
215 i_altIDs!=e_altIDs; ++i_altIDs) {
216 (*ensembleStr) += i_altIDs->Get()[0];
218 ensembles.push_back(ensembleStr);
219 TRACEMSG(
"alt conf ensemble '" << (*ensembleStr) <<
"'");
228 delete const_cast<string *
>(*i);
239 EnsembleList::const_iterator e, ee=
ensembles.end();
241 if (*e == ensemble)
break;
244 ERRORMSG(
"AtomSet::SetActiveEnsemble received invalid ensemble");
253 bool getAny,
bool suppressWarning)
const
256 if (atomConfs ==
atomMap.end()) {
257 if (!suppressWarning)
258 WARNINGMSG(
"can't find atom(s) from pointer (" << ap.
mID <<
','
259 << ap.
rID <<
',' << ap.
aID <<
')');
262 AtomAltList::const_iterator atom = atomConfs->second.begin();
268 AtomAltList::const_iterator e = atomConfs->second.end();
269 for (; atom!=e; ++atom) {
275 if (getAny)
return atomConfs->second.front();
282 averageTemperature(NO_TEMPERATURE),
283 occupancy(NO_OCCUPANCY),
284 altConfID(NO_ALTCONFID)
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
double averageTemperature
static const double NO_TEMPERATURE
static const double NO_OCCUPANCY
static const char NO_ALTCONFID
AtomCoord(StructureBase *parent)
const AtomCoord * GetAtom(const AtomPntr &atom, bool getAny=false, bool suppressWarning=false) const
const std::string * activeEnsemble
AtomPntrKey MakeKey(const AtomPntr &ap) const
std::pair< int, std::pair< int, int > > AtomPntrKey
bool SetActiveEnsemble(const std::string *ensemble)
static const double NO_TEMPERATURE
static string MakeKey(CScoreValue const &)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
const TAlt_conf_ids & GetAlt_conf_ids(void) const
Get the Alt_conf_ids member data.
const TYPE & Get(const CNamedParameterList *param)
const struct ncbi::grid::netcache::search::fields::KEY key