Ignore:
Timestamp:
Dec 16, 2010, 5:32:18 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
1d02fe3
Parents:
24f128
git-author:
Frederik Heber <heber@…> (12/07/10 12:54:42)
git-committer:
Frederik Heber <heber@…> (12/16/10 17:32:18)
Message:

PdbParser is now complete with respect to additionalAtomData.

  • serial, name, resName, resSeq, element, and charge are updated if changed, otherwise we use values from PdbAtomInfoContainer.
  • PdbParser::saveLine() completely uses information from PdbAtomInfoContainer.

Testchanges:

  • Simple_configuration/2/post/test.pdb updated as we are now closer to real PDB format also concerning alignment and the resName changed again.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/PdbAtomInfoContainer.cpp

    r24f128 r16462f  
    2424#include "Helpers/toString.hpp"
    2525//#include "Helpers/Verbose.hpp"
     26#include "LinearAlgebra/Vector.hpp"
    2627#include "PdbAtomInfoContainer.hpp"
    2728
    2829
    2930PdbAtomInfoContainer::PdbAtomInfoContainer() :
     31  token("ATOM"),
    3032  serial(0),
    3133  name("-"),
    32   altloc('0'),
     34  altLoc('0'),
    3335  resName("-"),
    3436  chainID('0'),
     
    3739  occupancy(0.),
    3840  tempFactor(0.),
     41  element(""),
    3942  charge(0)
    4043{}
     
    4649{
    4750  switch (key) {
     51    case PdbKey::token :
     52      ScanKey(token, value);
     53      break;
    4854    case PdbKey::serial :
    4955      ScanKey(serial, value);
     
    5258      ScanKey(name, value);
    5359      break;
    54     case PdbKey::altloc :
    55       ScanKey(altloc, value);
     60    case PdbKey::altLoc :
     61      ScanKey(altLoc, value);
    5662      break;
    5763    case PdbKey::resName :
     
    6773      ScanKey(iCode, value);
    6874      break;
     75    case PdbKey::X :
     76      ScanKey(XYZ[0], value);
     77      break;
     78    case PdbKey::Y :
     79      ScanKey(XYZ[1], value);
     80      break;
     81    case PdbKey::Z :
     82      ScanKey(XYZ[2], value);
     83      break;
    6984    case PdbKey::occupancy :
    7085      ScanKey(occupancy, value);
     
    7287    case PdbKey::tempFactor :
    7388      ScanKey(tempFactor, value);
     89      break;
     90    case PdbKey::element :
     91      ScanKey(element, value);
    7492      break;
    7593    case PdbKey::charge :
     
    82100}
    83101
    84 std::string PdbAtomInfoContainer::get(const PdbKey::PdbDataKey key) const
     102template <>
     103std::string PdbAtomInfoContainer::get<std::string>(const PdbKey::PdbDataKey key) const
    85104{
    86105  switch (key) {
     106    case PdbKey::token :
     107      return toString(token);
    87108    case PdbKey::serial :
    88109      return toString(serial);
    89110    case PdbKey::name :
    90111      return toString(name);
    91     case PdbKey::altloc :
    92       return toString(altloc);
     112    case PdbKey::altLoc :
     113      return toString(altLoc);
    93114    case PdbKey::resName :
    94115      return toString(resName);
     
    99120    case PdbKey::iCode :
    100121      return toString(iCode);
     122    case PdbKey::X :
     123      return toString(XYZ[0]);
     124    case PdbKey::Y :
     125      return toString(XYZ[1]);
     126    case PdbKey::Z :
     127      return toString(XYZ[2]);
    101128    case PdbKey::occupancy :
    102129      return toString(occupancy);
    103130    case PdbKey::tempFactor :
    104131      return toString(tempFactor);
     132    case PdbKey::element :
     133      return toString(element);
    105134    case PdbKey::charge :
    106135      return toString(charge);
     
    111140}
    112141
     142template <>
     143int PdbAtomInfoContainer::get<int>(const PdbKey::PdbDataKey key) const
     144{
     145  switch (key) {
     146    case PdbKey::serial :
     147      return serial;
     148    case PdbKey::resSeq :
     149      return resSeq;
     150    case PdbKey::charge :
     151      return charge;
     152    default :
     153      std::cout << "Unknown key or not presentable as int: " << key << std::endl;
     154      return 0;
     155  }
     156}
     157
     158template <>
     159double PdbAtomInfoContainer::get<double>(const PdbKey::PdbDataKey key) const
     160{
     161  switch (key) {
     162    case PdbKey::X :
     163      return XYZ[0];
     164    case PdbKey::Y :
     165      return XYZ[1];
     166    case PdbKey::Z :
     167      return XYZ[2];
     168    case PdbKey::occupancy :
     169      return occupancy;
     170    case PdbKey::tempFactor :
     171      return tempFactor;
     172    default :
     173      std::cout << "Unknown key or not presentable as double: " << key << std::endl;
     174      return 0.;
     175  }
     176}
Note: See TracChangeset for help on using the changeset viewer.