Re: [Rdkit-discuss] Trying to repeat Greg's C++ blog example

2021-10-14 Thread Markus Metz
Dear all:
So I did a little more testing and I found the solution.
I used exactly the same version of gcc and g++ compilers as Greg did.
Also, I needed to remove the
'add_definitions("-D_GLIBCXX_USE_CXX11_ABI=0")' line in the CMakeLists.txt
file.
Now the compilation and the compiled test program work like charm 😄.
All the best,
Markus

On Wed, Oct 13, 2021 at 2:28 PM Markus Metz  wrote:

> Dear all:
> I would like to repeat Greg's example here:
>
> https://greglandrum.github.io/rdkit-blog/tutorial/technical/2021/07/24/setting-up-a-cxx-dev-env.html
>
> Working on Centos 7.6 and the 2021.03.5 rdkit release
> I followed all the steps and used the exact same input files.
>
> I have set the env variable as:
> export RDBASE=/.../anaconda3/envs/rdkit_dev
> export PYTHONPATH=$RDBASE
>
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
> .../anaconda3/envs/rdkit_dev/include
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../anaconda3/envs/rdkit_dev/lib
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: .../anaconda3/lib
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: .../anaconda3/include
>
> I then set the g++ and gcc compilers with the CXX and CC env variables:
> export CXX=/usr/local/bin/g++
> export CC=/usr/local/bin/gcc
>
> The cmake step seems to work. Here is the output:
> -- The C compiler identification is GNU 8.3.0
> -- The CXX compiler identification is GNU 8.3.0
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working C compiler: /usr/local/bin/gcc - skipped
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Check for working CXX compiler: /usr/local/bin/g++ - skipped
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Looking for pthread.h
> -- Looking for pthread.h - found
> -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
> -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
> -- Looking for pthread_create in pthreads
> -- Looking for pthread_create in pthreads - not found
> -- Looking for pthread_create in pthread
> -- Looking for pthread_create in pthread - found
> -- Found Threads: TRUE
> -- Found Boost: ...
> anaconda3/envs/rdkit_dev/lib/cmake/Boost-1.74.0/BoostConfig.cmake (found
> suitable version "1.74.0", minimum required is "1.74.0")
> -- Found Boost: ...
> /anaconda3/envs/rdkit_dev/lib/cmake/Boost-1.74.0/BoostConfig.cmake (found
> version "1.74.0") found components: timer system
> -- Configuring done
> -- Generating done
> -- Build files have been written to: ... /c++/rdkit/example/build
>
> But the next step, the linking process, throws me errors:
>
> [ 50%] Building CXX object CMakeFiles/tautomer_hash.dir/tautomer_hash.cpp.o
> [100%] Linking CXX executable tautomer_hash
> CMakeFiles/tautomer_hash.dir/tautomer_hash.cpp.o: In function
> `readmols(std::string, unsigned int,
> std::vector,
> std::allocator > >&)':
> tautomer_hash.cpp:(.text+0x7f): undefined reference to
> `RDKit::SmilesMolSupplier::SmilesMolSupplier(std::string const&,
> std::string const&, int, int, bool, bool)'
> CMakeFiles/tautomer_hash.dir/tautomer_hash.cpp.o: In function
> `generatehashes(std::vector,
> std::allocator > > const&)':
> tautomer_hash.cpp:(.text+0x29f): undefined reference to
> `RDKit::MolHash::MolHash(RDKit::RWMol*, RDKit::MolHash::HashFunction)'
> /home/mmetz/anaconda3/envs/rdkit_dev/lib/libRDKitGraphMol.so.1.2021.03.5:
> undefined reference to `std::__cxx11::basic_istringstream std::char_traits, std::allocator
> >::basic_istringstream()@GLIBCXX_3.4.26'
> /home/mmetz/anaconda3/envs/rdkit_dev/lib/libRDKitFileParsers.so.1.2021.03.5:
> undefined reference to `std::__cxx11::basic_ostringstream std::char_traits, std::allocator
> >::basic_ostringstream()@GLIBCXX_3.4.26'
> /home/mmetz/anaconda3/envs/rdkit_dev/lib/libRDKitFileParsers.so.1.2021.03.5:
> undefined reference to `std::__cxx11::basic_stringstream std::char_traits, std::allocator
> >::basic_stringstream()@GLIBCXX_3.4.26'
> collect2: error: ld returned 1 exit status
> make[3]: *** [tautomer_hash] Error 1
> make[2]: *** [CMakeFiles/tautomer_hash.dir/all] Error 2
> make[1]: *** [CMakeFiles/tautomer_hash.dir/rule] Error 2
> make: *** [tautomer_hash] Error 2
>
> I checked around on the web and could find some info on 'std::__cxx11:'
> which seems to indicate ... 'to link together object files that were
> compiled with different values for the _GLIBCXX_USE_CXX11_ABI macro'
>
> And I used Paolo's suggestion
> 'add_definitions("-D_GLIBCXX_USE_CXX11_ABI=0")' in the CMakefile.txt. No
> change.
>
> Does anybody know what is going on?
> Thank you very much in advance.
> Best,
> Markus
>
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Trying to repeat Greg's C++ blog example

2021-10-13 Thread Markus Metz
Dear all:
I would like to repeat Greg's example here:
https://greglandrum.github.io/rdkit-blog/tutorial/technical/2021/07/24/setting-up-a-cxx-dev-env.html

Working on Centos 7.6 and the 2021.03.5 rdkit release
I followed all the steps and used the exact same input files.

I have set the env variable as:
export RDBASE=/.../anaconda3/envs/rdkit_dev
export PYTHONPATH=$RDBASE

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
.../anaconda3/envs/rdkit_dev/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../anaconda3/envs/rdkit_dev/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: .../anaconda3/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: .../anaconda3/include

I then set the g++ and gcc compilers with the CXX and CC env variables:
export CXX=/usr/local/bin/g++
export CC=/usr/local/bin/gcc

The cmake step seems to work. Here is the output:
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Boost: ...
anaconda3/envs/rdkit_dev/lib/cmake/Boost-1.74.0/BoostConfig.cmake (found
suitable version "1.74.0", minimum required is "1.74.0")
-- Found Boost: ...
/anaconda3/envs/rdkit_dev/lib/cmake/Boost-1.74.0/BoostConfig.cmake (found
version "1.74.0") found components: timer system
-- Configuring done
-- Generating done
-- Build files have been written to: ... /c++/rdkit/example/build

But the next step, the linking process, throws me errors:

[ 50%] Building CXX object CMakeFiles/tautomer_hash.dir/tautomer_hash.cpp.o
[100%] Linking CXX executable tautomer_hash
CMakeFiles/tautomer_hash.dir/tautomer_hash.cpp.o: In function
`readmols(std::string, unsigned int,
std::vector,
std::allocator > >&)':
tautomer_hash.cpp:(.text+0x7f): undefined reference to
`RDKit::SmilesMolSupplier::SmilesMolSupplier(std::string const&,
std::string const&, int, int, bool, bool)'
CMakeFiles/tautomer_hash.dir/tautomer_hash.cpp.o: In function
`generatehashes(std::vector,
std::allocator > > const&)':
tautomer_hash.cpp:(.text+0x29f): undefined reference to
`RDKit::MolHash::MolHash(RDKit::RWMol*, RDKit::MolHash::HashFunction)'
/home/mmetz/anaconda3/envs/rdkit_dev/lib/libRDKitGraphMol.so.1.2021.03.5:
undefined reference to `std::__cxx11::basic_istringstream, std::allocator
>::basic_istringstream()@GLIBCXX_3.4.26'
/home/mmetz/anaconda3/envs/rdkit_dev/lib/libRDKitFileParsers.so.1.2021.03.5:
undefined reference to `std::__cxx11::basic_ostringstream, std::allocator
>::basic_ostringstream()@GLIBCXX_3.4.26'
/home/mmetz/anaconda3/envs/rdkit_dev/lib/libRDKitFileParsers.so.1.2021.03.5:
undefined reference to `std::__cxx11::basic_stringstream, std::allocator
>::basic_stringstream()@GLIBCXX_3.4.26'
collect2: error: ld returned 1 exit status
make[3]: *** [tautomer_hash] Error 1
make[2]: *** [CMakeFiles/tautomer_hash.dir/all] Error 2
make[1]: *** [CMakeFiles/tautomer_hash.dir/rule] Error 2
make: *** [tautomer_hash] Error 2

