Re: [Rdkit-discuss] bond order is lost in reaction transformation

2020-01-03 Thread Paolo Tosco
Hi Devendra,

Your starting molecule is aromatic, as is your product; by default RDKit writes 
aromatic SMILES.
If you wish to write your molecule as kekulized SMILES, do the following:

In [1]: from rdkit import Chem  
   
In [2]: smi = "CN1C(NC2=NC=CC=C2)=CC=C1"
   
In [3]: mol = Chem.MolFromSmiles(smi)   
   
In [4]: Chem.MolToSmiles(mol)   
   
Out[4]: 'Cn11Nc1n1' 
   
In [6]: Chem.Kekulize(mol)  
   
In [7]: Chem.MolToSmiles(mol, kekuleSmiles=True)
   
Out[7]: 'CN1C=CC=C1NC1=NC=CC=C1'

Cheers,
p.

> On 3 Jan 2020, at 23:26, Devendra Dhaked  wrote:
> 
> 
> Hi,
> 
> I have written SMIRKS for reaction transformation of  reagent 
> "CN1C(NC2=NC=CC=C2)=CC=C1" into product "CN1CC=CC1=NC2=NC=CC=C2".
> 
> but after transformation in forward direction it showed lost bond order in 
> product molecule Cn1cC=C[c]1=Nc1n1.
> code for forward direction
> reactant1 = Chem.MolFromSmiles('CN1C(NC2=NC=CC=C2)=CC=C1')
> rxn = 
> AllChem.ReactionFromSmarts('[O,NX3;H1:2][cX3z2;r5:3]:[c;r5:4][c;r5:5]:[cr5R{1-2}:6]>>[O,S,NX2:2]=[CX3;z2;r5:3][C;r5:4]=[C;r5:5][CX4;r5;!H0:6]')
> ps=rxn.RunReactants((reactant1,))
> print(len(ps))
> print(Chem.MolToSmiles(ps[0][0],True))
> 
> Similarly in backward direction produced product(reactant) also lost its bond 
> order
> CN11Nc1n1.
> code for backward direction
> reactant1 = Chem.MolFromSmiles('CN1CC=CC1=NC2=NC=CC=C2')
> rxn = 
> AllChem.ReactionFromSmarts('[O,S,NX2:2]=[CX3;z2;r5:3][C;r5:4]=[C;r5:5][CX4;r5;!H0:6]>>[O,NX3;H1:2][cX3z2;r5:3]:[c;r5:4][c;r5:5]:[cr5R{1-2}:6]')
> ps=rxn.RunReactants((reactant1,))
> print(len(ps))
> print(Chem.MolToSmiles(ps[0][0],True))
> 
> Thanks.
> 
> -- 
> Regards
> 
> Devendra K Dhaked (Ph.D.)
> Center for Cancer Research
> Chemical Biology Laboratory
> National Cancer Institute (NIH)
> Boyles Street, Frederick, MD
> USA
> ___
> 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] bond order is lost in reaction transformation

2020-01-03 Thread Devendra Dhaked
Hi,

I have written SMIRKS for reaction transformation of  reagent
"CN1C(NC2=NC=CC=C2)=CC=C1" into product "CN1CC=CC1=NC2=NC=CC=C2".

but after transformation in forward direction it showed lost bond order in
product molecule Cn1cC=C[c]1=Nc1n1.
code for forward direction
reactant1 = Chem.MolFromSmiles('CN1C(NC2=NC=CC=C2)=CC=C1')
rxn =
AllChem.ReactionFromSmarts('[O,NX3;H1:2][cX3z2;r5:3]:[c;r5:4][c;r5:5]:[cr5R{1-2}:6]>>[O,S,NX2:2]=[CX3;z2;r5:3][C;r5:4]=[C;r5:5][CX4;r5;!H0:6]')
ps=rxn.RunReactants((reactant1,))
print(len(ps))
print(Chem.MolToSmiles(ps[0][0],True))

Similarly in backward direction produced product(reactant) also lost its
bond order
CN11Nc1n1.
code for backward direction
reactant1 = Chem.MolFromSmiles('CN1CC=CC1=NC2=NC=CC=C2')
rxn =
AllChem.ReactionFromSmarts('[O,S,NX2:2]=[CX3;z2;r5:3][C;r5:4]=[C;r5:5][CX4;r5;!H0:6]>>[O,NX3;H1:2][cX3z2;r5:3]:[c;r5:4][c;r5:5]:[cr5R{1-2}:6]')
ps=rxn.RunReactants((reactant1,))
print(len(ps))
print(Chem.MolToSmiles(ps[0][0],True))

