Download model/CombinatorialAssembler/BB.h from OneScience-Group/CombFold: direct link, hf CLI and curl.
- Browser
- Download file 3.64 kB
-
https://huggingface.co/OneScience-Group/CombFold/resolve/main/model/CombinatorialAssembler/BB.h
- Command line
-
hf download hf://OneScience-Group/CombFold/model/CombinatorialAssembler/BB.h
-
curl -L -o BB.h https://huggingface.co/OneScience-Group/CombFold/resolve/main/model/CombinatorialAssembler/BB.h
3.64 kB
| class BBConstructor { | |
| // idea taken from | |
| // https://stackoverflow.com/questions/3220009/is-this-key-oriented-access-protection-pattern-a-known-idiom | |
| private: | |
| friend class BBContainer; | |
| BBConstructor() {} | |
| }; | |
| class BB { | |
| public: | |
| friend class SuperBB; | |
| BB(int id, const std::string pdbFilename, int groupID, const ChemLib &lib, float gridResolution, float gridMargins, | |
| float minTempFactor); | |
| // access | |
| int getID() const { return id_; } | |
| BitId bitId() const { return BitId(id_); } | |
| int groupId() const { return groupId_; } | |
| std::string getPDBFileName() const { return pdbFileName_; } | |
| unsigned int getNumOfAtoms() const { return numOfAtoms_; } | |
| const Vector3 &getCM() const { return cm_; } | |
| const float getRadius() const { return maxRadius_; } | |
| const ChemAtom &getChemAtom(int atomIndex) const { return allAtoms_.getChemAtom(atomIndex); } | |
| const ChemAtom &getChemAtomByIndex(int atomIndex) const { return allAtoms_[atomIndex]; } | |
| const Atom &getAtomByResId(unsigned int resId) const { return resIndexToCAAtom.at(resId); } | |
| unsigned int getSurfaceSize() const { return surface_.size(); } | |
| float getDistFromSurface(const Vector3 &v) const { return grid_->getDist(v); } | |
| // This uses BBConstructor to make sure that only BBContainer can call this | |
| void putTransWith(int bbIndex, const std::shared_ptr<TransformationAndScore> &t1, const BBConstructor &) const { | |
| trans_[bbIndex].push_back(t1); | |
| } | |
| void initTrans(unsigned int numberOfBBs, const BBConstructor &) const { | |
| trans_.insert(trans_.begin(), numberOfBBs, std::vector<std::shared_ptr<TransformationAndScore>>()); | |
| } | |
| // TODO: do we still need isPenetrating/maxPenetration ? | |
| bool isPenetrating(const RigidTrans3 &trans, const BB &other, float threshold) const; | |
| float maxPenetration(const RigidTrans3 &trans, const BB &other) const; | |
| void getChainConnectivityConstraints(const BB &bb, | |
| std::vector<std::pair<char, std::pair<int, int>>> &) const; // update | |
| const std::vector<std::shared_ptr<TransformationAndScore>> &getTransformations(int bbIndex) const { | |
| return trans_[bbIndex]; | |
| } | |
| bool isIdent(const BB &otherBB) const; | |
| private: | |
| // after BB is initialized, compute chains and fragment ranges | |
| void computeFragments(float minTempFactor); | |
| private: | |
| // surface points | |
| // Different methods for computing collision | |
| Surface surface_; // shuo | |
| Surface msSurface_; // connolly - dense | |
| // BB id | |
| unsigned int id_; | |
| // transformations to other BBs | |
| // This is the edge in a graph - The result of a patch dock calculation | |
| mutable std::vector<std::vector<std::shared_ptr<TransformationAndScore>>> trans_; | |
| int groupId_; | |
| std::string pdbFileName_; | |
| int numOfAtoms_; | |
| Vector3 cm_; | |
| float maxRadius_; | |
| // chain id and residue numbers for each chain fragment in BB | |
| typedef std::pair<int, int> ResidueRange; | |
| std::vector<std::pair<char, ResidueRange>> fragmentEndpoints_; | |
| public: // TODO | |
| BBGrid *grid_; | |
| ChemMolecule backBone_; | |
| ChemMolecule allAtoms_; | |
| Molecule<Atom> caAtoms_; | |
| std::map<unsigned int, Atom> resIndexToCAAtom; | |
| }; | |