I checked around on the web and could find some info on 'std::__cxx11:'
which seems to indicate ... 'to link together object files that were
compiled with different values for the _GLIBCXX_USE_CXX11_ABI macro'

And I used Paolo's suggestion
'add_definitions("-D_GLIBCXX_USE_CXX11_ABI=0")' in the CMakefile.txt. No
change.

Does anybody know what is going on?
Thank you very much in advance.
Best,
Markus
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] MD5 checksum error

2020-10-29 Thread Markus Metz
Dear all:
I searched the mailing list here and came up with a very similar issue:
https://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg08044.html
However, this helped me only so much.
I am trying to compile rdkit from source and I followed the steps outlined
in the manual:
bash Anaconda3-5.2.0-x86_64.sh
conda install -y cmake cairo pillow eigen pkg-config
conda install -y boost-cpp boost py-boost
conda install -y gxx_linux-64
git clone https://github.com/rdkit/rdkit.git
cd rdkit
mkdir build && cd build
cmake -DPy_ENABLE_SHARED=1 \
  -DRDK_INSTALL_INTREE=ON \
  -DRDK_INSTALL_STATIC_LIBS=OFF \
  -DRDK_BUILD_CPP_TESTS=ON \
  -DPYTHON_NUMPY_INCLUDE_PATH="$(python -c 'import numpy ;
print(numpy.get_include())')" \
  -DBOOST_ROOT="$CONDA_PREFIX" \
  ..
This process stops with the following error message for the
RingDecomposerLib:
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler:
/home/xyz/anaconda3/envs/comp_rdkit/bin/x86_64-conda_cos6-linux-gnu-cc -
skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler:
/home/xyz/anaconda3/envs/comp_rdkit/bin/x86_64-conda_cos6-linux-gnu-c++ -
skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Found Catch2: /home/xyz/software/rdkit_09012020/External/catch/catch
CATCH: /home/xyz/software/rdkit_09012020/External/catch/catch
-- Found PythonInterp: /home/xyz/anaconda3/envs/comp_rdkit/bin/python
(found version "3.6.12")
-- Found PythonLibs: /home/xyz/anaconda3/envs/comp_rdkit/lib/
libpython3.6m.so (found version "3.6.12")
PYTHON Py_ENABLE_SHARED: 0
PYTHON USING LINK LINE: -pthread -shared -Wl,-O2 -Wl,--sort-common
-Wl,--as-needed -Wl,-z,relro -Wl,-z,now
-Wl,-rpath,/home/xyz/anaconda3/envs/comp_rdkit/lib
-L/home/xyz/anaconda3/envs/comp_rdkit/lib -Wl,-O2 -Wl,--sort-common
-Wl,--as-needed -Wl,-z,relro -Wl,-z,now
-Wl,-rpath,/home/mmetz/anaconda3/envs/comp_rdkit/lib
-L/home/mmetz/anaconda3/envs/comp_rdkit/lib
-- Found Eigen3: /home/xyz/anaconda3/envs/comp_rdkit/include/eigen3
(Required is at least version "2.91.0")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Boost:
/home/xyz/anaconda3/envs/comp_rdkit/lib/cmake/Boost-1.73.0/BoostConfig.cmake
(found suitable version "1.73.0", minimum required is "1.67.0") found
components: serialization
== Using strict rotor definition
-- Found Boost:
/home/xyz/anaconda3/envs/comp_rdkit/lib/cmake/Boost-1.73.0/BoostConfig.cmake
(found suitable version "1.73.0", minimum required is "1.67.0") found
components: system iostreams
-- maeparser include dir set as '/usr/local/include'
-- maeparser libraries set as '/usr/local/lib64/libmaeparser.so'
-- Found maeparser: /usr/local/include
-- coordgen include dir set as /usr/local/include
-- coordgen libraries set as '/usr/local/lib64/libcoordgen.so'
-- Found coordgen: /usr/local/include
Downloading
https://github.com/rareylab/RingDecomposerLib/archive/v1.1.3_rdkit.tar.gz...
  % Total% Received % Xferd  Average Speed   TimeTime Time
 Current
 Dload  Upload   Total   SpentLeft
 Speed
  0 00 00 0  0  0 --:--:--  0:05:00 --:--:--
  0
curl: (28) Operation timed out after 300137 milliseconds with 0 out of 0
bytes received
CMake Error at Code/cmake/Modules/RDKitUtils.cmake:213 (MESSAGE):
  The md5 checksum for

