[Rdkit-discuss] add hydrogen after its removal

2019-03-22 Thread Pavel

Hello,

  I encountered with an issue which I cannot understand and solve. This 
might be a bug or a feature. After removal of some specific hydrogens I 
could not add them back. Is it expected behavior or should I create an 
issue on github?


print(' load mol ')
m = Chem.MolFromSmiles('c1c1O')
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' add Hs ')
m = Chem.AddHs(m)
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' remove H ')
em = Chem.EditableMol(m)
em.RemoveAtom(7)
print(Chem.MolToSmiles(em.GetMol(), allHsExplicit=True))
print(' add Hs ')
mm = Chem.AddHs(em.GetMol())
print(Chem.MolToSmiles(mm, allHsExplicit=True))
print(' update property cache ')
mm.UpdatePropertyCache()
print(Chem.MolToSmiles(mm, allHsExplicit=True))

output:

 load mol 
[OH][c]1[cH][cH][cH][cH][cH]1
 add Hs 
[H][O][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]
 remove H 
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]
 add Hs 
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]
 update property cache 
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]

Pavel.

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


Re: [Rdkit-discuss] add hydrogen after its removal

2019-03-22 Thread Paolo Tosco

Hi Pavel,

After you have first called AddHs(), all hydrogens in your molecule are 
now in the molecule graph as real atoms, and there are no more 
implicit/explicit Hs .


Therefore, when you call RemoveAtom(), you are removing a real atom from 
the molecule graph, and the implicit/explicit H count stays 0 for the 
parent heavy atom. Hence calling again AddHs() does not add any hydrogens.


If you wish the hydrogen to come back when you call AddHs(), you need to 
increase the explicit H count on the parent heavy atom:


print(' load mol ')
m = Chem.MolFromSmiles('c1c1O')
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' add Hs ')
m = Chem.AddHs(m)
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' remove H ')
nbrs = m.GetAtomWithIdx(7).GetNeighbors()
if (len(nbrs) == 1 and nbrs[0].GetAtomicNum() > 1):
    nbrs[0].SetNumExplicitHs(nbrs[0].GetNumExplicitHs() + 1)
em = Chem.EditableMol(m)
em.RemoveAtom(7)
print(Chem.MolToSmiles(em.GetMol(), allHsExplicit=True))
print(' add Hs ')
mm = Chem.AddHs(em.GetMol())
print(Chem.MolToSmiles(mm, allHsExplicit=True))

 load mol 
[OH][c]1[cH][cH][cH][cH][cH]1
 add Hs 
[H][O][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]
 remove H 
[H][O][c]1[cH][c]([H])[c]([H])[c]([H])[c]1[H]
 add Hs 
[H][O][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]

HTH, cheers,
p.

On 03/22/19 10:20, Pavel wrote:


Hello,

  I encountered with an issue which I cannot understand and solve. 
This might be a bug or a feature. After removal of some specific 
hydrogens I could not add them back. Is it expected behavior or should 
I create an issue on github?


print(' load mol ')
m = Chem.MolFromSmiles('c1c1O')
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' add Hs ')
m = Chem.AddHs(m)
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' remove H ')
em = Chem.EditableMol(m)
em.RemoveAtom(7)
print(Chem.MolToSmiles(em.GetMol(), allHsExplicit=True))
print(' add Hs ')
mm = Chem.AddHs(em.GetMol())
print(Chem.MolToSmiles(mm, allHsExplicit=True))
print(' update property cache ')
mm.UpdatePropertyCache()
print(Chem.MolToSmiles(mm, allHsExplicit=True))

output:

 load mol 
[OH][c]1[cH][cH][cH][cH][cH]1
 add Hs 
[H][O][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]
 remove H 
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]
 add Hs 
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]
 update property cache 
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]

Pavel.




___
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] add hydrogen after its removal

2019-03-22 Thread Pavel

Thank you, Paolo!

That was not obvious for me how RDKit manage hydrogens in this case.

Pavel.

On 22/03/2019 12:15, Paolo Tosco wrote:


Hi Pavel,

After you have first called AddHs(), all hydrogens in your molecule 
are now in the molecule graph as real atoms, and there are no more 
implicit/explicit Hs .


Therefore, when you call RemoveAtom(), you are removing a real atom 
from the molecule graph, and the implicit/explicit H count stays 0 for 
the parent heavy atom. Hence calling again AddHs() does not add any 
hydrogens.


If you wish the hydrogen to come back when you call AddHs(), you need 
to increase the explicit H count on the parent heavy atom:


print(' load mol ')
m = Chem.MolFromSmiles('c1c1O')
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' add Hs ')
m = Chem.AddHs(m)
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' remove H ')
nbrs = m.GetAtomWithIdx(7).GetNeighbors()
if (len(nbrs) == 1 and nbrs[0].GetAtomicNum() > 1):
    nbrs[0].SetNumExplicitHs(nbrs[0].GetNumExplicitHs() + 1)
em = Chem.EditableMol(m)
em.RemoveAtom(7)
print(Chem.MolToSmiles(em.GetMol(), allHsExplicit=True))
print(' add Hs ')
mm = Chem.AddHs(em.GetMol())
print(Chem.MolToSmiles(mm, allHsExplicit=True))

 load mol 
[OH][c]1[cH][cH][cH][cH][cH]1
 add Hs 
[H][O][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]
 remove H 
[H][O][c]1[cH][c]([H])[c]([H])[c]([H])[c]1[H]
 add Hs 