Thanks.

-- 
Regards

Devendra K Dhaked (Ph.D.)
Center for Cancer Research
Chemical Biology Laboratory
National Cancer Institute (NIH)
Boyles Street, Frederick, MD
USA
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] passing options to javac when building from source

2020-01-03 Thread Paolo Tosco

Hi Tim,

based on

https://cmake.org/cmake/help/latest/module/UseJava.html

set(CMAKE_JAVA_COMPILE_FLAGS"-source 8")

might do the trick.

Cheers,
p.

On 03/01/2020 17:41, Tim Dudgeon wrote:

Hi Paolo,

I'm afraid that's not working for me. Still getting Java11 class files.
My cmake command is:

cmake -Wno-dev\
  -DPYTHON_EXECUTABLE=/usr/bin/python3\
  -DRDK_BUILD_INCHI_SUPPORT=ON\
  -DRDK_BUILD_AVALON_SUPPORT=ON\
  -DRDK_BUILD_PYTHON_WRAPPERS=ON\
  -DRDK_BUILD_SWIG_WRAPPERS=ON\
  -DJAVA_COMPILE="/usr/bin/javac -source 8"\
  ..


When it's built I run:

javap -cp ./Code/JavaWrappers/gmwrapper/org.RDKit.jar -verbose 
org.RDKit.RDKFuncs | grep major


and get:

  major version: 55

55 is the class version for Java11.

In fact if I set JAVA_COMPILE to complete nonsense everything still 
builds OK!


Tim

On 26/12/2019 15:39, Paolo Tosco wrote:

Hi Tim,

Try adding this to your CMake command:

-DJAVA_COMPILE="/usr/bin/javac -source 8"

Cheers,
p.

On 26/12/2019 15:22, Tim Dudgeon wrote:
When building the Java wrappers from source (the 
-DRDK_BUILD_SWIG_WRAPPERS=ON option) is possible to specify options 
to pass on to javac.


Specifically I'm wanting to use the '-source 8' option as most 
distros now come with java11 (and make it difficult to install an 
earlier one) but I want to build a version of org.RDKit.jar that is 
compatible with older Java versions.


Thanks

Tim



___
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


Re: [Rdkit-discuss] passing options to javac when building from source

2020-01-03 Thread Tim Dudgeon

Hi Paolo,

I'm afraid that's not working for me. Still getting Java11 class files.
My cmake command is:

cmake -Wno-dev\
  -DPYTHON_EXECUTABLE=/usr/bin/python3\
  -DRDK_BUILD_INCHI_SUPPORT=ON\
  -DRDK_BUILD_AVALON_SUPPORT=ON\
  -DRDK_BUILD_PYTHON_WRAPPERS=ON\
  -DRDK_BUILD_SWIG_WRAPPERS=ON\
  -DJAVA_COMPILE="/usr/bin/javac -source 8"\
  ..


When it's built I run:

javap -cp ./Code/JavaWrappers/gmwrapper/org.RDKit.jar -verbose 
org.RDKit.RDKFuncs | grep major


and get:

  major version: 55

55 is the class version for Java11.

In fact if I set JAVA_COMPILE to complete nonsense everything still 
builds OK!


Tim

On 26/12/2019 15:39, Paolo Tosco wrote:

Hi Tim,

Try adding this to your CMake command:

-DJAVA_COMPILE="/usr/bin/javac -source 8"

Cheers,
p.

On 26/12/2019 15:22, Tim Dudgeon wrote:
When building the Java wrappers from source (the 
-DRDK_BUILD_SWIG_WRAPPERS=ON option) is possible to specify options 
to pass on to javac.


Specifically I'm wanting to use the '-source 8' option as most 
distros now come with java11 (and make it difficult to install an 
earlier one) but I want to build a version of org.RDKit.jar that is 
compatible with older Java versions.


Thanks

Tim



___
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


Re: [Rdkit-discuss] compiling C++examples from "Release_2019_09_2"

2020-01-03 Thread Rasmus "Termo" Lundsgaard
Found a solution, but I guess the CMakeLists.txt should be updated to work
with the current state of the project.

adding "maeparser coordgen RingDecomposerLib DataStructs" to the end of the
COMPONENTS list will add the correct .so files to RDKIT_LIBRARIES and it
compiles...