/home/xyz/software/rdkit_09012020/External/RingFamilies/RingDecomposerLib-v1.1.3_rdkit.tar.gz
  is incorrect; expected: e9a0bcdda8b921a35e812b9888a9a874, found:
  d41d8cd98f00b204e9800998ecf8427e
Call Stack (most recent call first):
  External/RingFamilies/CMakeLists.txt:12 (downloadAndCheckMD5)


-- Configuring incomplete, errors occurred!
See also
"/home/xyz/software/rdkit_09012020/build/CMakeFiles/CMakeOutput.log".
See also
"/home/xyz/software/rdkit_09012020/build/CMakeFiles/CMakeError.log".

So it seems the Checksum is causing issues.
At first I had Checksum issues with the Catch2, maeparser and coordgen too.
Following Dan Nealschneider's comment I downloaded the tar.gz files and
ins

Re: [Rdkit-discuss] sd file format question

2020-10-02 Thread Markus Metz
Several points:
A) Sorry, I forgot. I am using rdkit 2020.03
B) the attached piperidine.sdf file is input i used to generate the molblock. I 
copy and pasted the content.
C) I also noticed that babel adds the missing charge in after writing out the 
piperidine example as sdf file and converting it from sd to sd in obabel.
Markus

> On Oct 2, 2020, at 1:33 PM, Norwid Behrnd  wrote:
> 
> an


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] sd file format question

2020-10-02 Thread Markus Metz
Hello everybody:I have a question to the sd file format.When I write charged molecules via rdkit I noticed that the charge definition in the atom block is not written.The charge is written at the end of the entry.So far this worked perfectly fine for me.Now, I am using a program which reads the atom block charge info only.Is there a way in rdkit to enable the charge written in the atom block?Do you have any thoughts on this?Best,Markus 

sdformat_observation.ipynb
Description: Binary data


piperidine.sdf
Description: Binary data
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] visualize substructure matches in Molecule Grid Image

2020-09-29 Thread Markus Metz
Thank you Kangway.
So it is list of lists for each molecule in the grid.
Perfect.
Markus

> On Sep 29, 2020, at 2:44 PM, Chuang, Kangway  wrote:
> 
> Hi Markus,
> 
> The highlightAtomLists argument is looking for a list for each mol in the mol 
> list. Instead of highlightAtomLists=hit_ats, change it to 
> highlightAtomLists=[hit_ats] instead. 
> 
> Kangway
> From: Markus Metz mailto:metm...@gmail.com>>
> Sent: Tuesday, September 29, 2020 2:33 PM
> To: rdkit-discuss@lists.sourceforge.net 
> <mailto:rdkit-discuss@lists.sourceforge.net> 
>  <mailto:rdkit-discuss@lists.sourceforge.net>>
> Subject: [Rdkit-discuss] visualize substructure matches in Molecule Grid Image
>  
> Dear all:
> I am looking for some advice.
> Is there a way to highlight substructure matches in molecules displayed as 
> Molecule Grid Image.
> I found the highlightAtomLists and highlightBondLists options but the does 
> not seem to work.
> Does anybody know how I can accomplish this? 
> Please see below for an example.
> Best regards,
> Markus

___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] visualize substructure matches in Molecule Grid Image

2020-09-29 Thread Markus Metz
Dear all:I am looking for some advice.Is there a way to highlight substructure matches in molecules displayed as Molecule Grid Image.I found the highlightAtomLists and highlightBondLists options but the does not seem to work.Does anybody know how I can accomplish this? Please see below for an example.Best regards,Markus  

visualizeSSmatch.ipynb
Description: Binary data
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] A question of molecule structure

2020-09-19 Thread Markus Metz
Dear Gao:
Your question is a tautomer related issue.
May be this might help you:
https://rdkit.blogspot.com/2020/01/trying-out-new-tautomer.html 

https://github.com/rdkit/rdkit/issues/2908 

Best,
Markus


> On Sep 19, 2020, at 9:03 AM, Gao, Zhenxiang  wrote:
> 
> Hi folks,
>  
> I have a simple question. Two double bonds in the following molecule are 
> outsides the two rings. Does Rdkit has some functions to move two double 
> bonds back to the rings?
>  
> SMILES : Cc1ccc(=NC(=O)N=c2[nH]c(C)cn2C)[nH]c1
> 
>  
> Thanks,
> Jason Gao
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] AllChem.ReplaceSubstructs question

2020-03-05 Thread Markus Metz
Hello:
I am puzzled by the output from ReplaceSubstructs as it can produce two
fragments.
So I went and tried the examples in the manual and I observed this:
The example in the intro manual with the recursive smarts pattern works as
expected.
repl = Chem.MolFromSmiles('OC')
patt = Chem.MolFromSmarts('[$(NC(=O))]')
m = Chem.MolFromSmiles('CC(=O)N')
rms = AllChem.ReplaceSubstructs(m,patt,repl)
One expected product is formed.

The example form the ReplaceSubstructs manual produces two solutions.
I have used the following commands:
from rdkit import Chem
from rdkit.Chem import AllChem

#ReplaceSubstructs(‘CCOC’,’OC’,’NC’) -> (‘CCNC’,)
repl = Chem.MolFromSmiles('NC')
patt = Chem.MolFromSmarts('OC')
m = Chem.MolFromSmiles('CCOC')
rms = AllChem.ReplaceSubstructs(m,patt,repl)

for rm in rms:
   print(CHem.MolToSmiles(rm))

output is: C.CNC and CCNC

Why is the first result produced?
I checked the mailing list and could find this older threat
https://sourceforge.net/p/rdkit/mailman/message/28777648/.
But the answer to the related question is missing.

rdkit version is 2020.03.1dev1

Best wishes,
Markus
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] rdkit.ML.Scoring?

2019-11-06 Thread Markus Metz
Awesome, thanks very much!
Markus

On Wed, Nov 6, 2019 at 7:49 AM Greg Landrum  wrote:

> Hi Markus,
>
> try: from rdkit.ML.Scoring import Scoring
>
> We could make this a bit easier to discover...
>
> -greg
>
>
> On Wed, Nov 6, 2019 at 4:18 PM Markus Metz  wrote:
>
>> Hello all:
>> I just came across the description of this package on rdkit.org.
>> However, it seems there is not much to import.
>> When I type
>> from rdkit.ML.Scoring import 'tab'  in a jupyter notebook I am getting
>> Scoring
>> __doc__
>> __file__
>> __name__
>> __package__
>> Can you please clarify if and maybe when this function is available?
>> I am using rdkit.2019.09.1.
>> Many thanks in advance,
>> Markus
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] rdkit.ML.Scoring?

