RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
PsfFileSource.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13// Handles retrieval of molecular info from Charmm PSF files.
14
15#ifndef _RBTPSFFILESOURCE_H_
16#define _RBTPSFFILESOURCE_H_
17
18#include "rxdock/BaseMolecularFileSource.h"
19#include "rxdock/CharmmDataSource.h"
20#include "rxdock/ElementFileSource.h"
21#include "rxdock/ParameterFileSource.h"
22
23namespace rxdock {
24
26public:
27 // Constructors
29 const std::string &fileName,
30 const std::string &strMassesFile = GetDataFileName("data", "masses.rtf"),
31 bool bImplHydrogens = true);
32
33 // Default destructor
34 virtual ~PsfFileSource();
35
37 // Override public methods from BaseMolecularDataSource
38 virtual bool isTitleListSupported() { return true; }
39 virtual bool isAtomListSupported() { return true; }
40 virtual bool isCoordinatesSupported() { return false; }
41 virtual bool isBondListSupported() { return true; }
42
43protected:
44 // Pure virtual in BaseFileSource - needs to be defined here
45 virtual void Parse();
46
47private:
48 // Private methods
49 PsfFileSource(); // Disable default constructor
50 PsfFileSource(const PsfFileSource &); // Copy constructor disabled by default
52 operator=(const PsfFileSource &); // Copy assignment disabled by default
53
54 // Sets up all the atomic attributes that are not explicitly stored in the PSF
55 // file
56 void SetupAtomParams();
57 void SetupVdWRadii();
58 void SetupPartialIonicGroups();
59 void RemoveNonPolarHydrogens();
60 // Is atom in same substructure
61 class isSS_eq : public std::function<bool(Atom *)> {
62 const Atom *a1;
63
64 public:
65 explicit isSS_eq(const Atom *aa) : a1(aa) {}
66 bool operator()(const Atom *a2) const {
67 return (a1->GetSubunitName() == a2->GetSubunitName()) &&
68 (a1->GetSubunitId() == a2->GetSubunitId()) &&
69 (a1->GetSegmentName() == a2->GetSegmentName());
70 }
71 };
72
73 // Private data
75 m_spElementData; // Elemental data source for vdW radii etc
76 CharmmDataSourcePtr m_spCharmmData; // Charmm data source for fftype lookup
78 m_spParamSource; // Parameter file source for partial charges etc
79 bool m_bImplHydrogens; // If true, non-hydrogen bonding hydrogens are removed
80};
81
82// useful typedefs
83typedef SmartPtr<PsfFileSource> PsfFileSourcePtr; // Smart pointer
84
85} // namespace rxdock
86
87#endif //_RBTPSFFILESOURCE_H_
Definition Atom.h:49
Definition BaseMolecularFileSource.h:29
Definition PsfFileSource.h:25