[H][O][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]

HTH, cheers,
p.

On 03/22/19 10:20, Pavel wrote:


Hello,

  I encountered with an issue which I cannot understand and solve. 
This might be a bug or a feature. After removal of some specific 
hydrogens I could not add them back. Is it expected behavior or 
should I create an issue on github?


print(' load mol ')
m = Chem.MolFromSmiles('c1c1O')
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' add Hs ')
m = Chem.AddHs(m)
print(Chem.MolToSmiles(m, allHsExplicit=True))
print(' remove H ')
em = Chem.EditableMol(m)
em.RemoveAtom(7)
print(Chem.MolToSmiles(em.GetMol(), allHsExplicit=True))
print(' add Hs ')
mm = Chem.AddHs(em.GetMol())
print(Chem.MolToSmiles(mm, allHsExplicit=True))
print(' update property cache ')
mm.UpdatePropertyCache()
print(Chem.MolToSmiles(mm, allHsExplicit=True))

output:

 load mol 
[OH][c]1[cH][cH][cH][cH][cH]1
 add Hs 
[H][O][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]
 remove H 
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]
 add Hs 
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]
 update property cache 
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]

Pavel.




___
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] Drawing quality image with PandasTools.FrameToGridImage

2019-03-22 Thread Bakary N'tji Diallo
It is possible to draw high-quality image for a set of compounds.
I am trying to use the panda tool using the FrameToGridImage function.

rdkit.Chem.PandasTools.FrameToGridImage(frame, column=’ROMol’,
legendsCol=None, **kwargs)

But using it with the “useSVG=True” keyword is throwing an error.

rdkit.Chem.PandasTools.FrameToGridImage(frame, column=’ROMol’,
legendsCol=None,useSVG=True)

-- 

Bakary N’tji DIALLO

PhD Student (Bioinformatics) , Research
Unit in Bioinformatics (RUBi) 

Mail: diallobaka...@gmail.com |  Skype: diallobakary4

Tel:  +27798233845 | +223 74 56 57 22 | +223 97 39 77 14
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Installation issue in make step

2019-03-22 Thread Sergio Martinez Cuesta
Dear all,

I am getting the following error when trying to install RDKit in x86_64
GNU/Linux:

cd ~/RDKit
wget https://github.com/rdkit/rdkit/archive/Release_2018_09_2.tar.gz
tar xvf Release_2018_09_2.tar.gz
cd rdkit-Release_2018_09_2
export RDBASE=~/RDKit/rdkit-Release_2018_09_2
export LD_LIBRARY_PATH=$RDBASE/lib
export PYTHONPATH=$RDBASE
cd $RDBASE
mkdir build
cd build
cmake -D BOOST_ROOT=~/boost/boost_1_69_0 -D Boost_USE_STATIC_LIBS=OFF ..
make

# [ 58%] Linking CXX executable testReaction
# ../../../lib/libRDKitChemReactions.so.1.2018.09.2: undefined reference to
`boost::archive::text_iarchive_impl::load_override(boost::archive::class_name_type&)'
# ../../../lib/libRDKitChemReactions.so.1.2018.09.2: undefined reference to
`boost::archive::archive_exception::archive_exception(boost::archive::archive_exception
const&)'
# collect2: error: ld returned 1 exit status
# make[2]: *** [Code/GraphMol/ChemReactions/testReaction] Error 1
# make[1]: ***
[Code/GraphMol/ChemReactions/CMakeFiles/testReaction.dir/all] Error 2
# make: *** [all] Error 2

If you have clue of what might be going on or how to fix it, that would be
very helpful.

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


[Rdkit-discuss] chemfp preprint

2019-03-22 Thread Andrew Dalke
Hi RDKit users,

  This week I submitted a paper about chemfp for publication. I also submitted 
a preprint on ChemRxiv, which was just accepted.

For those interested, it's at 
https://chemrxiv.org/articles/The_Chemfp_Project/7877846 .

It's a rather long paper as it covers many aspects about the chemfp project, 
including the FPS and FPB formats, search algorithms, details about the 
different ways to compute a popcount, and memory bandwidth and latency 
bottlenecks. On a non-technical level I also describe some of the difficulties 
I ran into trying to run chemfp as "commercial free software."

Let me know of any corrections or improvements, or any other feedback you might 
have.

Cheers,

Andrew
da...@dalkescientific.com




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


Re: [Rdkit-discuss] chemfp preprint

2019-03-22 Thread Markus Sitzmann
Yes, we all love ref 57.

-
|  Markus Sitzmann
|  markus.sitzm...@gmail.com

> On 22. Mar 2019, at 20:39, Andrew Dalke  wrote:
> 
> Hi RDKit users,
> 
>  This week I submitted a paper about chemfp for publication. I also submitted 
> a preprint on ChemRxiv, which was just accepted.
> 
> For those interested, it's at 
> https://chemrxiv.org/articles/The_Chemfp_Project/7877846 .
> 
> It's a rather long paper as it covers many aspects about the chemfp project, 
> including the FPS and FPB formats, search algorithms, details about the 
> different ways to compute a popcount, and memory bandwidth and latency 
> bottlenecks. On a non-technical level I also describe some of the 
> difficulties I ran into trying to run chemfp as "commercial free software."
> 
> Let me know of any corrections or improvements, or any other feedback you 
> might have.
> 
> Cheers,
> 
>Andrew
>da...@dalkescientific.com
> 
> 
> 
> 
> ___
> 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