2019-11-06 Thread Markus Metz
Hello all:
I just came across the description of this package on rdkit.org.
However, it seems there is not much to import.
When I type
from rdkit.ML.Scoring import 'tab'  in a jupyter notebook I am getting
Scoring
__doc__
__file__
__name__
__package__
Can you please clarify if and maybe when this function is available?
I am using rdkit.2019.09.1.
Many thanks in advance,
Markus
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Transparent background for 2D molecule images

2017-11-20 Thread Markus Metz
Hi Dimitri and others:
I am happy to report that it works now as expected.
I needed to delete my old files and rerun the script.
With that the background is transparent.
My oversight.
Happy Thanksgiving!
Markus


On Mon, Nov 20, 2017 at 3:12 PM, Dimitri Maziuk 
wrote:

> On 11/20/2017 05:01 PM, Markus Metz wrote:
> > Here is a code snippet:
> ...
>
> Hmm. Now that I look at it, what I have running is
>
> def _to_rdk_svg( self, mol ) :
> assert isinstance( mol, rdkit.Chem.rdchem.Mol )
> dr = rdkit.Chem.Draw.rdMolDraw2D.MolDraw2DSVG( 1000, 1000 )
> dr.SetFontSize( 0.27 )
> op = dr.drawOptions()
> for i in range( mol.GetNumAtoms() ) :
> op.atomLabels[i]=mol.GetAtomWithIdx(i).GetSymbol()+str((i+1))
> rdkit.Chem.AllChem.Compute2DCoords( mol )
> dr.DrawMolecule( mol )
> dr.FinishDrawing()
> return dr.GetDrawingText()
>
> Sorry, it looks like the code from that thread, if I ever had it
> working, is gone and forgotten. Hopefully Greg will chime in.
>
> --
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Transparent background for 2D molecule images

2017-11-20 Thread Markus Metz
Hello:

I am interested in plotting 2D molecules without background color, that is
transparent.
When I searched the user list I thought I found a solution here:
https://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg07282.html
I might have completely misunderstood this email conversation because the
suggestions using

opts.clearBackground=False

or

opts.setBackgroundColour((1,1,0))

are not working for me.

Can anybody clarify how I can achieve a transparent background?

I am using the latest rdkit release.


Thank you very much fore your help.


Markus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] display mol in Jupyter NB: error kekulize not defined

2017-10-25 Thread Markus Metz
Hello:

Just started to play with the new rdkit version in Jupyter and wanted to
display a mol.
The mol is displayed but an error is also thrown.
Please see attached notebook.

Best,
Markus


displaykekulizerror.ipynb
Description: Binary data
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Two rdkit versions, always one is used

2017-10-25 Thread Markus Metz
And of course it would probably help to let you know that I am working on
centos 6.
In addition I checked the environment variables in my virtual environment
but could not find anything obviously wrong.
Markus


-- Forwarded message --
From: Markus Metz 
Date: Wed, Oct 25, 2017 at 6:36 AM
Subject: two rdkit versions, always one is used
To: RDKit Discuss 


Hello all:

I just installed the newest rdkit version via conda in a virtual env called
09217.
This went without any problems.
In addition I have an older rdkit version installed in a virtual env called
092016.

Now, when I run a jupyter notebook in the 092017 env and display the rdkit
version it still says 092016.

Does anybody have an idea what is going on?

Many thanks in advance,

Markus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] two rdkit versions, always one is used

2017-10-25 Thread Markus Metz
Hello all:

I just installed the newest rdkit version via conda in a virtual env called
09217.
This went without any problems.
In addition I have an older rdkit version installed in a virtual env called
092016.

Now, when I run a jupyter notebook in the 092017 env and display the rdkit
version it still says 092016.

Does anybody have an idea what is going on?

Many thanks in advance,

Markus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] create 2D structure image with text

2017-10-16 Thread Markus Metz
Dear all:

I was wondering if somebody could tell me if it is possible to create a 2D
picture drawing of a molecule combined with some text, let's say some SAR
data?

Any suggestions would be highly appreciated.

All the best,

Markus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] mmpdb installation on windows using mingw

2017-09-22 Thread Markus Metz
Hello Christian:

I am trying to install your program and get the following error message:

$ mmpdb help-analysis
Traceback (most recent call last):
  File "C:/Users/---/Anaconda3/envs/my-rdkit-env/Scripts/mmpdb", line 8, in

signal.signal(signal.SIGPIPE, signal.SIG_DFL) # Allow the output pipe
to be closed
AttributeError: module 'signal' has no attribute 'SIGPIPE'

Not sure what to do about it. Any input would be greatly appreciated.

Cheers,
Markus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Another Can't kekulize mol observation

2017-04-27 Thread Markus Metz
Hi Greg:

Your suggestions pointed me into the right direction. Thank you very much.

I tried your example but it seems (?) that the method GetAtomWithIdx() is
not available for edit_mol.
So I stored a neighbor atom which is a N atom, is aromatic and does not
belong to the same ring. I then applied the setnumexplicitHs method on the
mol.

Cheers,
Markus


On Thu, Apr 27, 2017 at 8:07 AM, Greg Landrum 
wrote:

> Hi Markus,
>
> The general rule of thumb is that if you remove an exocyclic neighbor from
> an aromatic heteroatom you need to add an "explicit H" to the heteroatom.
> Here's a modification of one of your pieces of code that adds that H as an
> atom that's actually in the graph:
>
> # use ReplaceAtom:
> Hatom = Chem.MolFromSmiles('[H]').GetAtomWithIdx(0)
>
> atidx = 8
>
> edit_mol = Chem.EditableMol(mol)
>
> edit_mol.ReplaceAtom(atidx,Hatom)
> scaffold = edit_mol.GetMol()
>
> scaffold_smiles = Chem.MolToSmiles(scaffold)
> print(scaffold_smiles)
>
> The change relative to what you were doing is the use of MolFromSmiles()
> to get the H.
>
> A more efficient approach that has the advantage of not leaving extra H
> atoms in the molecule that then need to be removed is to add the "explicit
> H" to the atom:
>
> atidx = 8
> nbrIdx = 7
>
> edit_mol = Chem.RWMol(mol)
>
> edit_mol.RemoveAtom(atidx)
> edit_mol.GetAtomWithIdx(nbrIdx).SetNumExplicitHs(1)
> scaffold = edit_mol.GetMol()
>
> scaffold_smiles = Chem.MolToSmiles(scaffold)
> print(scaffold_smiles)
>
> This produces:
>
> c1ccc(cc1)-c1n[nH]c(n1)-c1c1
>
>
> I hope that helps
> -greg
>
>
> On Thu, Apr 27, 2017 at 4:53 PM, Markus Metz  wrote:
>
>> Hello all:
>>
>> Thank you very much for your messages.
>>
>> As I would like to process many molecules manually editing smiles is
>> unfortunately not an option.
>>
>> Therefore I tried to automatize this step using the method ReplaceAtom of
>> the class EditableMol.
>> I defined an Hatom and tried to use it. Upon executing attached notebook
>> the input molecule is unchanged.
>>
>> Do you have another suggestions which might help answer my question?
>>
>> Best,
>> Markus
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Apr 26, 2017 at 11:46 PM, Peter S. Shenkin 
>> wrote:
>>
>>> I would just replace 'n' with '[nH]' in your existing SMILES, for the N
>>> you want the H on.
>>>
>>> -P.
>>>
>>> On Thu, Apr 27, 2017 at 12:32 AM, Hongbin Yang 
>>> wrote:
>>>
>>>> Hi Markus,
>>>> “c1ccc(cc1)-c1nnc(n1)-c1c1” is different from 
>>>> "c1ccc(cc1)-c1nncn1-c1c1",
>>>> so you cannot remove the parentheses.
>>>>
>>>> The error "Can't kekulize mol." is caused by the triazole in your
>>>> molecule.
>>>>
>>>> "c1nncn1" tells that the molecule is aromatic, but it do not tell
>>>> where the H is.
>>>>
>>>> For example,  "C1=NN=CN1" is "4H-1,2,4-triazole" and "C1=NC=NN1" is 
>>>> 1H-1,2,4-triazole.
>>>> They are different in Kekulize but both of them can represented by 
>>>> "c1nncn1"
>>>>
>>>> There's two solutions I suggest:
>>>> 1. use `Chem.MolFromSmiles('c1ccc(cc1)-c1nnc(n1)-c1c1',False)`
>>>> (reference: http://www.rdkit.org/docs/api/rdkit.Chem.rdmolfi
>>>> les-module.html#MolFromSmiles)
>>>>
>>>> 2. Manually Kekulize it: 
>>>> `Chem.MolFromSmiles('c1ccc(cc1)-C1=NN=C(N1)-c1c1')`
>>>> . This indicate the H is on the 4'N.
>>>>
>>>>
>>>> --
>>>> Hongbin Yang
>>>>
>>>>
>>>> *From:* Markus Metz 
>>>> *Date:* 2017-04-27 09:30
>>>> *To:* RDKit Discuss 
>>>> *Subject:* [Rdkit-discuss] Another Can't kekulize mol observation
>>>> Hello all:
>>>>
>>>> I obtained this smiles string:
>>>> c1ccc(cc1)-c1nnc(n1)-c1c1
>>>> by removing atoms from the n1 in parentheses.
>>>>
>>>> Using:
>>>> mol = Chem.MolFromSmiles("c1ccc(cc1)-c1nnc(n1)-c1c1")
>>>> throws an error: Can't kekulize mol.
>>>>
>>>> Using
>>>> mol = Chem.MolFromSmiles("c1ccc(cc1)-c1nncn1-c1c1")
>>>> works fine.
>&g

Re: [Rdkit-discuss] Another Can't kekulize mol observation

2017-04-27 Thread Markus Metz
Hello all:

Thank you very much for your messages.

As I would like to process many molecules manually editing smiles is
unfortunately not an option.

Therefore I tried to automatize this step using the method ReplaceAtom of
the class EditableMol.
I defined an Hatom and tried to use it. Upon executing attached notebook
the input molecule is unchanged.

Do you have another suggestions which might help answer my question?

Best,
Markus







On Wed, Apr 26, 2017 at 11:46 PM, Peter S. Shenkin 
wrote:

> I would just replace 'n' with '[nH]' in your existing SMILES, for the N
> you want the H on.
>
> -P.
>
> On Thu, Apr 27, 2017 at 12:32 AM, Hongbin Yang 
> wrote:
>
>> Hi Markus,
>> “c1ccc(cc1)-c1nnc(n1)-c1c1” is different from 
>> "c1ccc(cc1)-c1nncn1-c1c1",
>> so you cannot remove the parentheses.
>>
>> The error "Can't kekulize mol." is caused by the triazole in your
>> molecule.
>>
>> "c1nncn1" tells that the molecule is aromatic, but it do not tell where
>> the H is.
>>
>> For example,  "C1=NN=CN1" is "4H-1,2,4-triazole" and "C1=NC=NN1" is 
>> 1H-1,2,4-triazole.
>> They are different in Kekulize but both of them can represented by "c1nncn1"
>>
>> There's two solutions I suggest:
>> 1. use `Chem.MolFromSmiles('c1ccc(cc1)-c1nnc(n1)-c1c1',False)`
>> (reference: http://www.rdkit.org/docs/api/rdkit.Chem.rdmolfi
>> les-module.html#MolFromSmiles)
>>
>> 2. Manually Kekulize it: 
>> `Chem.MolFromSmiles('c1ccc(cc1)-C1=NN=C(N1)-c1c1')`
>> . This indicate the H is on the 4'N.
>>
>>
>> --
>> Hongbin Yang
>>
>>
>> *From:* Markus Metz 
>> *Date:* 2017-04-27 09:30
>> *To:* RDKit Discuss 
>> *Subject:* [Rdkit-discuss] Another Can't kekulize mol observation
>> Hello all:
>>
>> I obtained this smiles string:
>> c1ccc(cc1)-c1nnc(n1)-c1c1
>> by removing atoms from the n1 in parentheses.
>>
>> Using:
>> mol = Chem.MolFromSmiles("c1ccc(cc1)-c1nnc(n1)-c1c1")
>> throws an error: Can't kekulize mol.
>>
>> Using
>> mol = Chem.MolFromSmiles("c1ccc(cc1)-c1nncn1-c1c1")
>> works fine.
>>
>> Is there any workaround?
>> Any input is highly appreciated.
>>
>> Cheers,
>> Markus
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>


Cannot_Kekulize.ipynb
Description: Binary data
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Another Can't kekulize mol observation

2017-04-26 Thread Markus Metz
Hello all:

I obtained this smiles string:
c1ccc(cc1)-c1nnc(n1)-c1c1
by removing atoms from the n1 in parentheses.

Using:
mol = Chem.MolFromSmiles("c1ccc(cc1)-c1nnc(n1)-c1c1")
throws an error: Can't kekulize mol.

Using
mol = Chem.MolFromSmiles("c1ccc(cc1)-c1nncn1-c1c1")
works fine.

Is there any workaround?
Any input is highly appreciated.

Cheers,
Markus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] generating scaffold trees

2017-03-31 Thread Markus Metz
Dear Axel and all:

I have come across an older discussion about Ansgar Schuffenhauer's work on
scaffolds:
--

Axel Pahl 

Fri, 22 May 2015 04:39:33 -0700


Dear RDKitters,

has someone used the RDKit to generate scaffold trees from molecules as
described in this paper:
Schuffenhauer, A., Ertl, P., Roggo, S., Wetzel, S., Koch, M. A.,
Waldmann, H., J. Chem. Inf. Model. 2007, 47, 47-58

I know that this is possible with ScaffoldHunter and that there is a
Pipeline Pilot component for it, but being able to do it in RDKit would
fit especially well in my workflow...

Kind regards and have a nice weekend,
Axel


--

Has there been any update regarding this matter?

Thank you very much and cheers,
Markus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Molecule representation

2017-03-07 Thread Markus Metz
Dear Stephane:
Thank you very much.
I will give it a try.
Cheers,
Markus

On Tue, Mar 7, 2017 at 3:39 PM, Stéphane Téletchéa <
stephane.teletc...@univ-nantes.fr> wrote:

> Le 07/03/2017 Ă  19:00, Markus Metz a Ă©crit :
> > Does anybody have a suggestion how I might change the molecular
> > representation?
>
> Dear Markus,
>
> If you want a clever image, you could use pymol in XML-RPC mode
> (https://iwatobipen.wordpress.com/2013/09/16/rdkit-and-pymol/),
> or draw an image with thicker bonds
> (http://asteeves.github.io/blog/2015/01/12/optimizing-in-rdkit/, but
> check also http://asteeves.github.io/blog/2015/01/14/editing-in-rdkit/
> especially the second point for drawing parameters).
>
> I'm not 100% sure it will be perfect for your needs, especially if you
> have large molecules (or a lot of them), but at least you have entry
> pointers to dig with.
>
> Best,
>
> Stéphane
>
> --
> Lecturer, UFIP, UMR 6286 CNRS, Team Protein Design In Silico
> UFR Sciences et Techniques, 2, rue de la HoussiniĂšre, BĂąt. 25, 44322
> Nantes cedex 03, France
> TĂ©l : +33 251 125 636 / Fax : +33 251 125 632
> http://www.ufip.univ-nantes.fr/ - http://www.steletch.org
>
>
> 
> --
> Announcing the Oxford Dictionaries API! The API offers world-renowned
> dictionary content that is easy and intuitive to access. Sign up for an
> account today to start using our lexical data to power your apps and
> projects. Get started today and enter our developer competition.
> http://sdm.link/oxford
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Molecule representation

2017-03-07 Thread Markus Metz
Dear all:

I am wondering if it is possible to depict 2D structures as ball and stick.
I have some very simple fragments and I would like to use them for axis
annotation in a heatmap.
Currently I generate the png files via MolToFile and read them in again.
Changing size did not help.
I also tried to generate the molecules on the fly.
But so far I am getting only 2D pictures which are not readable. I hope to
resolve this issue by picking another representation such as ball and stick.
Does anybody have a suggestion how I might change the molecular
representation?
As always I very much appreciate any input somebody may have.

Cheers,

Markus
--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Getting Started: labeling sidechain by number of core atom it was attached to

2017-02-23 Thread Markus Metz
Hello Greg:

Duh! I guess I sat too long in front of the screen.

As always, thank you very much for your help!

Markus


On Wed, Feb 22, 2017 at 7:50 PM, Greg Landrum 
wrote:

> Hi Markus,
>
>
> On Thu, Feb 23, 2017 at 1:41 AM, Markus Metz  wrote:
>
>>
>> According to the example it is possible to use the option
>> labelByIndex=True in ReplaceCore.
>> Converting the sidechains from mol to smiles with isomericSmiles=True
>> labels the sidechains with 1 and 5.
>> Where do these numbers come from?
>>
>
> They are the indices of the atoms in the core.
>
>
>> I included the atom indices in the mol drawing but the core atoms are 1
>> and 8. (please see attached jupyter file). What am I missing?
>>
>
> The code where you assign the atom map numbers so that you can see the
> indices:
>
>
> matches = m1.GetSubstructMatch(core)
> print(matches)
>
> for i, atom_idx in enumerate(matches, 1):
> m1.GetAtomWithIdx(atom_idx).SetProp('molAtomMapNumber', str(atom_idx))
>
>
> is using the indices in m1. You want the indices in the core:
>
>
> for i, atom_idx in enumerate(matches, 1):
> m1.GetAtomWithIdx(atom_idx).SetProp('molAtomMapNumber', str(i))
>
>
> (Note: you can also do SetIntProp() and skip the conversion of i to a
> string).
>
> Best,
> -greg
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Getting Started: labeling sidechain by number of core atom it was attached to

2017-02-22 Thread Markus Metz
Dear all:

According to the example it is possible to use the option labelByIndex=True
in ReplaceCore.
Converting the sidechains from mol to smiles with isomericSmiles=True
labels the sidechains with 1 and 5.
Where do these numbers come from?
I included the atom indices in the mol drawing but the core atoms are 1 and
8. (please see attached jupyter file). What am I missing?

Thanks in advance for your help.

Best,

Markus


Testcase.ipynb
Description: Binary data
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] How to determine if atoms are part of the same ring?

2017-02-10 Thread Markus Metz
Dear Andrew:

Thank you very much for your input.
I was able to refine and correct my approach with your suggestions.

Cheers,
Markus


On Wed, Feb 8, 2017 at 12:23 PM, Andrew Dalke 
wrote:

> On Feb 8, 2017, at 19:22, Markus Metz  wrote:
> > The question to you is: Is there another more elegant way of doing it?
> May be I missed something from the python API?
>
> I don't quite follow what you are looking for, though I have managed to
> condense your code somewhat, into:
>
> updatedMapping = None
> for ring in m.GetRingInfo().AtomRings():
> if set(ring).issubset(maps):
> updatedMapping = ring
>
> if updatedMapping is not None:
> updatedMapping = sorted(updatedMapping)
> for i, atom_idx in enumerate(updatedMapping, 1):
> m.GetAtomWithIdx(atom_idx).SetProp("molAtomMapNumber", str(i))
>
>
> Is it that you do not want to number the "*" atoms? In that case you can
> ask the query structure for the atoms with atomic number 0:
>
> >>> for atom in corea.GetAtoms():
> ...print(atom.GetAtomicNum())
> ...
> 0
> 6
> 6
> 6
> 6
> 6
> 6
> 0
>
> and ignore numbering the atoms at those positions.
>
> Or that you don't want to include ring atoms which aren't ring atoms in
> the query structure?
>
> In which case you can ask the query structure for its rings:
>
> >>> corea.GetRingInfo().AtomRings()
> ((1, 6, 5, 4, 3, 2),)
>
> and use that to guide which atoms should/should not be numbered.
>
> Cheers,
>
> Andrew
> da...@dalkescientific.com
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] How to determine if atoms are part of the same ring?

