mirror of
https://github.com/openbabel/openbabel.git
synced 2025-02-25 18:55:23 -06:00
* configure, */Makefile.in: Updates for inchi move and forcefield directory.
This commit is contained in:
17
ChangeLog
17
ChangeLog
@@ -1,10 +1,19 @@
|
||||
2007-01-03 Geoffrey Hutchison <babel@geoffhutchison.net>
|
||||
|
||||
* src/forcefields: New code from Tim for MM2 and Ghemical force fields.
|
||||
|
||||
* include/Makefile.*: Updates for Chris's changes earlier today.
|
||||
|
||||
* include/inchi/*.c: Moved actual inchi source files back to src/.
|
||||
|
||||
* configure, */Makefile.in: Updates for inchi move and forcefield directory.
|
||||
|
||||
2007-01-03 Chris Morley <ob@gaseq.co.uk>
|
||||
|
||||
Update Windows project files. But Python SWIG is not working.
|
||||
* Update Windows project files. But Python SWIG interface isn't
|
||||
working on Windows.
|
||||
|
||||
2007-01-03 Chris Morley <ob@gaseq.co.uk>
|
||||
|
||||
Moved libxml and inchi header files to /include.
|
||||
* Moved libxml and inchi header files to include.
|
||||
|
||||
2006-12-28 Geoffrey Hutchison <babel@geoffhutchison.net>
|
||||
|
||||
|
||||
3
configure
vendored
3
configure
vendored
@@ -23425,7 +23425,7 @@ echo "${ECHO_T}$scandirconst_cast" >&6; }
|
||||
ac_config_commands="$ac_config_commands include/openbabel/babelconfig.h"
|
||||
|
||||
|
||||
ac_config_files="$ac_config_files Makefile data/Makefile src/Makefile src/math/Makefile src/formats/Makefile src/fingerprints/Makefile src/formats/xml/Makefile src/formats/inchi/Makefile src/GUI/Makefile include/Makefile include/openbabel/Makefile include/openbabel/math/Makefile test/Makefile test/cmltest/Makefile tools/Makefile doc/Makefile scripts/Makefile openbabel-2.0.pc"
|
||||
ac_config_files="$ac_config_files Makefile data/Makefile src/Makefile src/math/Makefile src/formats/Makefile src/fingerprints/Makefile src/formats/xml/Makefile src/formats/inchi/Makefile src/forcefields/Makefile src/GUI/Makefile include/Makefile include/openbabel/Makefile include/openbabel/math/Makefile test/Makefile test/cmltest/Makefile tools/Makefile doc/Makefile scripts/Makefile openbabel-2.0.pc"
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
@@ -24092,6 +24092,7 @@ do
|
||||
"src/fingerprints/Makefile") CONFIG_FILES="$CONFIG_FILES src/fingerprints/Makefile" ;;
|
||||
"src/formats/xml/Makefile") CONFIG_FILES="$CONFIG_FILES src/formats/xml/Makefile" ;;
|
||||
"src/formats/inchi/Makefile") CONFIG_FILES="$CONFIG_FILES src/formats/inchi/Makefile" ;;
|
||||
"src/forcefields/Makefile") CONFIG_FILES="$CONFIG_FILES src/forcefields/Makefile" ;;
|
||||
"src/GUI/Makefile") CONFIG_FILES="$CONFIG_FILES src/GUI/Makefile" ;;
|
||||
"include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
|
||||
"include/openbabel/Makefile") CONFIG_FILES="$CONFIG_FILES include/openbabel/Makefile" ;;
|
||||
|
||||
@@ -263,7 +263,8 @@ AC_CONFIG_COMMANDS([include/openbabel/babelconfig.h],
|
||||
AC_OUTPUT(Makefile data/Makefile src/Makefile src/math/Makefile \
|
||||
src/formats/Makefile src/fingerprints/Makefile \
|
||||
src/formats/xml/Makefile src/formats/inchi/Makefile \
|
||||
src/GUI/Makefile include/Makefile include/openbabel/Makefile \
|
||||
src/forcefields/Makefile src/GUI/Makefile \
|
||||
include/Makefile include/openbabel/Makefile \
|
||||
include/openbabel/math/Makefile \
|
||||
test/Makefile test/cmltest/Makefile tools/Makefile \
|
||||
doc/Makefile scripts/Makefile openbabel-2.0.pc)
|
||||
|
||||
@@ -1 +1,8 @@
|
||||
SUBDIRS = openbabel
|
||||
|
||||
# Make sure to install the inchi_api.h header
|
||||
libopenbabelincludedir = $(includedir)/openbabel-2.0/openbabel
|
||||
libopenbabelinclude_HEADERS = inchi_api.h chemdrawcdx.h
|
||||
|
||||
EXTRA_DIST = inchi
|
||||
# .svn directories will be cleaned up by top-level dist-hook
|
||||
@@ -13,6 +13,7 @@
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
@@ -36,7 +37,8 @@ POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
DIST_COMMON = $(libopenbabelinclude_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
@@ -53,6 +55,15 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(libopenbabelincludedir)"
|
||||
libopenbabelincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(libopenbabelinclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
@@ -200,6 +211,11 @@ sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
SUBDIRS = openbabel
|
||||
|
||||
# Make sure to install the inchi_api.h header
|
||||
libopenbabelincludedir = $(includedir)/openbabel-2.0/openbabel
|
||||
libopenbabelinclude_HEADERS = inchi_api.h chemdrawcdx.h
|
||||
EXTRA_DIST = inchi
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -242,6 +258,23 @@ clean-libtool:
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
install-libopenbabelincludeHEADERS: $(libopenbabelinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libopenbabelincludedir)" || $(mkdir_p) "$(DESTDIR)$(libopenbabelincludedir)"
|
||||
@list='$(libopenbabelinclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(libopenbabelincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libopenbabelincludedir)/$$f'"; \
|
||||
$(libopenbabelincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libopenbabelincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-libopenbabelincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(libopenbabelinclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(libopenbabelincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(libopenbabelincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
@@ -419,9 +452,12 @@ distdir: $(DISTFILES)
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile
|
||||
all-am: Makefile $(HEADERS)
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(libopenbabelincludedir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
@@ -465,7 +501,7 @@ info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
install-data-am: install-libopenbabelincludeHEADERS
|
||||
|
||||
install-exec-am:
|
||||
|
||||
@@ -491,7 +527,7 @@ ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
uninstall-am: uninstall-info-am uninstall-libopenbabelincludeHEADERS
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
@@ -501,13 +537,15 @@ uninstall-info: uninstall-info-recursive
|
||||
distclean-recursive distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool \
|
||||
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-info-am
|
||||
install-info-am install-libopenbabelincludeHEADERS install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-recursive mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
|
||||
tags tags-recursive uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-libopenbabelincludeHEADERS
|
||||
|
||||
# .svn directories will be cleaned up by top-level dist-hook
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
@@ -43,7 +43,9 @@ namespace OpenBabel
|
||||
private:
|
||||
std::streambuf * const _internalBuf; //!< the internal streambuf to filter
|
||||
bool _returnChar; //!< whether we've just seen a '\r' character
|
||||
int _chcount;
|
||||
char _buffer[8192];
|
||||
std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which);
|
||||
};
|
||||
|
||||
//! \brief A convenience istream wrapper which calls an internal newlinebuf
|
||||
|
||||
@@ -205,19 +205,18 @@ namespace OpenBabel
|
||||
OBMol *_parent;
|
||||
std::vector<std::vector<unsigned int> > _vangle;
|
||||
std::vector<std::vector<unsigned int> >::iterator _i;
|
||||
std::vector<unsigned int> _ptr;
|
||||
std::vector<unsigned int> _angle;
|
||||
public:
|
||||
|
||||
OBMolAngleIter() :_parent(NULL), _ptr(0) { }
|
||||
OBMolAngleIter() :_parent(NULL) { }
|
||||
OBMolAngleIter(OBMol *mol);
|
||||
OBMolAngleIter(OBMol &mol);
|
||||
OBMolAngleIter(const OBMolAngleIter &ai);
|
||||
|
||||
OBMolAngleIter& operator=(const OBMolAngleIter &ai);
|
||||
operator bool() const { return _ptr.size() != 0; }
|
||||
operator bool() const { return (_i != _vangle.end()); }
|
||||
OBMolAngleIter& operator++();
|
||||
//std::vector<unsigned int> operator->() const { return _ptr; }
|
||||
std::vector<unsigned int> operator*() const { return _ptr; }
|
||||
std::vector<unsigned int> operator*() const { return _angle; }
|
||||
};
|
||||
|
||||
//! \brief Iterate over all torsions in an OBMol
|
||||
@@ -225,38 +224,38 @@ namespace OpenBabel
|
||||
OBMol *_parent;
|
||||
std::vector<std::vector<unsigned int> > _vtorsion;
|
||||
std::vector<std::vector<unsigned int> >::iterator _i;
|
||||
std::vector<unsigned int> _ptr;
|
||||
std::vector<unsigned int> _torsion;
|
||||
public:
|
||||
|
||||
OBMolTorsionIter() :_parent(NULL), _ptr(0) { }
|
||||
OBMolTorsionIter() :_parent(NULL) { }
|
||||
OBMolTorsionIter(OBMol *mol);
|
||||
OBMolTorsionIter(OBMol &mol);
|
||||
OBMolTorsionIter(const OBMolTorsionIter &ai);
|
||||
|
||||
OBMolTorsionIter& operator=(const OBMolTorsionIter &ai);
|
||||
operator bool() const { return _ptr.size() != 0; }
|
||||
operator bool() const { return (_i != _vtorsion.end()); }
|
||||
OBMolTorsionIter& operator++();
|
||||
//std::vector<unsigned int> operator->() const { return _ptr; }
|
||||
std::vector<unsigned int> operator*() const { return _ptr; }
|
||||
std::vector<unsigned int> operator*() const { return _torsion; }
|
||||
};
|
||||
|
||||
//! \brief Iterate over all pairs of atoms (>1-4) in an OBMol
|
||||
class OBAPI OBMolPairIter {
|
||||
OBMol *_parent;
|
||||
std::queue<std::pair<int, int> > _vpair;
|
||||
std::pair<int, int> *_ptr;
|
||||
std::vector<std::vector<unsigned int> > _vpair;
|
||||
std::vector<std::vector<unsigned int> >::iterator _i;
|
||||
std::vector<unsigned int> _pair;
|
||||
|
||||
public:
|
||||
|
||||
OBMolPairIter() :_parent(NULL), _ptr(NULL) { }
|
||||
OBMolPairIter() :_parent(NULL) { }
|
||||
OBMolPairIter(OBMol *mol);
|
||||
OBMolPairIter(OBMol &mol);
|
||||
OBMolPairIter(const OBMolPairIter &ai);
|
||||
|
||||
OBMolPairIter& operator=(const OBMolPairIter &ai);
|
||||
operator bool() const { return _ptr != NULL; }
|
||||
operator bool() const { return (_i != _vpair.end()); }
|
||||
OBMolPairIter& operator++();
|
||||
std::pair<int, int>* operator->() const { return _ptr; }
|
||||
std::pair<int, int>& operator*() const { return *_ptr; }
|
||||
std::vector<unsigned int> operator*() const { return _pair; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ General Public License for more details.
|
||||
namespace OpenBabel
|
||||
{
|
||||
|
||||
//! \class PluginIter pluginiter.h <openbabel/pluginiter.h>
|
||||
//! \brief Template class used to simplify dynamic classes discovered at runtime
|
||||
//! \see openbabel/plugininter.h plugininter.h
|
||||
//! \class PluginIter pluginiter.h <openbabel/pluginiter.h>
|
||||
//! \brief Template class used to simplify dynamic classes discovered at runtime
|
||||
//! \see openbabel/plugininter.h plugininter.h
|
||||
template<typename T>
|
||||
class OBAPI PluginIter
|
||||
{
|
||||
@@ -58,6 +58,8 @@ public:
|
||||
T* FindDefaultType() const { return _default; }
|
||||
|
||||
std::string ID() const { return _itr->first; }
|
||||
|
||||
std::string Description() const { return _itr->second->Description(); }
|
||||
|
||||
void ToStart() { _itr = _map.begin(); }
|
||||
|
||||
@@ -91,7 +93,7 @@ static BaseClass* FindDefaultType(){ return Iter().FindDefaultType();}\
|
||||
#endif //OB_PLUGINITER_H
|
||||
|
||||
/** \file pluginiter.h
|
||||
\brief Simplify 'plugin' classes to be discovered and/or loaded at runtime.
|
||||
\brief Simplify 'plugin' classes to be discovered and/or loaded at runtime.
|
||||
|
||||
The code in this file makes it easy to make 'plugin' classes. These classes are
|
||||
derived from an abstract base class, like OBFingerprint. The derived classes
|
||||
@@ -100,14 +102,14 @@ are only discovered at runtime, so no existing code needs to be changed when
|
||||
adding a new derived class. In some builds the new code can be added or removed
|
||||
by just moving a DLL or so file.
|
||||
|
||||
<h2>Step by step instructions</h2>
|
||||
<h2>Step-by-Step Instructions</h2>
|
||||
|
||||
1) In the header file for YourBaseClass.
|
||||
Make sure to include the plugininter.h header and
|
||||
in the definition of YourBaseClass add the MAKE_PLUGIN macro
|
||||
and a pure virtual function Description().
|
||||
\code
|
||||
#include <openbabel/pluginiter.h>
|
||||
#include <openbabel/plugininter.h>
|
||||
class YourBaseClass
|
||||
{
|
||||
MAKE_PLUGIN(YourBaseClass)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
EXTRA_DIST = OBGUI.h optswx.h selformats.h stdwx.h
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/data \
|
||||
-I$(top_srcdir)/include
|
||||
INCLUDES = -I$(top_srcdir)/data -I$(top_srcdir)/include
|
||||
|
||||
AM_CPPFLAGS = @WX_CPPFLAGS@
|
||||
AM_CXXFLAGS = @WX_CXXFLAGS@
|
||||
|
||||
|
||||
@@ -212,9 +212,7 @@ sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
EXTRA_DIST = OBGUI.h optswx.h selformats.h stdwx.h
|
||||
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/data \
|
||||
-I$(top_srcdir)/include
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/data -I$(top_srcdir)/include
|
||||
AM_CPPFLAGS = @WX_CPPFLAGS@
|
||||
AM_CXXFLAGS = @WX_CXXFLAGS@
|
||||
wxbabel_SOURCES = OBGUI.cpp optswx.cpp stdwx.cpp
|
||||
|
||||
@@ -2,7 +2,7 @@ EXTRA_DIST = \
|
||||
strncasecmp.c snprintf.c snprintf.h zipstream.h zipstreamimpl.h \
|
||||
dlhandler_win32.cpp
|
||||
|
||||
SUBDIRS = math formats fingerprints
|
||||
SUBDIRS = math formats fingerprints forcefields
|
||||
if BUILD_WXGUI
|
||||
SUBDIRS += GUI
|
||||
endif
|
||||
@@ -35,8 +35,8 @@ if BUILD_SHARED
|
||||
AM_CPPFLAGS = -DOB_MODULE_PATH=\"$(pkglibdir)\" -DUSING_DYNAMIC_LIBS
|
||||
|
||||
libopenbabel_la_LIBADD = math/libmath.la fingerprints/libfingerprints.la \
|
||||
@LTLIBOBJS@ @LIBDL@
|
||||
forcefields/libforcefields.la @LTLIBOBJS@ @LIBDL@
|
||||
else !BUILD_SHARED
|
||||
libopenbabel_la_LIBADD = math/libmath.la fingerprints/libfingerprints.la \
|
||||
formats/libformats.la @LTLIBOBJS@
|
||||
formats/libformats.la forcefields/libforcefields.la @LTLIBOBJS@
|
||||
endif
|
||||
|
||||
@@ -108,7 +108,7 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
uninstall-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = math formats fingerprints GUI
|
||||
DIST_SUBDIRS = math formats fingerprints forcefields GUI
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
@@ -256,7 +256,7 @@ EXTRA_DIST = \
|
||||
strncasecmp.c snprintf.c snprintf.h zipstream.h zipstreamimpl.h \
|
||||
dlhandler_win32.cpp
|
||||
|
||||
SUBDIRS = math formats fingerprints $(am__append_1)
|
||||
SUBDIRS = math formats fingerprints forcefields $(am__append_1)
|
||||
INCLUDES = -I$(top_srcdir)/data/ -I$(top_srcdir)/include
|
||||
lib_LTLIBRARIES = libopenbabel.la
|
||||
@BUILD_SHARED_FALSE@dlhandler =
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/data -I$(top_srcdir)/include
|
||||
# Make sure to install the inchi_api.h header
|
||||
libopenbabelincludedir = $(includedir)/openbabel-2.0/openbabel
|
||||
libopenbabelinclude_HEADERS = inchi_api.h chemdrawcdx.h
|
||||
INCLUDES = -I$(top_srcdir)/data -I$(top_srcdir)/include
|
||||
|
||||
EXTRA_DIST = exampleformat.cpp
|
||||
SUBDIRS =
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
@@ -40,8 +39,7 @@ host_triplet = @host@
|
||||
@BUILD_XML_TRUE@am__append_1 = xml
|
||||
@BUILD_INCHI_TRUE@am__append_2 = inchi
|
||||
subdir = src/formats
|
||||
DIST_COMMON = $(libopenbabelinclude_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
@@ -56,8 +54,7 @@ am__vpath_adj = case $$p in \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkglibdir)" \
|
||||
"$(DESTDIR)$(libopenbabelincludedir)"
|
||||
am__installdirs = "$(DESTDIR)$(pkglibdir)"
|
||||
pkglibLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
|
||||
APIInterface_la_LIBADD =
|
||||
@@ -575,8 +572,6 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
libopenbabelincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(libopenbabelinclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = xml inchi
|
||||
@@ -723,10 +718,7 @@ sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/data -I$(top_srcdir)/include
|
||||
# Make sure to install the inchi_api.h header
|
||||
libopenbabelincludedir = $(includedir)/openbabel-2.0/openbabel
|
||||
libopenbabelinclude_HEADERS = inchi_api.h chemdrawcdx.h
|
||||
INCLUDES = -I$(top_srcdir)/data -I$(top_srcdir)/include
|
||||
EXTRA_DIST = exampleformat.cpp
|
||||
SUBDIRS = $(am__append_1) $(am__append_2)
|
||||
@BUILD_PCH_TRUE@BUILT_SOURCES = all.h.gch
|
||||
@@ -1193,23 +1185,6 @@ clean-libtool:
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
install-libopenbabelincludeHEADERS: $(libopenbabelinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libopenbabelincludedir)" || $(mkdir_p) "$(DESTDIR)$(libopenbabelincludedir)"
|
||||
@list='$(libopenbabelinclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(libopenbabelincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libopenbabelincludedir)/$$f'"; \
|
||||
$(libopenbabelincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libopenbabelincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-libopenbabelincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(libopenbabelinclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(libopenbabelincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(libopenbabelincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
@@ -1388,10 +1363,10 @@ distdir: $(DISTFILES)
|
||||
check-am: all-am
|
||||
check: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-recursive
|
||||
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libopenbabelincludedir)"; do \
|
||||
for dir in "$(DESTDIR)$(pkglibdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: $(BUILT_SOURCES)
|
||||
@@ -1442,7 +1417,7 @@ info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-libopenbabelincludeHEADERS
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-pkglibLTLIBRARIES
|
||||
|
||||
@@ -1470,8 +1445,7 @@ ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-libopenbabelincludeHEADERS \
|
||||
uninstall-pkglibLTLIBRARIES
|
||||
uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
@@ -1483,15 +1457,13 @@ uninstall-info: uninstall-info-recursive
|
||||
distclean-recursive distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-libopenbabelincludeHEADERS install-man \
|
||||
install-pkglibLTLIBRARIES install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive \
|
||||
mostlyclean mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
|
||||
tags tags-recursive uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-libopenbabelincludeHEADERS \
|
||||
uninstall-pkglibLTLIBRARIES
|
||||
install-info-am install-man install-pkglibLTLIBRARIES \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-recursive mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
|
||||
pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-info-am uninstall-pkglibLTLIBRARIES
|
||||
|
||||
@BUILD_PCH_TRUE@all.h.gch: all.h Makefile obmolecformat.h $(srcdir)/../babelconfig.h \
|
||||
@BUILD_PCH_TRUE@ $(srcdir)/../mol.h $(srcdir)/../obconversion.h $(srcdir)/../base.h \
|
||||
|
||||
@@ -24,7 +24,7 @@ General Public License for more details.
|
||||
namespace OpenBabel
|
||||
{
|
||||
newlinebuf::newlinebuf(std::streambuf *sb) :
|
||||
_internalBuf(sb), _returnChar(false)
|
||||
_internalBuf(sb), _returnChar(false), _chcount(0)
|
||||
{
|
||||
setg(_buffer, _buffer, _buffer);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace OpenBabel
|
||||
&& ((ch = _internalBuf->sgetc()) != EOF) )
|
||||
{
|
||||
_internalBuf->sbumpc();
|
||||
|
||||
++_chcount;
|
||||
switch (ch)
|
||||
{
|
||||
case 10:
|
||||
@@ -67,6 +67,12 @@ namespace OpenBabel
|
||||
return *_buffer;
|
||||
}
|
||||
|
||||
std::streampos newlinebuf::seekoff(std::streamoff off,
|
||||
std::ios_base::seekdir way, std::ios_base::openmode which)
|
||||
{
|
||||
return _chcount;
|
||||
}
|
||||
|
||||
} // end namespace OpenBabel
|
||||
|
||||
//! \file newlinebuf.cpp
|
||||
|
||||
@@ -878,8 +878,10 @@ namespace OpenBabel
|
||||
ad->FillAngleArray(_vangle);
|
||||
|
||||
_parent = mol;
|
||||
_i = _vangle.begin();
|
||||
_ptr = *_i;
|
||||
if (!_vangle.empty()) {
|
||||
_i = _vangle.begin();
|
||||
_angle = *_i;
|
||||
}
|
||||
}
|
||||
|
||||
OBMolAngleIter::OBMolAngleIter(OBMol &mol)
|
||||
@@ -889,14 +891,16 @@ namespace OpenBabel
|
||||
ad->FillAngleArray(_vangle);
|
||||
|
||||
_parent = &mol;
|
||||
_i = _vangle.begin();
|
||||
_ptr = *_i;
|
||||
if (!_vangle.empty()) {
|
||||
_i = _vangle.begin();
|
||||
_angle = *_i;
|
||||
}
|
||||
}
|
||||
|
||||
OBMolAngleIter::OBMolAngleIter(const OBMolAngleIter &ai)
|
||||
{
|
||||
_parent = ai._parent;
|
||||
_ptr = ai._ptr;
|
||||
_angle = ai._angle;
|
||||
_vangle = ai._vangle;
|
||||
_i = ai._i;
|
||||
}
|
||||
@@ -906,7 +910,7 @@ namespace OpenBabel
|
||||
if (this != &ai)
|
||||
{
|
||||
_parent = ai._parent;
|
||||
_ptr = ai._ptr;
|
||||
_angle = ai._angle;
|
||||
_vangle = ai._vangle;
|
||||
_i = ai._i;
|
||||
}
|
||||
@@ -916,11 +920,9 @@ namespace OpenBabel
|
||||
OBMolAngleIter& OBMolAngleIter::operator++()
|
||||
{
|
||||
_i++;
|
||||
|
||||
if (_i != _vangle.end()) {
|
||||
_ptr = *_i;
|
||||
} else
|
||||
_ptr = (std::vector<unsigned int>) 0;
|
||||
|
||||
if (_i != _vangle.end())
|
||||
_angle = *_i;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -969,10 +971,12 @@ namespace OpenBabel
|
||||
mol->FindTorsions();
|
||||
OBTorsionData *td = (OBTorsionData *) mol->GetData(OBGenericDataType::TorsionData);
|
||||
td->FillTorsionArray(_vtorsion);
|
||||
|
||||
|
||||
_parent = mol;
|
||||
_i = _vtorsion.begin();
|
||||
_ptr = *_i;
|
||||
if (!_vtorsion.empty()) {
|
||||
_i = _vtorsion.begin();
|
||||
_torsion = *_i;
|
||||
}
|
||||
}
|
||||
|
||||
OBMolTorsionIter::OBMolTorsionIter(OBMol &mol)
|
||||
@@ -982,14 +986,16 @@ namespace OpenBabel
|
||||
td->FillTorsionArray(_vtorsion);
|
||||
|
||||
_parent = &mol;
|
||||
_i = _vtorsion.begin();
|
||||
_ptr = *_i;
|
||||
if (!_vtorsion.empty()) {
|
||||
_i = _vtorsion.begin();
|
||||
_torsion = *_i;
|
||||
}
|
||||
}
|
||||
|
||||
OBMolTorsionIter::OBMolTorsionIter(const OBMolTorsionIter &ai)
|
||||
{
|
||||
_parent = ai._parent;
|
||||
_ptr = ai._ptr;
|
||||
_torsion = ai._torsion;
|
||||
_vtorsion = ai._vtorsion;
|
||||
_i = ai._i;
|
||||
}
|
||||
@@ -999,22 +1005,20 @@ namespace OpenBabel
|
||||
if (this != &ai)
|
||||
{
|
||||
_parent = ai._parent;
|
||||
_ptr = ai._ptr;
|
||||
_torsion = ai._torsion;
|
||||
_vtorsion = ai._vtorsion;
|
||||
_i = ai._i;
|
||||
}
|
||||
return *this;
|
||||
return *this;
|
||||
}
|
||||
|
||||
OBMolTorsionIter& OBMolTorsionIter::operator++()
|
||||
{
|
||||
_i++;
|
||||
|
||||
if (_i != _vtorsion.end()) {
|
||||
_ptr = *_i;
|
||||
} else
|
||||
_ptr = (std::vector<unsigned int>) 0;
|
||||
|
||||
if (_i != _vtorsion.end())
|
||||
_torsion = *_i;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1058,7 +1062,7 @@ namespace OpenBabel
|
||||
|
||||
OBMolPairIter::OBMolPairIter(OBMol *mol)
|
||||
{
|
||||
std::pair<int, int> atoms;
|
||||
std::vector<unsigned int> atoms;
|
||||
OBAtom *i, *j;
|
||||
bool not14;
|
||||
|
||||
@@ -1081,20 +1085,23 @@ namespace OpenBabel
|
||||
}
|
||||
|
||||
if (!not14) {
|
||||
atoms.first = a->GetIdx();
|
||||
atoms.second = b->GetIdx();
|
||||
_vpair.push(atoms);
|
||||
}
|
||||
}
|
||||
atoms.clear();
|
||||
atoms.push_back(a->GetIdx());
|
||||
atoms.push_back(b->GetIdx());
|
||||
_vpair.push_back(atoms);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_ptr = &_vpair.front();
|
||||
_i = _vpair.begin();
|
||||
if (!_vpair.empty())
|
||||
_pair = *_i;
|
||||
}
|
||||
|
||||
OBMolPairIter::OBMolPairIter(OBMol &mol)
|
||||
{
|
||||
std::pair<int, int> atoms;
|
||||
std::vector<unsigned int> atoms;
|
||||
OBAtom *i, *j;
|
||||
bool not14;
|
||||
|
||||
@@ -1117,42 +1124,45 @@ namespace OpenBabel
|
||||
}
|
||||
|
||||
if (!not14) {
|
||||
atoms.first = a->GetIdx();
|
||||
atoms.second = b->GetIdx();
|
||||
_vpair.push(atoms);
|
||||
atoms.clear();
|
||||
atoms.push_back(a->GetIdx());
|
||||
atoms.push_back(b->GetIdx());
|
||||
_vpair.push_back(atoms);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_ptr = &_vpair.front();
|
||||
_i = _vpair.begin();
|
||||
if (!_vpair.empty())
|
||||
_pair = *_i;
|
||||
}
|
||||
|
||||
OBMolPairIter::OBMolPairIter(const OBMolPairIter &ai)
|
||||
{
|
||||
_parent = ai._parent;
|
||||
_ptr = ai._ptr;
|
||||
_pair = ai._pair;
|
||||
_vpair = ai._vpair;
|
||||
_i = ai._i;
|
||||
}
|
||||
|
||||
OBMolPairIter& OBMolPairIter::operator=(const OBMolPairIter &ai)
|
||||
{
|
||||
if (this != &ai) {
|
||||
_parent = ai._parent;
|
||||
_ptr = ai._ptr;
|
||||
_pair = ai._pair;
|
||||
_vpair = ai._vpair;
|
||||
_i = ai._i;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
OBMolPairIter& OBMolPairIter::operator++()
|
||||
{
|
||||
_vpair.pop();
|
||||
_i++;
|
||||
|
||||
if (!_vpair.empty()) {
|
||||
_ptr = &_vpair.front();
|
||||
} else
|
||||
_ptr = NULL;
|
||||
if (_i != _vpair.end())
|
||||
_pair = *_i;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
293
tools/obgen.cpp
293
tools/obgen.cpp
@@ -27,6 +27,8 @@ GNU General Public License for more details.
|
||||
#include <openbabel/base.h>
|
||||
#include <openbabel/mol.h>
|
||||
#include <openbabel/obconversion.h>
|
||||
#include <openbabel/forcefield.h>
|
||||
#include <openbabel/fingerprint.h>
|
||||
#include <unistd.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -36,8 +38,6 @@ using namespace OpenBabel;
|
||||
//int get_dst_nbr (OBAtom* atom);
|
||||
//int get_ang_nbr (OBAtom* atom);
|
||||
int get_nbr (OBAtom* atom, OBMol &mol, int level);
|
||||
int get_ring_sign (OBMol &mol, OBAtom* atom_a);
|
||||
bool is_in_same_ring (OBMol &mol, OBAtom* atom_a, OBAtom* atom_b);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -71,7 +71,7 @@ int main(int argc,char **argv)
|
||||
// Find Input filetype
|
||||
OBConversion conv;
|
||||
OBFormat *format_in = conv.FormatFromExt(filename.c_str());
|
||||
OBFormat *format_out = conv.FindFormat("MOL");
|
||||
OBFormat *format_out = conv.FindFormat("pdb");
|
||||
|
||||
if (!format_in || !format_out || !conv.SetInAndOutFormats(format_in, format_out))
|
||||
{
|
||||
@@ -92,19 +92,19 @@ int main(int argc,char **argv)
|
||||
|
||||
OBMol mol;
|
||||
|
||||
for (c=1;;++c)
|
||||
for (c=1;;c++)
|
||||
{
|
||||
mol.Clear();
|
||||
if (!conv.Read(&mol, &ifs))
|
||||
break;
|
||||
if (mol.Empty())
|
||||
break;
|
||||
|
||||
|
||||
mol.AddHydrogens(false, true);
|
||||
|
||||
OBAtom *atom, *nbr, *nbr2, *nbr3, *nbrs;
|
||||
vector<OBAtom*>::iterator i;
|
||||
vector<OBBond*>::iterator j;
|
||||
vector<OBNodeBase*>::iterator i;
|
||||
vector<OBEdgeBase*>::iterator j;
|
||||
|
||||
vector<OBInternalCoord*> internals;
|
||||
OBInternalCoord *coord;
|
||||
@@ -112,33 +112,22 @@ int main(int argc,char **argv)
|
||||
coord = new OBInternalCoord();
|
||||
internals.push_back(coord);
|
||||
mol.BeginModify();
|
||||
|
||||
|
||||
int torang;
|
||||
for (atom = mol.BeginAtom(i);atom;atom = mol.NextAtom(i))
|
||||
{
|
||||
coord = new OBInternalCoord();
|
||||
nbr = mol.GetAtom(get_nbr(atom, mol, 1));
|
||||
nbr2 = mol.GetAtom(get_nbr(atom, mol, 2));
|
||||
nbr3 = mol.GetAtom(get_nbr(atom, mol, 3));
|
||||
|
||||
cout << "ATOM : " << atom->GetIdx();
|
||||
cout << "-" << get_nbr(atom, mol, 1);
|
||||
cout << "-" << get_nbr(atom, mol, 2);
|
||||
cout << "-" << get_nbr(atom, mol, 3) << endl;
|
||||
|
||||
//
|
||||
// CHOOSE DISTANCE
|
||||
//
|
||||
if (nbr) {
|
||||
|
||||
if (nbr) {
|
||||
coord->_a = mol.GetAtom(get_nbr(atom, mol, 1));
|
||||
OBBond *bond;
|
||||
if ( (bond = mol.GetBond(atom, nbr)) ) {
|
||||
coord->_dst = bond->GetEquibLength();
|
||||
}
|
||||
}
|
||||
//
|
||||
// CHOOSE ANGLE
|
||||
//
|
||||
//if (get_nbr(atom, mol, 2)) {
|
||||
if (nbr2) {
|
||||
coord->_b = mol.GetAtom(get_nbr(atom, mol, 2));
|
||||
if (nbr->GetHyb() == 3)
|
||||
@@ -148,195 +137,80 @@ int main(int argc,char **argv)
|
||||
if (nbr->GetHyb() == 1)
|
||||
coord->_ang = 180;
|
||||
|
||||
if (nbr->IsInRing()) {
|
||||
if (atom->IsInRingSize(6) && nbr->IsInRingSize(6) && nbr2->IsInRingSize(6)) {
|
||||
if (nbr->GetHyb() == 3)
|
||||
coord->_ang = 110; // internal angle of aliphatic 6-ring
|
||||
else
|
||||
coord->_ang = 120; // internal angle of aromatic 6-ring
|
||||
}
|
||||
if (atom->IsInRingSize(5) && nbr->IsInRingSize(5) && nbr2->IsInRingSize(5))
|
||||
coord->_ang = 108; // internal angle of aromatic
|
||||
if (atom->IsInRingSize(4) && nbr->IsInRingSize(4) && nbr2->IsInRingSize(4))
|
||||
coord->_ang = 90;
|
||||
if (atom->IsInRingSize(3) && nbr->IsInRingSize(3) && nbr2->IsInRingSize(3))
|
||||
coord->_ang = 60;
|
||||
if (!is_in_same_ring(mol, atom, nbr2)) {
|
||||
if (atom->IsInRingSize(5) || nbr2->IsInRingSize(5))
|
||||
if (!atom->IsHydrogen()) //// ???
|
||||
coord->_ang = 132;
|
||||
}
|
||||
if (!atom->IsInRing() && nbr->IsInRingSize(5) && nbr2->IsInRingSize(5)) {
|
||||
if (nbr->GetHyb() == 3)
|
||||
coord->_ang = 109;
|
||||
else
|
||||
coord->_ang = 126;
|
||||
}
|
||||
/////
|
||||
if (!atom->IsInRing() && nbr->IsInRingSize(3))
|
||||
coord->_ang = 117;
|
||||
}
|
||||
}
|
||||
//
|
||||
// CHOOSE TORSION
|
||||
//
|
||||
if (nbr3) {
|
||||
double bestangle, angle, bestscore, score;
|
||||
int nbr_count;
|
||||
|
||||
coord->_c = mol.GetAtom(get_nbr(atom, mol, 3));
|
||||
coord->_tor = torang;
|
||||
torang +=60;
|
||||
|
||||
if (nbr->GetHyb() == 3) {
|
||||
internals.push_back(coord);
|
||||
InternalToCartesian(internals, mol);
|
||||
|
||||
if (atom->IsInRingSize(6) && nbr->IsInRingSize(6) && nbr2->IsInRingSize(6)) {
|
||||
internals[atom->GetIdx()]->_tor = get_ring_sign(mol, atom)*58;
|
||||
continue;
|
||||
}
|
||||
if (!atom->IsInRing() && nbr->IsInRingSize(6) && nbr2->IsInRingSize(6) && nbr3->IsInRingSize(6)) {
|
||||
internals[atom->GetIdx()]->_tor = 177;
|
||||
FOR_NBORS_OF_ATOM(tmp, nbr) {
|
||||
if (tmp->GetIdx() >= atom->GetIdx())
|
||||
break;
|
||||
cout << " NBR=" << tmp->GetIdx() << endl;
|
||||
if (internals[tmp->GetIdx()]->_tor || (tmp->GetIdx() < 4)) {
|
||||
cout << " YES" << endl;
|
||||
nbr_count++;
|
||||
}
|
||||
}
|
||||
if (nbr_count == 3)
|
||||
internals[atom->GetIdx()]->_tor = get_ring_sign(mol, nbr)*65;
|
||||
nbr_count = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (atom->IsInRing() && nbr->IsInRing() && nbr2->IsInRing() && !nbr3->IsInRing()) {
|
||||
internals[atom->GetIdx()]->_tor = 300;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (atom->IsInRing()) {
|
||||
if (!nbr3->IsInRing() || !is_in_same_ring(mol, atom, nbr3)) {
|
||||
internals[atom->GetIdx()]->_tor = 180;
|
||||
} else
|
||||
internals[atom->GetIdx()]->_tor = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!atom->IsInRing() && nbr->IsInRingSize(3)) {
|
||||
internals[atom->GetIdx()]->_tor = 107;
|
||||
continue;
|
||||
}
|
||||
|
||||
for ( angle=60; angle<360; angle+=120) {
|
||||
internals[atom->GetIdx()]->_tor = angle;
|
||||
//for (nbrs = nbr->BeginNbrAtom(j);nbrs;nbrs = nbr->NextNbrAtom(j)) {
|
||||
FOR_NBORS_OF_ATOM(tmp, nbr) {
|
||||
if (tmp->GetIdx() == nbr3->GetIdx())
|
||||
internals[atom->GetIdx()]->_tor -= 60;
|
||||
}
|
||||
if (nbr->IsInRing() && !atom->IsInRing())
|
||||
internals[atom->GetIdx()]->_tor -= 60;
|
||||
|
||||
|
||||
InternalToCartesian(internals, mol);
|
||||
score = 0;
|
||||
score = atom->GetDistance(nbr3);
|
||||
for (nbrs = nbr->BeginNbrAtom(j);nbrs;nbrs = nbr->NextNbrAtom(j)) {
|
||||
//FOR_NBORS_OF_ATOM(tmp, nbr) {
|
||||
if (nbrs->GetX() || nbrs->GetY() || nbrs->GetZ()) {
|
||||
score += atom->GetDistance(nbrs);
|
||||
}
|
||||
if (score > bestscore) {
|
||||
bestscore = score;
|
||||
bestangle = internals[atom->GetIdx()]->_tor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bestscore = 0;
|
||||
internals[atom->GetIdx()]->_tor = bestangle;
|
||||
|
||||
continue;
|
||||
}
|
||||
if (nbr->GetHyb() == 2) {
|
||||
internals.push_back(coord);
|
||||
InternalToCartesian(internals, mol);
|
||||
|
||||
if (atom->IsInRing()) {
|
||||
if (!nbr3->IsInRing() || !is_in_same_ring(mol, atom, nbr3)) {
|
||||
internals[atom->GetIdx()]->_tor = 180;
|
||||
} else
|
||||
internals[atom->GetIdx()]->_tor = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nbr->IsInRing() && !nbr3->IsInRing()) {
|
||||
internals[atom->GetIdx()]->_tor = 0;
|
||||
continue;
|
||||
}
|
||||
if (nbr->IsInRing() && nbr3->IsInRing() && !is_in_same_ring(mol, nbr, nbr3)) {
|
||||
internals[atom->GetIdx()]->_tor = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
for ( angle=0; angle<360; angle+=180) {
|
||||
internals[atom->GetIdx()]->_tor = angle;
|
||||
InternalToCartesian(internals, mol);
|
||||
score = 0;
|
||||
score = atom->GetDistance(get_nbr(atom, mol, 3));
|
||||
for (nbrs = nbr->BeginNbrAtom(j);nbrs;nbrs = nbr->NextNbrAtom(j)) {
|
||||
if (nbrs->GetX() || nbrs->GetY() || nbrs->GetZ()) {
|
||||
score += atom->GetDistance(nbrs);
|
||||
}
|
||||
if (score > bestscore) {
|
||||
bestscore = score;
|
||||
bestangle = internals[atom->GetIdx()]->_tor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bestscore = 0;
|
||||
internals[atom->GetIdx()]->_tor = bestangle;
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
}
|
||||
//cout << atom->GetIdx() << "-" << get_nbr(atom, 1) << "-" << get_nbr(atom, 2) << "-" << get_nbr(atom, 3) << endl;
|
||||
|
||||
internals.push_back(coord);
|
||||
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
int k = 0;
|
||||
for (atom = mol.BeginAtom(i);atom;atom = mol.NextAtom(i)) {
|
||||
k++;
|
||||
cout << "ATOM " << k << " - dst: " << internals[k]->_dst << " ang: " << internals[k]->_ang << " tor: " << internals[k]->_tor << endl;
|
||||
}
|
||||
|
||||
InternalToCartesian(internals, mol);
|
||||
mol.AddHydrogens(false, true);
|
||||
|
||||
//string id;
|
||||
//OBForceField* pForceField=NULL;
|
||||
//while (OBForceField::GetNextForceField(id, pForceField)) {
|
||||
// cout << id << " -- " << pForceField->Description() << endl;
|
||||
//}
|
||||
|
||||
char FileOut[BUFF_SIZE];
|
||||
sprintf(FileOut, "%s-%d.mol", basename.c_str(), c);
|
||||
FOR_EACH(OBForceField, iter) {
|
||||
cout << iter.ID() << ' ' << iter.Description() << endl;
|
||||
}
|
||||
FOR_EACH(OBFingerprint, iter) {
|
||||
cout << iter.ID() << ' ' << iter.Description() << endl;
|
||||
}
|
||||
|
||||
|
||||
//OBForceField* pFF = OBForceField::FindForceField("MM2");
|
||||
OBForceField* pFF = OBForceField::FindForceField("Tripos");
|
||||
|
||||
cout << "MM2:" << endl << endl;
|
||||
|
||||
pFF->Setup(mol);
|
||||
|
||||
cout << " bond stretching = " << pFF->E_Bond() << " kcal/mole" << endl;
|
||||
cout << " angle bending = " << pFF->E_Angle() << " kcal/mole" << endl;
|
||||
cout << " stretch-bending = " << pFF->E_StrBnd() << " kcal/mole" << endl;
|
||||
cout << " torsional terms = " << pFF->E_Torsion() << " kcal/mole" << endl;
|
||||
cout << " out-of-plane bending = " << pFF->E_OOP() << " kcal/mole" << endl;
|
||||
cout << " Van der Waals interactions = " << pFF->E_VDW() << " kcal/mole" << endl;
|
||||
cout << " Dipole-dipole interactions = " << pFF->E_Electrostatic() << " kcal/mole" << endl;
|
||||
|
||||
cout << endl << "Total Energy = " << pFF->Energy() << " kcal/mole" << endl << endl;
|
||||
|
||||
pFF->SteepestDescent(300);
|
||||
pFF->UpdateCoordinates(mol);
|
||||
|
||||
cout << " bond stretching = " << pFF->E_Bond() << " kcal/mole" << endl;
|
||||
cout << " angle bending = " << pFF->E_Angle() << " kcal/mole" << endl;
|
||||
cout << " stretch-bending = " << pFF->E_StrBnd() << " kcal/mole" << endl;
|
||||
cout << " torsional terms = " << pFF->E_Torsion() << " kcal/mole" << endl;
|
||||
cout << " out-of-plane bending = " << pFF->E_OOP() << " kcal/mole" << endl;
|
||||
cout << " Van der Waals interactions = " << pFF->E_VDW() << " kcal/mole" << endl;
|
||||
cout << " Dipole-dipole interactions = " << pFF->E_Electrostatic() << " kcal/mole" << endl;
|
||||
|
||||
cout << endl << "Total Energy = " << pFF->Energy() << " kcal/mole" << endl << endl;
|
||||
|
||||
char FileOut[32];
|
||||
sprintf(FileOut, "obconfgen.pdb");
|
||||
ofs.open(FileOut);
|
||||
conv.Write(&mol, &ofs);
|
||||
ofs.close();
|
||||
//conv.Write(&mol, &cout);
|
||||
conv.Write(&mol, &cout);
|
||||
} // end for loop
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int get_nbr (OBAtom* atom, OBMol &mol, int level) {
|
||||
OBAtom *nbr,*nbr2,*nbr3;
|
||||
vector<OBBond*>::iterator i;
|
||||
vector<OBEdgeBase*>::iterator i;
|
||||
|
||||
if (level == 2)
|
||||
if (!get_nbr(atom, mol, 1)) return 0;
|
||||
@@ -381,49 +255,4 @@ int get_nbr (OBAtom* atom, OBMol &mol, int level) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool is_in_same_ring(OBMol &mol, OBAtom* atom_a, OBAtom* atom_b)
|
||||
{
|
||||
bool a_in, b_in;
|
||||
vector<OBRing*> vr;
|
||||
vr = mol.GetSSSR();
|
||||
|
||||
vector<OBRing*>::iterator i;
|
||||
vector<int>::iterator j;
|
||||
for (i = vr.begin();i != vr.end();i++) {
|
||||
for(j = (*i)->_path.begin();j != (*i)->_path.end();j++) {
|
||||
if (*j == atom_a->GetIdx())
|
||||
a_in = true;
|
||||
if (*j == atom_b->GetIdx())
|
||||
b_in = true;
|
||||
}
|
||||
if (a_in && b_in)
|
||||
return true;
|
||||
a_in = false;
|
||||
b_in = false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int get_ring_sign (OBMol &mol, OBAtom* atom_a)
|
||||
{
|
||||
int sign;
|
||||
vector<OBRing*> vr;
|
||||
vr = mol.GetSSSR();
|
||||
|
||||
vector<OBRing*>::iterator i;
|
||||
vector<int>::iterator j;
|
||||
for (i = vr.begin();i != vr.end();i++) {
|
||||
sign = 1;
|
||||
for(j = (*i)->_path.begin();j != (*i)->_path.end();j++) {
|
||||
if (*j == atom_a->GetIdx()) {
|
||||
return sign;
|
||||
}
|
||||
sign = -sign;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user