00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2011 by the OpenStructure authors 00005 // 00006 // This library is free software; you can redistribute it and/or modify it under 00007 // the terms of the GNU Lesser General Public License as published by the Free 00008 // Software Foundation; either version 3.0 of the License, or (at your option) 00009 // any later version. 00010 // This library is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00013 // details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, Inc., 00017 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 //------------------------------------------------------------------------------ 00019 #ifndef OST_MOL_ALG_PDBIZE_HH 00020 #define OST_MOL_ALG_PDBIZE_HH 00021 00022 #include <ost/mol/entity_view.hh> 00023 #include <ost/mol/entity_handle.hh> 00024 #include <ost/mol/residue_handle.hh> 00025 #include <ost/seq/sequence_list.hh> 00026 #include "module_config.hh" 00027 00028 namespace ost { namespace mol { namespace alg { 00029 00030 00031 extern const char* POLYPEPTIDE_CHAIN_NAMES; 00032 extern const char* LIGAND_CHAIN_NAME; 00033 extern const char* WATER_CHAIN_NAME; 00034 00035 class DLLEXPORT_OST_MOL_ALG PDBize { 00036 public: 00037 explicit PDBize(int min_polymer_size=10): 00038 min_polymer_size_(min_polymer_size), ent_(mol::CreateEntity()), 00039 curr_chain_name_(POLYPEPTIDE_CHAIN_NAMES), needs_adjustment_(false), 00040 last_rnum_(0) 00041 {} 00042 00043 void Add(mol::EntityView asu, const geom::Mat4List& transforms, 00044 seq::SequenceList seqres); 00045 00046 EntityHandle Finish(bool shift_to_fit=true); 00047 private: 00048 int min_polymer_size_; 00049 EntityHandle ent_; 00050 ChainHandle ligand_chain_; 00051 ChainHandle water_chain_; 00052 const char* curr_chain_name_; 00053 bool needs_adjustment_; 00054 int last_rnum_; 00055 ResNum last_water_rnum_; 00056 std::map<ResidueHandle,ResidueHandle> dst_to_src_map_; 00057 }; 00058 00059 }}} 00060 #endif 00061