2017-02-08 Thread Markus Metz
Dear RDKit community:

I am facing the situation that I would like to attach indices to atoms in a
molecule defined by a substructure. The substitution pattern is of
importance. Therefore I needed to include the wildcards atoms in my
substructure. If I get the atom indices of this substructure, the matched
atoms are still included and will be used for attaching indices (see at the
end of the attached notebook for an example)

I found a solution how to get rid off the non ring atom. That was
straightforward. For the attached atom which is part of another ring I
needed to do something differently. I determined the atom indices in each
ring with GetRingInfo and then I determined which of these rings is part of
the tuple of the atom indices of the pattern. Once determined I can do what
I need.

The question to you is: Is there another more elegant way of doing it? May
be I missed something from the python API?

I would appreciate any input.

Cheers,
Markus


AtomMapping.ipynb
Description: Binary data
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] postgres installation observation

2017-01-25 Thread Markus Metz
Hello all:

In the process of installing the latest rdkit version I noticed that when I
try and install postgres with
conda install -c rdkit rdkit-posgresql
I am getting the warning that rdkit will be downgraded.

Is there a way to update this?
Thank you very much in advance.
Markus
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Another Can't kekulize mol question

2016-12-14 Thread Markus Metz
Hello all:

This might be another FAQ but here it goes.