/Rasmus

On Fri, Jan 3, 2020 at 9:46 AM Rasmus "Termo" Lundsgaard <
termope...@gmail.com> wrote:

> Hi Dan
>
> Yes, they are in the $RDBASE/lib directory and LD_LIBRARY_PATH is set to
> point to this as well. That was also my first guess that LD_LIBRARY_PATH
> was not set correctly.
>
> mkdir -p build && cd build
> export RDBASE=/home/termo/HFlabs/rdkit
> export
> LD_LIBRARY_PATH=$RDBASE/lib:/home/termo/miniconda3/envs/rdkit-dev/include
>
> echo ""
> echo "LD_LIBRARY_PATH:" $LD_LIBRARY_PATH
> ls $RDBASE/lib/libRDKitmaeparser.so.1
> echo ""
>
> cmake -DBOOST_ROOT="/home/termo/miniconda3/envs/rdkit-dev" ..
> make VERBOSE=1
> cd ..
>
> gives this attached output (the same as before, but now also showing the
> file exists and LD_LIBRARY_PATH)
>
>
>
> On Fri, Jan 3, 2020 at 12:36 AM Dan Nealschneider <
> dan.nealschnei...@schrodinger.com> wrote:
>
>> Looks like you're missing  libRDKitmaeparser.so.1,
>> libRDKitcoordgen.so.1, libRDKitRingDecomposerLib.so.1,
>> and libRDKitDataStructs.so.1. Are they in a directory pointed to by your
>> LD_LIBRARY_PATH?
>>
>> *dan nealschneider* | senior developer
>> [image: Schrodinger Logo] 
>>
>>
>> On Thu, Jan 2, 2020 at 1:25 PM Rasmus "Termo" Lundsgaard <
>> termope...@gmail.com> wrote:
>>
>>> I have compiled rdkit as suggested in the docs by using a conda
>>> environment for c++ and boost.
>>>
>>> I would like to move from python to cpp with my RDkit work, and I
>>> thought to start with the C++ exaples in the Docs/Book, but I'm having some
>>> problems getting the minimal c++ examples to link with the current CMake
>>> files there.
>>>
>>> Attached is the output from the make command where I have only set it to
>>> make "example1.cpp" in CMakeLists.txt
>>>
>>> I guess the problem is the "/bin/ld: warning: libRDKitmaeparser.so.1,
>>> needed by /home/termo/HFlabs/rdkit/lib/libRDKitFileParsers.so, not found"
>>>
>>> I have set RDBASE and LD_LIBRARY_PATH, and as far as I can see with the
>>> "-Wl,-rpath,/home/termo/HFlabs/rdkit/lib" part in the linking command
>>> it should find the needed .so file (that is there).
>>>
>>> Any idea why it fails to find the .so files?
>>>
>>> /Rasmus
>>> ___
>>> 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


Re: [Rdkit-discuss] compiling C++examples from "Release_2019_09_2"

2020-01-03 Thread Rasmus "Termo" Lundsgaard
Hi Dan

Yes, they are in the $RDBASE/lib directory and LD_LIBRARY_PATH is set to
point to this as well. That was also my first guess that LD_LIBRARY_PATH
was not set correctly.

mkdir -p build && cd build
export RDBASE=/home/termo/HFlabs/rdkit
export
LD_LIBRARY_PATH=$RDBASE/lib:/home/termo/miniconda3/envs/rdkit-dev/include

echo ""
echo "LD_LIBRARY_PATH:" $LD_LIBRARY_PATH
ls $RDBASE/lib/libRDKitmaeparser.so.1
echo ""

cmake -DBOOST_ROOT="/home/termo/miniconda3/envs/rdkit-dev" ..
make VERBOSE=1
cd ..

gives this attached output (the same as before, but now also showing the
file exists and LD_LIBRARY_PATH)



On Fri, Jan 3, 2020 at 12:36 AM Dan Nealschneider <
dan.nealschnei...@schrodinger.com> wrote:

> Looks like you're missing  libRDKitmaeparser.so.1,
> libRDKitcoordgen.so.1, libRDKitRingDecomposerLib.so.1,
> and libRDKitDataStructs.so.1. Are they in a directory pointed to by your
> LD_LIBRARY_PATH?
>
> *dan nealschneider* | senior developer
> [image: Schrodinger Logo] 
>
>
> On Thu, Jan 2, 2020 at 1:25 PM Rasmus "Termo" Lundsgaard <
> termope...@gmail.com> wrote:
>
>> I have compiled rdkit as suggested in the docs by using a conda
>> environment for c++ and boost.
>>
>> I would like to move from python to cpp with my RDkit work, and I thought
>> to start with the C++ exaples in the Docs/Book, but I'm having some
>> problems getting the minimal c++ examples to link with the current CMake
>> files there.
>>
>> Attached is the output from the make command where I have only set it to
>> make "example1.cpp" in CMakeLists.txt
>>
>> I guess the problem is the "/bin/ld: warning: libRDKitmaeparser.so.1,
>> needed by /home/termo/HFlabs/rdkit/lib/libRDKitFileParsers.so, not found"
>>
>> I have set RDBASE and LD_LIBRARY_PATH, and as far as I can see with the
>> "-Wl,-rpath,/home/termo/HFlabs/rdkit/lib" part in the linking command it
>> should find the needed .so file (that is there).
>>
>> Any idea why it fails to find the .so files?
>>
>> /Rasmus
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>

LD_LIBRARY_PATH: 
/home/termo/HFlabs/rdkit/lib:/home/termo/miniconda3/envs/rdkit-dev/include
/home/termo/HFlabs/rdkit/lib/libRDKitmaeparser.so.1

-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: 
/home/termo/miniconda3/envs/rdkit-dev/bin/x86_64-conda_cos6-linux-gnu-cc
-- Check for working C compiler: 
/home/termo/miniconda3/envs/rdkit-dev/bin/x86_64-conda_cos6-linux-gnu-cc -- 
works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: 
/home/termo/miniconda3/envs/rdkit-dev/bin/x86_64-conda_cos6-linux-gnu-c++
-- Check for working CXX compiler: 
/home/termo/miniconda3/envs/rdkit-dev/bin/x86_64-conda_cos6-linux-gnu-c++ -- 
works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /home/termo/miniconda3/envs/rdkit-dev/include (found version 
"1.67.0") found components: iostreams filesystem system regex 
Looking for RDKit component ChemReactions
MyRDKit_LIBRARY_ChemReactions : 
/home/termo/HFlabs/rdkit/lib/libRDKitChemReactions.so
Looking for RDKit component FileParsers
MyRDKit_LIBRARY_FileParsers : 
/home/termo/HFlabs/rdkit/lib/libRDKitFileParsers.so
Looking for RDKit component SmilesParse
MyRDKit_LIBRARY_SmilesParse : 
/home/termo/HFlabs/rdkit/lib/libRDKitSmilesParse.so
Looking for RDKit component Depictor
MyRDKit_LIBRARY_Depictor : /home/termo/HFlabs/rdkit/lib/libRDKitDepictor.so
Looking for RDKit component RDGeometryLib
MyRDKit_LIBRARY_RDGeometryLib : 
/home/termo/HFlabs/rdkit/lib/libRDKitRDGeometryLib.so
Looking for RDKit component RDGeneral
MyRDKit_LIBRARY_RDGeneral : /home/termo/HFlabs/rdkit/lib/libRDKitRDGeneral.so
Looking for RDKit component SubstructMatch
MyRDKit_LIBRARY_SubstructMatch : 
/home/termo/HFlabs/rdkit/lib/libRDKitSubstructMatch.so
Looking for RDKit component Subgraphs
MyRDKit_LIBRARY_Subgraphs : /home/termo/HFlabs/rdkit/lib/libRDKitSubgraphs.so
Looking for RDKit component MolDraw2D
MyRDKit_LIBRARY_MolDraw2D : /home/termo/HFlabs/rdkit/lib/libRDKitMolDraw2D.so
Looking for RDKit component GraphMol
MyRDKit_LIBRARY_GraphMol : /home/termo/HFlabs/rdkit/lib/libRDKitGraphMol.so
Looking for RDKit component DistGeometry
MyRDKit_LIBRARY_DistGeometry : 
/home/termo/HFlabs/rdkit/lib/libRDKitDistGeometry.so
Looking for RDKit component DistGeomHelpers
MyRDKit_LIBRARY_DistGeomHelpers : 
/home/termo/HFlabs/rdkit/lib/libRDKitDistGeomHelpers.so
Looking for RDKit component MolAlign
MyRDKit_LIBRARY_MolAlign : /home/termo/HFlabs/rdkit/lib/libRDKitMolAlign.so
Looking for RDKit component Optimizer
MyRDKit_LIBRARY_Optimizer :