I am wondering if there is a convenient way to output those structures
throwing errors.

BTW, the molecules were sanitized.

As always, any input is highly appreciated.

Markus
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] (no subject)

2016-09-22 Thread Markus Metz
Hello:
Greg and Curt your comments are very much appreciated.
Thanks for getting back to me!
Best,
Markus

On Wed, Sep 21, 2016 at 8:31 PM, Greg Landrum 
wrote:

> Hi Markus,
>
> Curt's instincts are dead on: the problem here is the rings.
>
> I'll show the fix and then explain what's going on. You just need to add
> one line to your code:
>
> core = "[a]12[a][a][a][a][a]1[a][a][a]2"
> pattern = Chem.MolFromSmarts(core)
> Chem.GetSSSR(pattern)
> AllChem.Compute2DCoords(pattern)
>
> when I do this, I get the following depiction for "c1(ocn2)c21":
>
> (The highlighting is due to the substructure match that's done during the
> generation of coordinates).
>
> So why is this necessary?
> The code that generates 2D coordinates uses information about the size of
> ring systems in the molecule as part of the coordinate generation. If no
> ring information is present (which is true of molecules generated from
> SMARTS since they are not fully sanitized on construction) then the code
> calls FastFindRings(). This function is perfectly capable of identifying
> all ring atoms and bonds, but it isn't very good at getting ring sizes
> correct for fused systems (it finds rings, but not the smallest rings). The
> consequences are the badly generated coordinates for fused ring systems
> that you were seeing.
>
> I think the current behavior of the code "isn't really ideal": the
> coordinate generation code should call the SSSR algorithm in these cases so
> that it can generate better coordinates. I'll take a look at the code and
> think about changing it.
>
> As an aside: if you're puzzled by the behavior of AllChem.
> GenerateDepictionMatching2DStructure() you can always just take a look at
> the drawing of the query molecule itself. It's not always the most
> informative depiction when it comes to what the atom and bond queries are,
> but you at least will see the coordinates.
>
> A second aside: the molecule depictions in that notebook indicate that you
> are stuck using the fallback drawing code, which creates fairly ugly
> pictures. You can get better drawings by either installing cairo and
> pycairo (in which case the code should automatically use those) or telling
> the drawing code to use SVG for the rendering:
>
> from rdkit.Chem.Draw import IPythonConsole
> IPythonConsole.ipython_useSVG=True
>
> It really does make the drawings a lot better.
>
> I hope this helps,
> -greg
>
>
>
>
>
>
> On Wed, Sep 21, 2016 at 8:47 PM, Markus Metz  wrote:
>
>> Hello all:
>>
>> I am trying to perform a 2D alignment of molecules by using a pattern for
>> which I am using Compute2DCoords.
>>
>> If I use a smarts string matching napthalene the 2D depiction is as one
>> would expect.
>> However, if I am switching to a 5,6 aromatic smarts pattern the matched
>> benzoxazol the 2D structure looks rather unusual.
>>
>> Is there a way to match the 5,6 with the 6,6 pattern behavior?
>>
>> Any hint is very much appreciated,
>>
>> Markus
>>
>> P.S. a work book is attached.
>>
>> 
>> --
>>
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>
--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] 2D alignment question

2016-09-21 Thread Markus Metz
==
Trying to post my message again as there seems to be a problem with my
first attempt.
==

Hello all:

I am trying to perform a 2D alignment of molecules by using a pattern for
which I am using Compute2DCoords.

If I use a smarts string matching napthalene the 2D depiction is as one
would expect.
However, if I am switching to a 5,6 aromatic smarts pattern the matched
benzoxazol the 2D structure looks rather unusual.

Is there a way to match the 5,6 with the 6,6 pattern behavior?

Any hint is very much appreciated,

Markus

P.S. a work book is attached.


2dDepiction.ipynb
Description: Binary data
--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] (no subject)

2016-09-21 Thread Markus Metz
Hello all:

I am trying to perform a 2D alignment of molecules by using a pattern for
which I am using Compute2DCoords.

If I use a smarts string matching napthalene the 2D depiction is as one
would expect.
However, if I am switching to a 5,6 aromatic smarts pattern the matched
benzoxazol the 2D structure looks rather unusual.

Is there a way to match the 5,6 with the 6,6 pattern behavior?

Any hint is very much appreciated,

Markus

P.S. a work book is attached.


2dDepiction.ipynb
Description: Binary data
--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] AllChem.DeleteSubstructs question

2016-09-16 Thread Markus Metz
Hello:
Greg's suggestions worked out.
Best,
Markus

On Fri, Sep 16, 2016 at 1:44 PM, Greg Landrum 
wrote:

> Glad to hear it. Would you mind replying to the list as well so that the
> thread is closed?
>
> Best,
> -greg
>
>
> On Fri, Sep 16, 2016 at 1:33 PM, Markus Metz  wrote:
>
>> Hi Greg:
>> Just tried it out and it works great.
>> Thank you very much!
>> Markus
>>
>> On Fri, Sep 16, 2016 at 12:21 PM, Greg Landrum 
>> wrote:
>>
>>> Hi Markus,
>>>
>>>
>>> On Fri, Sep 16, 2016 at 11:35 AM, Markus Metz  wrote:
>>>
>>>> Hello everybody:
>>>>
>>>> I am working on a script which removes the cores based on a given
>>>> pattern and I am wondering how I can accomplish that if two matches are
>>>> present in the parent molecule two outputs are generated with each matching
>>>> pattern deleted once.
>>>>
>>>> ReplaceSubstructs seems to have an option like this: replaceAll=False
>>>>
>>>
>>> Indeed, adding that option to DeleteSubstructs() is a good idea.
>>>
>>> I tried to use replaceSubstructs but using H as smiles string for
>>>> replacement threw me an error.
>>>> C worked.
>>>>
>>>
>>> The problem here may have been that you neglected the square brackets
>>> around the 'H' in the SMILES?
>>> This seems to work:
>>>
>>> repl = Chem.MolFromSmiles('[H]')
>>>
>>> frags = AllChem.ReplaceSubstructs(mol,pattern,repl)
>>>
>>>
>>>
>>> for frag in frags:
>>>
>>> print(Chem.MolToSmiles(frag))
>>>
>>>
>>>
>>> [H]Cc1c1
>>> [H]Cc1c1
>>>
>>> Probably you want to call Chem.RemoveHs() on the outputs so that those
>>> Hs disappear.
>>> This isn't a great long-time solution (that is going to require the
>>> changes to DeleteSubstructs()), but it may help in the short term.
>>>
>>> -greg
>>>
>>>
>>>
>>>> I have attached a notebook for you to better understand what I mean.
>>>>
>>>> Any suggestion you might have would be highly appreciated.
>>>>
>>>> Cheerio,
>>>>
>>>> Markus
>>>>
>>>> 
>>>> --
>>>>
>>>> ___
>>>> Rdkit-discuss mailing list
>>>> Rdkit-discuss@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>>
>>>>
>>>
>>
>
--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] AllChem.DeleteSubstructs question

2016-09-16 Thread Markus Metz
Hello everybody:

I am working on a script which removes the cores based on a given pattern
and I am wondering how I can accomplish that if two matches are present in
the parent molecule two outputs are generated with each matching pattern
deleted once.

ReplaceSubstructs seems to have an option like this: replaceAll=False

I tried to use replaceSubstructs but using H as smiles string for
replacement threw me an error.
C worked.

I have attached a notebook for you to better understand what I mean.

Any suggestion you might have would be highly appreciated.

Cheerio,

Markus


test.ipynb
Description: Binary data
--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] substructure search with brics framents on cdk2 cmpds fails partially

2016-08-04 Thread Markus Metz
Hello all:

I am trying to use the brics algorithm to fragment my compounds, filter the
fragments and try to group the original compounds by selected fragments.

As test I used the cdk2 data set provided by rdkit.

Here is a sample code partly cannibalizing Greg's and others' example code:


This part creates and displays the fragments:
---
from rdkit.Chem import BRICS

df = PandasTools.LoadSDF('cdk2.sdf')
df.describe()

allfrags=set()

for i,rows in df.iterrows():
mol = rows['ROMol']
pieces = BRICS.BRICSDecompose(mol)
allfrags.update(pieces)

from rdkit.Chem import Descriptors
from rdkit.Chem import rdMolDescriptors

fragList = list(allfrags)
df1 = pd.Series(fragList)
df2 = df1.to_frame()
df2.columns = ['smiles']
PandasTools.AddMoleculeColumnToFrame(df2,smilesCol='smiles', molCol='ROMol')

df2['NumRings'] = df2['ROMol'].map(rdMolDescriptors.CalcNumRings)
df2['RingAroms'] = df2['ROMol'].apply(lambda x:
Descriptors.NumAromaticRings(x))
df2['HeavyAtoms'] = df2['ROMol'].apply(lambda x:
Descriptors.HeavyAtomCount(x))

df3 = df2[df2['HeavyAtoms']>6]
df4 = df3[df3['RingAroms'] > 0]
df5 = df4[df4['NumRings'] > 1]

PandasTools.FrameToGridImage(df5, column='ROMol')



This part removes the dummy atoms from smiles and tries to regenerate mol
objects:
---
import re
resultsList = pd.DataFrame()

with open('my_csv.csv', 'a') as f:

for smi in df5['ROMol']:
smi = Chem.MolToSmiles(smi)
smi = re.sub(r"(\(\[\*\]\))", "", smi)
smi = re.sub(r"(\[\*\])", "", smi)

pattern = Chem.MolFromSmiles(smi)
---

This throws me here an error saying:
RDKIT Error: Can't kekulize mol

Do you know what is going on?

Many thanks in advance,
Markus
--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] m.GetProp('property'): KeyError: 'property'

2016-07-12 Thread Markus Metz
Dear all:

I spend some time searching the rdkit website and its mailing list. But I
was not able to find anything regarding my issue. I am a newbie. So bear
with me if this is a FAQ.

I am trying to extract the properties for molecules from an sd file.
This worked fine with the id.
But not so for other properties. And I assume this has to do with that not
for all molecules in the data set these properties are defined. Could this
be the reason for the error?
If so, how can I get around it? How does rdkit deal with empty data?

This is a very common question and I apologize in advance for this FAQ.

Best regards,

Markus
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss