Re: [Rdkit-discuss] RDKit-based implementation of QED (quantitative estimation of drug-likeness)

2012-03-31 Thread Taka Seri
Dier Hans.
That's nice work.
I tried to install the module.
But there was no __init__.py file in silicos_it folder.
So, import was failed.
Do you have any idea?
Thanks.

2012年3月30日23:27 Hans De Winter h...@silicos-it.com:

 Hi -

 A RDKit-based implementation of the QED measure as described by Richard
 Bickerton (Nature Chemistry, 2012, 4, 90-98) has been implemented and made
 available  for download from our website ( www.silicos-it.com  Biscu-it).

 Regards,
 - Hans





 www.silicos-it.com

 A division of Imacosi bvba
 De Roskam 35,
 2970 Schilde
 Belgium



 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Logo Email.png--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] pharmacophore align

2012-07-19 Thread Taka Seri
Dear all.
I have some questions about Pharmacophore.
I want to align molecules that from SDF files,  by Pharmacophore.
At first, I set Pharmacophore by using EmbedPharmacophore() method.
And checked molecules by EmbedPharmacophore() method.
Then,  generated 3D structures by EmbedPharmacophore() method.
Finally, I want to align these conformers to the Pharmacophore.
Could anyone give me a small example?
Thanks.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] pharmacophore align

2012-07-21 Thread Taka Seri
Dear Greg, and rdkit-discuss members.
Thank you for your advice.
That code is very useful for me !

And I have one question.
Can I get selected pharmacophore feature positions from AtomIds?
Or how can I get selected pharmacophore features from AtomIds?
From feature object, it is easy to do that by useing feature.GetPos() method.
I want to do same thing by using AtomIds.

Sincerely.
Taka

2012/7/20 Greg Landrum greg.land...@gmail.com:
 Dear Taka,

 On Thu, Jul 19, 2012 at 9:44 AM, Taka Seri serit...@gmail.com wrote:
 Dear all.
 I have some questions about Pharmacophore.
 I want to align molecules that from SDF files,  by Pharmacophore.
 At first, I set Pharmacophore by using EmbedPharmacophore() method.
 And checked molecules by EmbedPharmacophore() method.
 Then,  generated 3D structures by EmbedPharmacophore() method.
 Finally, I want to align these conformers to the Pharmacophore.
 Could anyone give me a small example?

 There is unfortunately no really good sample code available for this.
 There is some very old code from a GUI application that was built with
 the RDKit but that is no longer supported (or part of the current SVN
 app) here:
 http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Python/qtGui/Search3D/SearchUtils.py?revision=2view=markuppathrev=5
 in the function AlignMatchToReference()


 Here's an attempt to distill that information down:

 First you need the alignment package:

 from rdkit.Numerics  import rdAlignment

 which contains the function GetAlignmentTransform:

 In [5]: rdAlignment.GetAlignmentTransform?
 Type:   function
 Base Class: type 'builtin_function_or_method'
 String Form:Boost.Python.function object at 0x102fe0dc0
 Namespace:  Interactive
 Docstring:
 GetAlignmentTransform( (object)refPoints, (object)probePoints [,
 (object)weights=[] [, (bool)reflect=False [, (int)maxIterations=50]]])
 - object :
 Compute the optimal alignment (minimum RMSD) between two set of points


  ARGUMENTS:

 - refPoints : reference points sepcified as a N by 3 Numeric array or
   sequence of 3-sequences or sequence of Point3Ds
 - probePoints : probe points to align to reference points - same 
 format
   restrictions as reference points apply here
 - weights : optional numeric vector or list of weights to
 associate to each pair of points
 - reflect : reflect the probe points before attempting alignment
 - maxIteration : maximum number of iterations to try to minimize RMSD

  RETURNS:

 a 2-tuple:
   - SSD value for the alignment
   - the 4x4 transform matrix, as a Numeric array


 This will give the transformation required to align one set of points
 (the ph4 points from your embedded molecule) to another set of points
 (the ph4 points from your reference ph4).

 To do this you need the positions of each of the features:
 probePts = [list(x.GetPos()) for x in probeFeats]
 refPts = [list(x.GetPos()) for x in refFeats]

 And then you align them:
 ssd,tform = Aligner.GetAlignmentTransform(refArr,probeArr,weights=weights)

 If your molecule has no chiral centers, it's a good idea to try
 reflecting the alignment:
 ssd2,tform2 = 
 Aligner.GetAlignmentTransform(refArr,probeArr,weights=weights,reflect=True)
 if ssd2ssd:
 tform = tform2
 ssd = ssd2


 the two return values are the sum of squared deviations of the atomic
 positions (easily convertible to the RMSD) and the transformation
 matrix. You can apply the transformation matrix to your embedded probe
 molecule (to align it to the ph4) with the function
 AllChem.TransformMol:
 AllChem.TransformMol(probeMol,tform)

 I hope this helps.

 -greg

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] pharmacophore align

2012-07-23 Thread Taka Seri
Dear Greg and rdkit-discuss members.

Thank you for your kindness.
Your messages are very helpful for me.
Thanks.

Taka


2012/7/22 Greg Landrum greg.land...@gmail.com:
 Dear Taka,

 On Sun, Jul 22, 2012 at 12:20 AM, Taka Seri serit...@gmail.com wrote:

 And I have one question.
 Can I get selected pharmacophore feature positions from AtomIds?
 Or how can I get selected pharmacophore features from AtomIds?
 From feature object, it is easy to do that by useing feature.GetPos() 
 method.
 I want to do same thing by using AtomIds.

 There's not really a direct way to find the features that an atom is
 involved in, but you can find the atoms that make up a feature using
 the method MolChemicalFeature.GetAtomIds(). Given that you can do the
 following:
 def GetFeatsPerAtom(feats):
 Returns a dictionary keyed by atom id, with lists of features as
the values

   
   res = {}
   for feat in feats:
 for atomId in feat.GetAtomIds():
   if res.has_key(atomId):
 res[atomId].append(feat)
   else:
 res[atomId] = [feat]
   return res
 (this code, which could really be improved using a python defaultdict,
 is taken from: 
 http://rdkit.svn.sourceforge.net/viewvc/rdkit/trunk/Python/qtGui/Search3D/SearchUtils.py?revision=2view=markuppathrev=2
 )

 To get the position of the Atoms themselves, you need to use the
 owning molecule's Conformer. something like this:
 In [6]: conf = atom.GetOwningMol().GetConformer()

 In [7]: conf.GetAtomPosition(atom.GetIdx())
 Out[7]: rdkit.Geometry.rdGeometry.Point3D at 0x1045ebe20

 I hope this helps,
 -greg


 -greg

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] About PCA

2013-01-17 Thread Taka Seri
Dear All.

I want to do PCA with molecular fingerprint .
So, I wrote following code.
But, this code did not work .
Does anyone have a suggestion?
Thanks.

Takayuki


  1 from rdkit import Chem
  2 from rdkit.Chem import AllChem
  3 from rdkit.ML.Data import Stats
  4 import numpy
  5 import sys
  6
  7
  8 mols = [mol for mol in Chem.SDMolSupplier(sys.argv[1])]
  9 fps = [AllChem.GetMorganFingerprintAsBitVect(mol,2) for mol in mols]
 10
 11 mat = []
 12 for fp in fps:
 13 bits = fp.ToBitString()
 14 bitsvec = [int(bit) for bit in bits]
 15 mat.append(bitsvec)
 16
 17 mat=numpy.array(mat)
 18 res = Stats.PrincpalComponents(mat)
 19 print res[1]
--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] About PCA

2013-01-18 Thread Taka Seri
Dear Greg and Niko.

Thank you for your quick repry.
To Greg, thanks for your recommendation.
I tried PCA with matplotlib and it worked with no problem. Thanks.
But Matplotlib returned view that was different from R.

 To Niko.
I using RDKit, version RDKit_2012_06_1.
And, when I tried PCA with the code, no response was returned.

KeyboardInterrupt, following message was returned.

Traceback (most recent call last):
  File mol_pca.py, line 33, in module
res=Stats.PrincipalComponents(matrix)
  File C:\RDKit_2012_06_1\rdkit\ML\Data\Stats.py, line 82, in
PrincipalComponents
covMat = FormCorrelationMatrix(mat)
  File C:\RDKit_2012_06_1\rdkit\ML\Data\Stats.py, line 66, in
FormCorrelationMatrix
sumY = sum(y)

So,  what version of RDKit are you using?
And if you don't care, could you show me some results ?

Thanks.
 Takayuki

2013/1/18 Nikolas Fechner m...@fechner.cc

  Hi Takayuki,
 I was able to run your code snippet without any errors (with different
 example molecules of course). Could possible explain in more detail what is
 not working for you? What version of RDKit are you using (from rdkit import
 rdBase;print rdBase.rdkitVersion) ?

 Niko

 On Jan 17, 2013, at 11:08 AM, Taka Seri serit...@gmail.com wrote:

 Dear All.

 I want to do PCA with molecular fingerprint .
 So, I wrote following code.
 But, this code did not work .
 Does anyone have a suggestion?
 Thanks.

 Takayuki


  1 from rdkit import Chem
  2 from rdkit.Chem import AllChem
  3 from rdkit.ML.Data import Stats
  4 import numpy
  5 import sys
  6
  7
  8 mols = [mol for mol in Chem.SDMolSupplier(sys.argv[1])]
  9 fps = [AllChem.GetMorganFingerprintAsBitVect(mol,2) for mol in mols]
 10
 11 mat = []
 12 for fp in fps:
 13 bits = fp.ToBitString()
 14 bitsvec = [int(bit) for bit in bits]
 15 mat.append(bitsvec)
 16
 17 mat=numpy.array(mat)
 18 res = Stats.PrincpalComponents(mat)
 19 print res[1]


 --
 Master Visual Studio, SharePoint, SQL, ASP.NET http://asp.net/, C#
 2012, HTML5, CSS,
 MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
 with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
 MVPs and experts. ON SALE this month only -- learn more at:

 http://p.sf.net/sfu/learnmore_122712___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss




 --
 Master Visual Studio, SharePoint, SQL, ASP.NET http://asp.net/, C#
 2012, HTML5, CSS,
 MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
 with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
 MVPs and experts. ON SALE this month only -- learn more at:
 http://p.sf.net/sfu/learnmore_122712
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


--
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] About Building The Cartrige

2013-01-25 Thread Taka Seri
Dear Greg.
Thank you for your quick reply.
Your advice is helpful for me.
I tried rebuilding the .o files, then all tests were passed !
I'm very grateful to you.

takayuki


2013/1/26 Greg Landrum greg.land...@gmail.com

 Dear Takayuki,

 On Sat, Jan 26, 2013 at 5:37 AM, Taka Seri serit...@gmail.com wrote:
  Dear all.
 
  I tried to build the postgresql cartridge.
  (=http://code.google.com/p/rdkit/wiki/BuildingTheCartridge)
  Os X 10.7.5, RDKit ver 2012_12_1, and PostgreSQL ver 9.1.3
  I could not build the cartridge.
  I got following error messages.
 
  cd $RDBASE/Code/PgSQL/rdkit
  Then,
  make
 
  g++ -I/opt/local/include -02 -Wall -Wmissing-prototypes -Wpointer-arith
  -Wdeclaration-after-statement -Wendif-labels -Wformat-security
  -fno-strict-aliasing -fwrapv  -bundle -multiply_defined suppress -o
 rdkit.so
  rdkit_io.o mol_op.o bfp_op.o sfp_op.o rdkit_gist.o low_gist.o guc.o
 cache.o
  adapter.o -L/usr/local/pgsql/lib -Wl,-dead_strip_dylibs
  -L/Users/takayuki/Cheminfo/RDKit/RDKit_2012_12_1//lib
  -Wl,-rpath,'/Users/takayuki/Cheminfo/RDKit/RDKit_2012_12_1//lib'
  -lChemTransforms -lFileParsers -lSmilesParse -lFingerprints -lSubgraphs
  -lSubstructMatch  -lDescriptors -lPartialCharges -lGraphMol -lDataStructs
  -lRDGeometryLib -lRDGeneral  -pthread -bundle_loader
  /usr/local/pgsql/bin/postgres
  Undefined symbols for architecture x86_64:
_DirectFunctionCall1, referenced from:
_bfp_in in rdkit_io.o
_bfp_out in rdkit_io.o
_sfp_in in rdkit_io.o
_sfp_out in rdkit_io.o
  ld: symbol(s) not found for architecture x86_64
  collect2: ld returned 1 exit status
  make: *** [rdkit.so] Error 1
 
  Any advice or information you could provide would be greatly appreciated.

 I haven't seen this error before, but from what little I could find on
 the web  (http://code.google.com/p/plv8js/issues/detail?id=40), it
 seems like this could be caused by using headers from one version of
 postgres and linking against another.
 I would suggest rebuilding the .o files and checking to see that the
 -I specs you see when you re-run make actually find the correct
 postgresql header files.

 -greg

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] New module for RDKit - PANDAS integration

2013-04-21 Thread Taka Seri
Dear Greg.

Thank you your quick reply !
The modified version was worked without AvalonTools .
That's nice tool .
I appreciate your kindness.

Takayuki

2013/4/22 Greg Landrum greg.land...@gmail.com

 Dear Takayuki,

 On Sun, Apr 21, 2013 at 1:30 PM, Taka Seri serit...@gmail.com wrote:
 
  I'm interested in this work
  I want to use PandasTools.
  But I got error message, ImportError: cannot import name pyAvalonTools.

 I just checked in a modified version that will work when the avalon
 tools are not installed.

 If you want to install the avalon tools anyway, there's information
 below that shows how:

 
  So, I tried to rebuild RDKit like this.
  $ cmake -D RDK_BUID_AVALON_SUPPORT=ON
  But build was failed.
 
  -- Configuring done
  CMake Error at Code/cmake/Modules/RDKitUtils.cmake:35 (add_library):
Cannot find source file:
 
  /common/layout.c
 
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm
 .hpp
.hxx .in .txx
  Call Stack (most recent call first):
External/AvalonTools/CMakeLists.txt:43 (rdkit_library)
 
  If anyone who has suggestion, please help me.

 You need to tell it where to find the source for the avalon tools.

 - Download the source from here:

 http://sourceforge.net/projects/avalontoolkit/files/AvalonToolkit_1.1_beta/AvalonToolkit_1.1_beta.source.tar/download

 - Create an avalon tools directory somewhere, for example in
 /usr/local/src/avalontools.
 - Extract the tar file in that directory.
 - Run cmake as follows:
 cmake -DAVALONTOOLS_DIR=/usr/local/src/avalontools/SourceDistribution
 -DRDK_BUILD_AVALON_SUPPORT=ON

 Best,
 -greg

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Get Bond order

2013-06-08 Thread Taka Seri
Dear All .

I want to know how to get bond order of molecules.

GetBondType method can get bond-type SINGLE, DOUBLE, TRIPLE , but
can't get bond order.

Are there any idea to solve it ?

Thanks.

Takayuki
--
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Get Bond order

2013-06-10 Thread Taka Seri
Dear Greg.
Thank you for your advice.
I think your idea is nice!
Thank you for your time and consideration.

Takayuki





2013/6/9 Greg Landrum greg.land...@gmail.com

 Dear Takayuki,

 On Sat, Jun 8, 2013 at 10:05 AM, Taka Seri serit...@gmail.com wrote:


 I want to know how to get bond order of molecules.

 GetBondType method can get bond-type SINGLE, DOUBLE, TRIPLE , but
 can't get bond order.

 Are there any idea to solve it ?


 Unfortunately, from python it's not that easy at the moment. There is a
 C++ function getBondTypeAsDouble() but it's not usable from python in
 current releases. I will add it for the next release. In the meantime, you
 would need to use something like:

 In [3]: bos={Chem.BondType.SINGLE:1.0,
...: Chem.BondType.DOUBLE:2.0,
...: Chem.BondType.TRIPLE:3.0,
...: Chem.BondType.AROMATIC:1.5,
...: Chem.BondType.UNSPECIFIED:0.0}

 In [4]: m = Chem.MolFromSmiles('Cc1c1')

 In [5]: bos[m.GetBondWithIdx(0).GetBondType()]
 Out[5]: 1.0

 In [6]: bos[m.GetBondWithIdx(1).GetBondType()]
 Out[6]: 1.5

 Hope this helps,
 -greg

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Install RDKit2014.09.02 from homebrew

2014-12-17 Thread Taka Seri
Dear All.
I tried to update rdkit using homebrew.
But update was failed, and I got following error.

= Installing rdkit from rdkit/homebrew-rdkit

== Downloading
https://github.com/rdkit/rdkit/archive/Release_2014_09_2.tar.gz


100.0%

Error: SHA1 mismatch

Expected: 776da8545fca4376a24670bc14cae9aee568745a

Actual: b9c34dea8a53737d76fb670998f9610889c317e3

Archive: /Library/Caches/Homebrew/rdkit-2014.09.2.tar.gz

To retry an incomplete download, remove the file above.


Please give me your advice if you have any ideas.

Regards.

Takayuki.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] aromatic ring that contain sulfur atom

2015-03-01 Thread Taka Seri
Dear Greg.
Thank you for your quick and kindful reply.
I'm interested in morph approach.
http://www.ncbi.nlm.nih.gov/pubmed/20481489
I want to test this approach in rdkit.
Based on your adivice, I wrote sample script get atoms in aromatic rings
that degree  3.
And the script works.
Thank you!
Takayuki.
-code snippet---
from rdkit import Chem
import copy

def replace_atom( mol ):
res = []
# get atoms , degree 3
aro_idxs = [ atom.GetIdx() for atom in mol.GetAromaticAtoms() if
atom.GetDegree()  3 ]
# replace aromatic atoms to carbon, nitrogen, oxygen, sulfur
for atm_num in [6, 7, 8, 16]:
for idx in aro_idxs:
cp_mol = copy.deepcopy( mol )
cp_mol.GetAtomWithIdx(idx).SetAtomicNum( atm_num )
try:
Chem.SanitizeMol(cp_mol)
res.append( cp_mol )
except:
pass
return res

def recursive_replace(mols, res = [],  check = set([])):
for mol in mols:
replaced_mols = replace_atom( mol )
res.extend(replaced_mols)
for mol in res:
check.add( Chem.MolToSmiles( mol ) )
if len(res) = len(check):
recursive_replace( res, res=res, check=check )
else:
return [ Chem.MolFromSmiles(mol) for mol in check ]


On Sun, Mar 1, 2015 at 3:16 PM Greg Landrum greg.land...@gmail.com wrote:

 Hi Takayuki,

 When doing this, you have to be careful how you change the valence of the
 atom. The sanitization step is going to attempt to Kekulize the aromatic
 ring (i.e. convert all the aromatic bonds to either single or double) and
 this isn't possible for all atom patterns.

 When you change atom 2 to a nitrogen, you end up creating a three
 coordinate aromatic nitrogen. During kekulization, both aromatic bonds to
 this atom must be converted to single bonds; this leads to a pattern that
 does not allow the rest of the ring to be kekulized.

 There's a similar problem when you replace a two-coordinate carbon with a
 sulfur.

 Replacing the three-coordinate carbon with a sulfur, on the other hand, is
 different: the RDKit allows the three coordinate sulfur to have an
 additional double bond added. The result ring is ok, but it's not aromatic:

 In [13]: mol = Chem.MolFromSmiles('COc1c1')
 In [14]: mol.GetAtomWithIdx(2).SetAtomicNum( 16 )
 In [15]: Chem.SanitizeMol(mol)
 Out[15]: rdkit.Chem.rdmolops.SanitizeFlags.SANITIZE_NONE
 In [16]: print Chem.MolToSmiles(mol,True)
 COS1=CC=CC=C1

 Does that make sense?

 -greg


 On Sat, Feb 28, 2015 at 3:11 PM, Taka Seri serit...@gmail.com wrote:

 Dear rdkitter.
 I have a question about aromatic rings.
 So, I want to change atoms in aromatic ring.
 For example code is following.
 Convert aromatic carbon to nitrogen.
 mol = Chem.MolFromSmiles('COc1c1')
 mol.GetAtomWithIdx(3).SetAtomicNum( 7 )
 Chem.SanitizeMol(mol)
 Work Fine.

 mol.GetAtomWithIdx(2).SetAtomicNum( 7 )
 Chem.SanitizeMol(mol)
 ValueError.

 mol = Chem.MolFromSmiles('COc1c1')
 mol.GetAtomWithIdx(2).SetAtomicNum( 7 )
 Chem.SanitizeMol(mol)
 ValueError.

 Next, I tried to convert aromatic carbon to sulfur.
 mol = Chem.MolFromSmiles('COc1c1')
 mol.GetAtomWithIdx(3).SetAtomicNum( 16 )
 Chem.SanitizeMol(mol)
 ValueError. OK

 mol = Chem.MolFromSmiles('COc1c1')
 mol.GetAtomWithIdx(2).SetAtomicNum( 16 )
 Chem.SanitizeMol(mol)
 This case, work fine. ???
 Why this case work ?
 Any advice or information you could provide would be greatly appreciated.
 Thanks.
 Takayuki

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] about MACCSkeys

2015-07-31 Thread Taka Seri
Dear all,
I have a question about MACCSkeys.
I checked number of keys using MACCSkeys.smartsPatts, the result was 166.
But when I calculated MACCSkeys-fingerprint, the length of fingerprint was
167bit.
Why the bit length is not 166 bit ?


In [1]: from rdkit import Chem
In [2]: from rdkit.Chem import MACCSkeys
In [3]: mol = Chem.MolFromSmiles(c1c1C)
In [4]: len( MACCSkeys.smartsPatts )
Out[4]: 166 #166 smarts keys in RDKit
In [5]: maccsfp = MACCSkeys.FingerprintMol(mol)
In [10]: maccsfp.GetNumBits()
Out[10]: 167 # ???why 167 bit? not 166 bit ?

Any advice or information anyone could provide would be greatly appreciated.
Best regards,
Takayuki
--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Clustering 1M molecules

2015-08-22 Thread Taka Seri
Dear Jing,

How about your trying using bayon ?
https://code.google.com/p/bayon/
It's not function of RDKit, but I think the library can cluster molecules
using ECFP4.

Unfortunately, input file format of bayon is not distance matrix but easy
to prepare the format.

Best regards.

Takayuki


2015年8月23日(日) 12:03 Jing Lu ajin...@gmail.com:

 Currently, I prefer fingerprint based clustering, because it's hard to set
 the cutoff for scaffold based clustering. Does RDKit have scaffold based
 clustering?

 On Sat, Aug 22, 2015 at 10:56 PM, abhik1...@gmail.com wrote:

 Hi, how about scaffold based clustering . You extract the scaffolds and
 then cluster it and then put the respective scaffold compounds inside the
 cluster .

 Sent from my iPhone

  On Aug 22, 2015, at 8:43 PM, Jing Lu ajin...@gmail.com wrote:
 
  Dear RDKit users,
 
  If I want to cluster more than 1M molecules by ECFP4. How could I do
 it? If I calculate the distance between every pair of molecules, the size
 of distance matrix will be too big. Does RDKit support any heuristic
 clustering algorithm without calculating the distance matrix of the whole
 library?
 
 
 
  Thanks,
  Jing
 
 --
  ___
  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 mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] about MACCSkeys

2015-08-01 Thread Taka Seri
Dear Andrew,

Thank you for your quick reply.
I understood it.
It was helpful information for me!
Best regards,
Takayuki

2015年8月1日(土) 16:01 Andrew Dalke da...@dalkescientific.com:

 Dear Takayuki,

 On Aug 1, 2015, at 3:54 AM, Taka Seri wrote:
  Why the [MACCSkeys] bit length is not 166 bit ?
 

   The RDKit MACCS implementation follows the MACCS key assignments, which
 start at 1. MACCS bit 0 is always set to 0, bit 1 corresponds to key 1,
 etc., so key 166 is at bit 166, giving 167 bits in total.

 Best regards,
 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


Re: [Rdkit-discuss] Change font size in SVG image

2015-09-12 Thread Taka Seri
Dear Greg,
Thank you for your quick reply!
It's  nice work!
 I'm looking forward to next version of rdkit.
Best regards,
Takayuki.


2015年9月12日(土) 12:38 Greg Landrum <greg.land...@gmail.com>:

> Hi,
>
> This was something I had overlooked in the new drawing code, thanks for
> pointing it out.
>
> I just checked in a change to the MolDraw2D python wrapper that allows you
> get or set the current font size. Here's an example:
>
> drawer = rdMolDraw2D.MolDraw2DSVG(300,300)
> drawer.SetFontSize(0.25) # <- default is 0.5, so this makes the font half
> the normal size
> drawer.DrawMolecule(mol)
> drawer.FinishDrawing()
> svg = drawer.GetDrawingText()
>
>
> I hope this helps,
> -greg
>
>
> On Fri, Sep 11, 2015 at 11:20 PM, Taka Seri <serit...@gmail.com> wrote:
>
>> Dear all,
>> I want to change atom font size of the svg image.
>> Are there any way to change it?
>> Any advice you could provide would be appreciated.
>> Best regards,
>>
>> Takayuki
>>
>>
>> --
>>
>> ___
>> 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] Attribute Error about PandasTools

2016-06-01 Thread Taka Seri
Dier Niko,

Thank you for your quick reply.
I tried to use pandas 0.18.0 and I work fine. ;-)

Best regards,
Takayuki


2016年6月2日(木) 3:13 Nikolas Fechner <m...@fechner.cc>:

> Hi Takayuki,
> It seems that the respective piece of the pandas API got restructured for
> 0.18.1 and that the “format" module got moved from pandas.core to
> pandas.formats:
>
> Example change from the pandas github:
>
> -from pandas.core import format as fmt
> +from pandas.formats import format as fmt
>
> I can reproduce the error in pandas 0.18.1, but switching back to pandas
> 0.18.0 seems to fix the error, thus going back to pandas 0.18.0 is
> certainly the easiest option.
> However, I guess if the changed import path is the only problem with
> 0.18.1 this could probably easily be fixed in PandasTools directly.
>
> Kind regards,
> Niko
>
>
> On 01 Jun 2016, at 16:31, Taka Seri <serit...@gmail.com> wrote:
>
> > Dier RDKitters,
> >
> > I want to handle sdf as DataFrame.
> > But when I read molecule from SDF using PandasTools, I got following
> Error.
> >
> > from rdkit import Chem
> >
> >
> > from rdkit.Chem import PandasTools
> >
> > df = PandasTools.LoadSDF("testset.sdf")
> >
> > df
> >
> > 
> >
> > --> 131   formatter =
> pd.core.format.DataFrameFormatter(self,buf=None,columns=None,col_space=None,colSpace=None,header=True,index=True,
> >
> > 132
> na_rep='NaN',formatters=None,float_format=None,sparsify=None,index_names=True,
> >
> > 133justify = None,
> force_unicode=None,bold_rows=True,classes=None,escape=False)
> >
> > AttributeError: module 'pandas.core' has no attribute 'format'
> >
> > ...
> >
> > My environment is python3.5. And I installed rdkit using conda install
> command.
> >
> > Version of Pandas is 0.18.1
> >
> > I wonder if you could give me some advice.
> >
> > Thanks.
> >
> > Takayuki
> >
> >
> --
> > 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.
> https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___
> > Rdkit-discuss mailing list
> > Rdkit-discuss@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
--
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. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Attribute Error about PandasTools

2016-06-01 Thread Taka Seri
Dier RDKitters,

I want to handle sdf as DataFrame.
But when I read molecule from SDF using PandasTools, I got following Error.

from rdkit import Chem

from rdkit.Chem import PandasTools

df = PandasTools.LoadSDF("testset.sdf")

df



--> 131   formatter =
pd.core.format.DataFrameFormatter(self,buf=None,columns=None,col_space=None,colSpace=None,header=True,index=True,

132na_rep='NaN',
formatters=None,float_format=None,sparsify=None,index_names=True,

133justify = None,
force_unicode=None,bold_rows=True,classes=None,escape=False)

AttributeError: module 'pandas.core' has no attribute 'format'

...

My environment is python3.5. And I installed rdkit using conda install
command.

Version of Pandas is 0.18.1

I wonder if you could give me some advice.

Thanks.

Takayuki
--
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. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] highlight substructure with Draw.MolsToGridImage

2016-06-18 Thread Taka Seri
Dear Francesco,

I think you can highlight each molecules using highlightAtomLists option.
I wrote an example.
Following code was written in IPython notebook.

'''
from rdkit import Chem
from rdkit.Chem import rdBase
from rdkit.Chem import Draw
from rdkit.Chem.Draw import IPythonConsole
from rdkit import RDConfig
import os
sdf = Chem.SDMolSupplier(  os.path.join( RDConfig.RDDocsDir,
'Book/data/cdk2.sdf' ) )
mols = [  m for m in sdf ]
core = Chem.MolFromSmiles( 'c1ncc2nc[nH]c2n1' )
# highlightAtomLists is list of atom list that you want to highlight.
Draw.MolsToGridImage( mols, molsPerRow=3, highlightAtomLists=[
mol.GetSubstructMatch(core) for mol in mols] )
#The code will draw molecules with highlighted core structure.
'''

Kind regards,
Takayuki


2016年6月17日(金) 21:32 Francesco Del Carratore :

> Dear All,
> I just started using RDKit, and I am having some troubles using
> Draw.MolsToGridImage.
> I have a number of SMILES. My Aim is to plot them in the same file while
> highlighting a particular substructure (I have the SMILES for it as well).
> I managed to create the image with all the compounds with the following:
>
> for i in range(0,len(SMILES)-1):
> ms[i] = Chem.MolFromSmiles(SMILES[i], sanitize=False)
> ms[i].SetProp("_Name", compNAMES[i])
>
> from rdkit.Chem import Draw
> import image
> img=Draw.MolsToGridImage(ms,molsPerRow=4,subImgSize=(800,800),
> legends=[x.GetProp("_Name") for x in ms] )
> img.save('/home/image.png')
>
> I know for sure that the substructure (called MCS) is found in all the
> compounds.
> in fact ms[i].HasSubstructMatch(MCS) gives me True for any i
> How could I highlight the substructure in the image in each compound?
> is it possible?
> Thanks in advance for your help
> Best Wishes,
> Francesco
>
>
> --
> Francesco Del Carratore
>
> --
> 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/zohomanageengine
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
--
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/zohomanageengine___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Question about Run Reaction

2016-02-06 Thread Taka Seri
Hi Michal,

Thank you for your quick and kind response.
I tried to sanitize mol according to your advice.
And my code worked fine !
Thanks you. ;-)
By the way,  If I want to run several reaction steps. Do I need to sanitize
each molecules?


# reactiontest.py
from rdkit import Chem
from rdkit.Chem import AllChem

from rdkit import Chem
from rdkit.Chem import AllChem
mol = Chem.MolFromSmiles("c1c1")
rxn = AllChem.ReactionFromSmarts( "[cH&$(c(c)c):2]>>[c:2][F]" )
ps1= rxn.RunReactants( (mol,) )
ps1
mol2 = ps1[0][0]
Chem.SanitizeMol( mol2 )
ps2= rxn.RunReactants( (mol2,) )
uniq = set( [ Chem.MolToSmiles(x[0], isomericSmiles=True ) for x in ps2 ]  )
print( uniq )
---
from shell

$ python reactiontest.py

{'Fc1ccc(F)cc1', 'Fc1(F)c1', 'Fc1c1F'}

-
Best regards,
Takayuki

2016年2月6日(土) 23:01 Michal Krompiec <michal.kromp...@gmail.com>:

> Hi Taka,
> You have to call SanitizeMol() on the product(s) explicitely. The error is
> caused by the reactants not being 'sanitized'.
> Best wishes,
> Michal
>
>
> On Saturday, 6 February 2016, Taka Seri <serit...@gmail.com> wrote:
>
>> Dear RDKitters,
>>
>> I have question about rdkit reaction function.
>> I want to generate molecules using several reaction steps.
>> I referred rdkit blog post, and wrote following code.
>> But second step of reaction caused error.
>> I could not difference about mol and mol2 object.
>> I wonder if anyone could help me.
>> Best regards,
>>
>> Takayuki
>>
>>
>> In [1]: from rdkit import Chem
>>
>> In [2]: from rdkit.Chem import AllChem
>>
>> In [3]: mol = Chem.MolFromSmiles("c1ccc(F)cc1")
>>
>> In [6]: rxn = AllChem.ReactionFromSmarts('[cH&$(c(c)c):2]>>[c:2][F]')
>>
>> #first step works fine.
>>
>> In [7]: ps = rxn.RunReactants((mol,))
>>
>> #Bud second step did not work...
>>
>> In [9]: mol2 = ps[0][0]
>>
>> In [11]: ps = rxn.RunReactants((mol2,))
>>
>> [22:23:10]
>>
>>
>> 
>>
>> Pre-condition Violation
>>
>> getNumImplicitHs() called without preceding call to calcImplicitValence()
>>
>> Violation occurred on line 166 in file
>> /Users/landrgr1/anaconda3/anaconda/conda-bld/work/Code/GraphMol/Atom.cpp
>>
>> Failed Expression: d_implicitValence>-1
>>
>> 
>>
>>
>>
>> ---
>>
>> RuntimeError  Traceback (most recent call
>> last)
>>
>>  in ()
>>
>> > 1 ps = rxn.RunReactants((mol2,))
>>
>>
>> RuntimeError: Pre-condition Violation
>>
>>
>>
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Question about Run Reaction

2016-02-06 Thread Taka Seri
Dear RDKitters,

I have question about rdkit reaction function.
I want to generate molecules using several reaction steps.
I referred rdkit blog post, and wrote following code.
But second step of reaction caused error.
I could not difference about mol and mol2 object.
I wonder if anyone could help me.
Best regards,

Takayuki


In [1]: from rdkit import Chem

In [2]: from rdkit.Chem import AllChem

In [3]: mol = Chem.MolFromSmiles("c1ccc(F)cc1")

In [6]: rxn = AllChem.ReactionFromSmarts('[cH&$(c(c)c):2]>>[c:2][F]')

#first step works fine.

In [7]: ps = rxn.RunReactants((mol,))

#Bud second step did not work...

In [9]: mol2 = ps[0][0]

In [11]: ps = rxn.RunReactants((mol2,))

[22:23:10]




Pre-condition Violation

getNumImplicitHs() called without preceding call to calcImplicitValence()

Violation occurred on line 166 in file
/Users/landrgr1/anaconda3/anaconda/conda-bld/work/Code/GraphMol/Atom.cpp

Failed Expression: d_implicitValence>-1




---

RuntimeError  Traceback (most recent call last)

 in ()

> 1 ps = rxn.RunReactants((mol2,))


RuntimeError: Pre-condition Violation
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Question about CreateDifferenceFingerprintForReaction

2016-07-25 Thread Taka Seri
Dear rdkitters,
I want to analyse and build prediction model about reaction or matched
molecular pair ( molecular transformations ).

I found new function named CreateDifferenceFingerprintForReaction. So, I
tried to use the function to do it. But I confused following result.

I defined three reactions that transform C to N.
I expected that tanimoto similarity would be same but Tanimoto similarity
of the reactions were quite different. I confused these result.
My code is following
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit import rdBase
from rdkit.Chem import rdChemReactions
from rdkit.Chem import DataStructs

rdBase.rdkitVersion =>'2016.03.1'

rxn1 = AllChem.ReactionFromSmarts( '[C:1]C1C1>>[N:1]C1C1' )

rxn2 = AllChem.ReactionFromSmarts( '[C:1]C1CCCNC1>>[N:1]C1CCCNC1' )

rxn3 = AllChem.ReactionFromSmarts( '[C:1]c1c1>>[N:1]c1c1' )

rxfp1 = rdChemReactions.CreateDifferenceFingerprintForReaction(rxn1)

rxfp2 = rdChemReactions.CreateDifferenceFingerprintForReaction(rxn2)

rxfp3 = rdChemReactions.CreateDifferenceFingerprintForReaction(rxn3)

tc12 = DataStructs.TanimotoSimilarity(rxfp1, rxfp2)

tc13 = DataStructs.TanimotoSimilarity(rxfp1, rxfp3)

tc23 = DataStructs.TanimotoSimilarity(rxfp2, rxfp3)

print( tc12,tc13, tc23 )

# I got following score. Why 2nd and 3rd similarity was zero?

0.7142857142857143 0.0 0.0

Any advice and suggestions will be greatly appreciated
Best regards,
Takayuki
--
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


Re: [Rdkit-discuss] Question about CreateDifferenceFingerprintForReaction

2016-07-30 Thread Taka Seri
Dear Nadine,

Thank you for your reply with the code examples.
I understood the reason of low similarity in my code. Your mail is very
informative for me.

Best regards,
Takayuki

2016年7月27日(水) 3:34 Nadine Schneider <nadine.schneider@gmail.com>:

> Hi Takayuki
>
> The reason why this happens is that the
> CreateDifferenceFingerprintForReaction function takes the whole structure
> of the molecules of a reactions into account. This means it generates
> AtomPair FPs with a path length up to 30 bonds for the reactants and
> products and then builds the difference of those. Therefore you get this
> low similarity. If you would like to capture the transformation only you
> should better use a more local version of the FPs, like an AP FP with a
> path length up to 3 bonds or a Morgan FP with radius of 1. Unfortunately
> this isn’t possible with the function above but please find an example
> below that allows doing this.
> I hope that helps.
>
> Best,
> Nadine
>
>
>
> from rdkit import Chem
> from rdkit.Chem import AllChem
> from rdkit import DataStructs
> import copy
>
>
> def _createFP(mol,maxSize,fpType='AP'):
> mol.UpdatePropertyCache(False)
> if fpType == 'AP':
> return AllChem.GetAtomPairFingerprint(mol, minLength=1,
> maxLength=maxSize)
> else:
> Chem.GetSSSR(mol)
> rinfo = mol.GetRingInfo()
> return AllChem.GetMorganFingerprint(mol, radius=maxSize)
>
> def getSumFps(fps):
> summedFP = copy.deepcopy(fps[0])
> for fp in fps[1:]:
> summedFP += fp
> return summedFP
>
> def buildReactionFP(rxn, maxSize=3, fpType='AP'):
> reactants = rxn.GetReactants()
> products = rxn.GetProducts()
> rFP = getSumFps([_createFP(mol,maxSize,fpType=fpType) for mol in
> reactants])
> pFP = getSumFps([_createFP(mol,maxSize,fpType=fpType) for mol in
> products])
> return pFP-rFP
>
> # Your examples
>
> rxn1 = AllChem.ReactionFromSmarts( '[C:1]C1C1>>[N:1]C1C1' )
> rxn2 = AllChem.ReactionFromSmarts( '[C:1]C1CCCNC1>>[N:1]C1CCCNC1' )
> rxn3 = AllChem.ReactionFromSmarts( '[C:1]c1c1>>[N:1]c1c1' )
>
> rxfp1 = buildReactionFP(rxn1,maxSize=3)
> rxfp2 = buildReactionFP(rxn2,maxSize=3)
> rxfp3 = buildReactionFP(rxn3,maxSize=3)
>
>
> tc12 = DataStructs.TanimotoSimilarity(rxfp1, rxfp2)
> tc13 = DataStructs.TanimotoSimilarity(rxfp1, rxfp3)
> tc23 = DataStructs.TanimotoSimilarity(rxfp2, rxfp3)
>
> print(tc12,tc13,tc23)
>
> >> (0., 0.0, 0.0)
>
> # Try a smaller path length
>
> rxfp1 = buildReactionFP(rxn1,maxSize=2)
> rxfp2 = buildReactionFP(rxn2,maxSize=2)
> rxfp3 = buildReactionFP(rxn3,maxSize=2)
>
>
> tc12 = DataStructs.TanimotoSimilarity(rxfp1, rxfp2)
> tc13 = DataStructs.TanimotoSimilarity(rxfp1, rxfp3)
> tc23 = DataStructs.TanimotoSimilarity(rxfp2, rxfp3)
>
> print(tc12,tc13,tc23)
>
> >> (1.0, 0.0, 0.0)
>
> # Finally use Morgan with radius 1
>
> rxfp1 = buildReactionFP(rxn1,maxSize=1,fpType='Morgan')
> rxfp2 = buildReactionFP(rxn2,maxSize=1,fpType='Morgan')
> rxfp3 = buildReactionFP(rxn3,maxSize=1,fpType='Morgan')
>
>
> tc12 = DataStructs.TanimotoSimilarity(rxfp1, rxfp2)
> tc13 = DataStructs.TanimotoSimilarity(rxfp1, rxfp3)
> tc23 = DataStructs.TanimotoSimilarity(rxfp2, rxfp3)
>
> print(tc12,tc13,tc23)
>
> >> (1.0, 0.2, 0.2)
>
>
>
> 2016-07-25 15:44 GMT+02:00 Taka Seri <serit...@gmail.com>:
>
>> Dear rdkitters,
>> I want to analyse and build prediction model about reaction or matched
>> molecular pair ( molecular transformations ).
>>
>> I found new function named CreateDifferenceFingerprintForReaction. So, I
>> tried to use the function to do it. But I confused following result.
>>
>> I defined three reactions that transform C to N.
>> I expected that tanimoto similarity would be same but Tanimoto similarity
>> of the reactions were quite different. I confused these result.
>> My code is following
>> from rdkit import Chem
>> from rdkit.Chem import AllChem
>> from rdkit import rdBase
>> from rdkit.Chem import rdChemReactions
>> from rdkit.Chem import DataStructs
>>
>> rdBase.rdkitVersion =>'2016.03.1'
>>
>> rxn1 = AllChem.ReactionFromSmarts( '[C:1]C1C1>>[N:1]C1C1' )
>>
>> rxn2 = AllChem.ReactionFromSmarts( '[C:1]C1CCCNC1>>[N:1]C1CCCNC1' )
>>
>> rxn3 = AllChem.ReactionFromSmarts( '[C:1]c1c1>>[N:1]c1c1' )
>>
>> rxfp1 = rdChemReactions.CreateDifferenceFingerprintForReaction(rxn1)
>>
&g

Re: [Rdkit-discuss] RDKIT 2018.3 and MMPDB problem

2018-05-07 Thread Taka Seri
Dear Andrew,

I installed following version of mmpdb with new version of rdkit.
And it worked fine!
I appreciate your work.
Kind regards,

Takayuki

On Apr 27, 2018, at 00:20, Andrew Dalke  wrote:
> Please try out:
>  http://dalkescientific.com/mmpdb-2.1b1.tar.gz
>
> or my fork at:
>  https://github.com/adalke/mmpdb
>
> and let me know of any problems.

Has anyone downloaded and tested this code? I would like to push it to the main
repository and start the process of doing a new release.

Cheers,
--
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 can I count the substructures with RDKit?

2018-08-04 Thread Taka Seri
Dear Shojiro,

To count the number of on bits, you can use GetNumOnBits.
http://www.rdkit.org/Python_Docs/rdkit.DataStructs.cDataStructs.ExplicitBitVect-class.html#GetNumOnBits

from rdkit import Chem

from rdkit.Chem import AllChem

mol = Chem.MolFromSmiles('O1ccnccc1')

maccsfp = AllChem.GetMACCSKeysFingerprint(mol)

print(macsfp.GetNumOnBits())

# output is 16


Kind regards,

Takayuki

2018年8月4日(土) 17:14 Shojiro Shibayama :

> Hi, community members,
>
> I'm looking for a way to count all fragments that I give for some
> quantitative analysis. I want the count data based on e.g. MACCS key's
> fragments instead of MACCS key 0/1 descriptor itself. Could anyone please
> help me with this? Thanks in advance.
>
> Sincerely,
> Shojiro
>
> --
> 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


Re: [Rdkit-discuss] Ipc descriptor values too large for float32

2019-04-05 Thread Taka Seri
Hi Christoph,

I think same topic was discussed in github issue.
You can use Use avg=True option to avoid the problem.
I hope the URL would be help for you.
https://github.com/rdkit/rdkit/issues/1527

 Best regards,
Taka

2019年4月5日(金) 18:37 Christoph Hillisch :

> Hello all,
>
> I use RDKit to calculate descriptors, which I use to train a random forest
> model in scikit-learn.
> Since I do not scale my training data, I run into the problem that the
> descriptor Ipc may contain huge figures (1E+50), which then are too large
> for the data type float32 used in sklearn.
>
> Is there a way of making sure the value of this descriptor fits in
> float32, without scaling my data?
> Otherwise I’d probably have to remove this descriptor from my model.
>
> Best regards,
> Christoph
>
> ___
> 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] Drawing quality image with PandasTools.FrameToGridImage

2019-03-28 Thread Taka Seri
Hi Diallo,

I could reproduce it. It seems MolsToGridimage method throws error when the
function get pandas Series and useSVG=True.
I can get svg image when I converted the series to list. Like the below.

df is Data frame which has rdkit mol object.

from IPython.display import SVG
im=Draw.MolsToGridImage(df.ROMol.tolist(), useSVG=True)
SVG(im)

I hope this would help you.
Best,

Taka

2019年3月23日(土) 0:02 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 mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] rotate a conformer around an axis?

2019-02-26 Thread Taka Seri
Hi Mchal,

TransformConformer can rotate molecule with given rotation matrix I think.

I rotate mol by using the method.
Following code rotates molecule around x, y, z axis.
https://nbviewer.jupyter.org/github/iwatobipen/playground/blob/master/rotation_mol.ipynb

Unfortunately molecule will not render on github but you can view molecule
if you run the code on your PC.
I hope this would be some of help.

Best regards,
Taka


2019年2月26日(火) 17:55 Michal Krompiec :

> Hello,
> I'd like to check if a particular axis is a C2 symmetry axis of a
> conformer. How do I rotate my conformer around an axis? (apart from
> extracting the coordinates into numpy, multiplying by a rotation matrix and
> updating the coordinates)
> Can TransformConformer function be used for this?
> Thanks,
> Michal
>
> ___
> 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] conda install rdkit

2019-02-07 Thread Taka Seri
Dear Paul,

Current version of rdkit is provided for python3.6 and 2.7 from anaconda
"rdkit" and "conda-forge" channel.
https://anaconda.org/rdkit/rdkit/files?version=2018.09.1.0
https://anaconda.org/conda-forge/rdkit/files?version=2018.09.1
i recommend you to make python3.6 environment for using newest version of
rdkit if you don't have a specific reason to use python3.5.

Kind regards,

Taka

2019年2月7日(木) 20:06 Czodrowski, Paul :

> Dear RDKitters,
>
>
>
> in my python3.5 conda environment on macOS, I’m running rdkit version
> 2018.03.3.0. I would like to update it to 2018.09, but simply “conda update
> rdkit” or “conda update -c rdkit rdkit” does not help.
>
>
>
> Any help/comment would be highly appreciated.
>
>
>
>
>
> Cheers,
>
> Paul
>
>
>
> *Wichtiger Hinweis: Die Information in dieser E-Mail ist vertraulich. Sie
> ist ausschließlich für den Adressaten bestimmt. Sollten Sie nicht der für
> diese E-Mail bestimmte Adressat sein, unterrichten Sie bitte den Absender
> und vernichten Sie diese Mail. Vielen Dank. Unbeschadet der Korrespondenz
> per E-Mail, sind unsere Erklärungen ausschließlich final rechtsverbindlich,
> wenn sie in herkömmlicher Schriftform (mit eigenhändiger Unterschrift) oder
> durch Übermittlung eines solchen Schriftstücks per Telefax erfolgen.
> Important note: The information included in this e-mail is confidential. It
> is solely intended for the recipient. If you are not the intended recipient
> of this e-mail please contact the sender and delete this message. Thank
> you. Without prejudice of e-mail correspondence, our statements are only
> legally binding when they are made in the conventional written form (with
> personal signature) or when such documents are sent by fax. *
> ___
> 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] Try to reproduce a code working in January

2019-11-20 Thread Taka Seri
Hi Guillaume,

I confirmed the issue.
RemoveHs does not work to invalid molecule.
So I updated my code example and uploaded gist.
Could you please check new version of my code?
https://gist.github.com/iwatobipen/77269b8a10eafe0e0cba8de5c1cae6ec

Any comments or suggestions will be appreciated.

Thanks,
Taka

2019年11月20日(水) 14:46 Guillaume GODIN :

> Dear community,
>
>
>
> I try to reproduce this code
>
>
>
>
> https://iwatobipen.wordpress.com/2019/01/18/generate-possible-molecules-from-a-dataset-chemoinformatics-rdkit/
>
>
>
> but got an error un panda / rdkit during generation:
>
>
>
> frame = frame[["ROMol", "Smiles", "Core", "R1", "R2", "R3"]]
>
> frame['Core']=frame['Core'].apply(Chem.RemoveHs)
>
> frame.head(2)
>
>
>
>
>
>
>
> RDKit ERROR: [05:02:02]
>
> RDKit ERROR:
>
> RDKit ERROR: 
>
> RDKit ERROR: Pre-condition Violation
>
> RDKit ERROR: getExplicitValence() called without call to
> calcExplicitValence()
>
> RDKit ERROR: Violation occurred on line 161 in file
> /opt/conda/conda-bld/rdkit_1561471048963/work/Code/GraphMol/Atom.cpp
>
> RDKit ERROR: Failed Expression: d_explicitValence > -1
>
> RDKit ERROR: 
>
> RDKit ERROR:
>
> RDKit ERROR: [05:05:04] Explicit valence for atom # 6 N, 5, is greater
> than permitted
>
>
>
> ---
>
> ValueErrorTraceback (most recent call
> last)
>
>  in 
>
> *  1* frame = frame[["ROMol", "Smiles", "Core", "R1", "R2", "R3"]]
>
> > 2 frame['Core']=frame['Core'].apply(Chem.RemoveHs)
>
> *  3* frame.head(2)
>
>
>
> ~/miniconda/envs/py37/lib/python3.7/site-packages/pandas/core/series.py
> in apply(self, func, convert_dtype, args, **kwds)
>
> *   3589* else:
>
> *   3590* values = self.astype(object).values
>
> -> 3591 mapped = lib.map_infer(values, f, convert=
> convert_dtype)
>
> *   3592*
>
> *   3593* if len(mapped) and isinstance(mapped[0], Series):
>
>
>
> pandas/_libs/lib.pyx in pandas._libs.lib.map_infer()
>
>
>
> ValueError: Sanitization error: Explicit valence for atom # 6 N, 5, is
> greater than permitted
>
>
>
>
>
>
>
> Any idea why ?
>
>
>
> BR
>
>
>
> Guillaume
>
>
>
>
>
> ***
> DISCLAIMER
> This email and any files transmitted with it, including replies and
> forwarded copies (which may contain alterations) subsequently transmitted
> from Firmenich, are confidential and solely for the use of the intended
> recipient. The contents do not represent the opinion of Firmenich except to
> the extent that it relates to their official business.
>
> ***
> ___
> 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] calculating molecular properties on a Pandas dataframe Molecule

2019-10-31 Thread Taka Seri
Hi,

Pandas apply function will work too.

AddMoleculeColumnToFrame(DF, "Smiles") at first.

Default setting, rdkit mol object will be added "ROMol" column in your
dataframe.

https://www.rdkit.org/docs/source/rdkit.Chem.PandasTools.html


Then call apply function to apply a calculation function an axis of ROMol.

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.apply.html

 DF['HAC'] = DF["ROMol"].apply(Chem.Lipinski.HeavyAtomCount)

Best regards,

Taka
2019年10月31日(木) 18:30 Jan Halborg Jensen :

> Hi Mike
>
> This should work
>
> DF[‘HAC’] = [Chem.Lipinski.HeavyAtomCount(mol) for mol in DF[‘Molecule’]]
>
> Best regards, Jan
>
>
> On 31 Oct 2019, at 10.16, Mike Mazanetz 
> wrote:
>
> Hi RDKit Gurus,
>
> I’ve followed the docs and created a molecule column in my Pandas
> dataframe.
> However, I do not seem to be able to do molecular operations on the column.
>
> For example, if you had a SMILES column, how would you calculate heavy
> atom count and append this result to a new column?
>
> This doesn’t work:
> DF[‘HAC’] = Chem.Lipinski.HeavyAtomCount(DF[‘Molecule’])
>
> Where the Molecule column is generated by
> PandasTools.AddMoleculeColumnToFrame
>
> Thanks,
> mike
>
> ___
> 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 mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Drawing the sum of reactive molecules

2020-02-07 Thread Taka Seri
Hi Pablo,

How about call ReactionFromSmarts with useSmiles = True?
With the option, RDKit can render the reaction from smiles instead of
smarts.
https://www.rdkit.org/docs/source/rdkit.Chem.rdChemReactions.html

Kind regards,
Taka

2020年2月7日(金) 23:00 Pablo Ramos :

> Dear all,
>
>
>
> I am trying to draw a nice picture with the sum of two molecules that
> react giving some product. Let´s assume the next SMARTS, in which ammonia
> and formaldehyde react (Hydrogen atoms are omitted):
>
> Reaction = C=O.N>>NC=O.[H][H]
>
>
>
> I know that rdkit contains the rdkit.Chem.rdChemReactions module. This
> allows me to display the reaction picture by providing the above SMARTS
> according to AllChem.ReactionFromSmarts(Reaction).
>
>
>
> However, I just want to display the left part from the reaction (Ammonia +
> Formaldehyde), without the arrow and the products. I am especially
> interested in this module because the molecular structures look quite
> beautiful and I have the  ‘+’ symbol in the picture.
>
>
>
> There is another issue regarding this. I would like to express the bonds
> with straight lines instead of dotted ones (that come up by default)
>
>
>
> Thank you!
>
>
>
> Best regards,
>
>
>
> *Pablo Ramos*
>
> Ph.D. at Covestro Deutschland AG
>
>
>
>
>
> covestro.com 
>
> *Telephone*
>
> +49 214 6009 7356
>
>
>
> Covestro Deutschland AG
>
> COVDEAG-Chief Commer-PUR-R
>
> B103, R164
>
> 51365 Leverkusen, Germany
>
> *pablo.ra...@covestro.com *
>
>
>
> The processing of personal data is necessary to communicate and provide
> our services. Read more here:  privacy-information
> 
> .
> Please manually add the sentence in your language* here*. Please make
> sure that this link is not lost when the sentence is transferred (Copy à
> Paste à “Merge Formatting”).
>
>
>
>
> ___
> 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] How to protect atoms in specified location

2020-02-22 Thread Taka Seri
Dear Shaozhen,

RDKit can render molecule with atom index,
So you can check the indexes and identify which atoms should be protected.
An example to visualize molecule with atom index is below.
https://gist.github.com/iwatobipen/7001d81080756fea46968d1966c36f59

I hope it helps you.
Thanks,

Taka

2020年2月22日(土) 20:36 丁邵珍 <164362...@qq.com>:

> Dear developers:
> As shown bellow, compd_A could be converted to compd_B within serveral
> reaction transformations.
> Atoms in red circle(compd_A) are identify as activated atoms, and the
> other atoms should be protected when precessing transformations. Is there
> some way I could identify the atom index in  red circle(compd_A)? And then,
> I can exclude them, and use the code like:
> Compd_A.GetAtomWithIdx(index).SetProp('_protected','1') to protect the
> other atoms before transforming.
>
> SMILES: (1)compd_a:NC1=C2C=CC(=CC2=NC=C1);(2)compd_b:
> CCN(CC)(C)NC1=C2C=CC(=CC2=NC=C1)Cl
>
> Best wishes,
> Shaozhen
>
> ___
> 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] The RDKit and GSoC 2020

2020-03-16 Thread Taka Seri
Dear Steve, Greg and All,

Recently I moved from clab to Binder to make cloud env with python.
However I'll try to make my code more compact and share it.
 Thanks for following my blog post. ;) https://iwatobipen.wordpress.com/

Best regards,

Taka (tiwtter account / iwatobipen)

2020年3月16日(月) 16:03 Greg Landrum :

> Thanks Steve,
>
> That's really helpful. Given that we're unlikely to end up with a decent
> pip-installable RDkit, I guess the snippet approach would be the best way
> to go. I will try to make some time for this (or convince iwatobipen to do
> it) in the reasonably near future.
>
> Best,
> -greg
>
> On Sun, Mar 15, 2020 at 5:58 PM Steven Kearnes  wrote:
>
>> re: rdkit+colab
>>
>> In talking with folks outside of Google about rdkit+colab, I haven't been
>> able to establish that it's worth the trouble of making rdkit a default
>> dependency. It seems that a rather compact incantation
>> 
>> does the job fairly well. This could be compressed even further, or even
>> turned into a colab snippet  for
>> easier use.
>>
>> Also, since colab doesn't play well with conda (as far as pre-installed
>> deps are concerned), we would at least need a pip-installable rdkit to
>> consider making this work.
>>
>> Thanks,
>> Steve
>>
>> On Mon, Mar 9, 2020 at 4:43 PM JW Feng  wrote:
>>
>>> Are you sure depictions in GSheet wouldn't be a good GSoC project?  I
>>> will ask around to find volunteers to connect with you on GSheets and
>>> Colab.
>>>
>>> On Fri, Mar 6, 2020 at 8:14 PM Greg Landrum 
>>> wrote:
>>>
 Hi JW,

 I don't think it's a great GSoC project for a couple of reasons, but
 I'd love to have RDKit integration in Google Sheets and am willing to do
 some work to make that happen. I can poke around a bit to see about how we
 could use the new RDKit-JS wrappers, but having access to someone with
 experience writing Sheets add-ins would help. If you know someone
 internally meeting that description, please put them in touch with me.

 I think making the code easily available in Colab can only be done by
 someone inside google. I'm happy to help however I can with that if you (or
 anyone else) can identify the right person.

 Best,
 -greg

 On Sat, Mar 7, 2020 at 2:22 AM JW Feng  wrote:

> Project suggestion:
>
> Project 1:
> Implement 2D structure depiction in Google Spreadsheets.  My
> colleagues at Google think this is very doable.  Being able to depict
> structures in Google Spreadsheets will dramatically increase collaboration
> between scientists.  Imaging being able to provide comments for a
> structure, design idea, or virtual screening hit in a live Google
> Spreadsheet.  While there are commercial (Vortex, Spotfire, MarvinView,
> Stardrop ...) and open source (Datawarrior) packages that can read CSV
> files containing smiles and depict structures, none comes close to GSheets
> for collaboration and ease of use.
>
>- Cells in columns named SMILES, or have SMILES as a substring in
>the header, will be depicted in 2D using RDKit
>- Cells with depicted structures move with other columns when
>sorting, filtering, etc.
>- Optional: depictions update when SMILES string is edited
>- Bonus: calculate properties using formulas.  Ex: 
> Descriptors.MolWt(A1)
>calculates MW of SMILES in A1
>
> Project 2:
>
>- Make it easy to use RDKit in Google Colab
>
>
>- No need to install RDKit, from rdkit import Chem just works out
>of the box
>
> Best,
>
> JW
> On Sun, Feb 23, 2020 at 11:48 PM Greg Landrum 
> wrote:
>
>> Dear all,
>>
>> I'm happy to share that the RDKit will once again be part of Google
>> Summer of Code in 2020. This is a program where Google funds students to
>> work on open-source projects for a couple of months over the summer. 
>> We've
>> participated in each of the last three years and had some cool stuff come
>> out of it.
>>
>> We're looking for a few more project ideas (along with possible
>> mentors!) as well as students.
>> Applications start in the middle of March. There's more info about
>> timelines here:
>> https://developers.google.com/open-source/gsoc/timeline
>>
>> The current set of project ideas is here and we could use a few more:
>> http://wiki.openchemistry.org/GSoC_Ideas_2020#RDKit_Project_Ideas
>> I'm going to try and come up with something, but if you have
>> something to add, please let me know.
>>
>> Best,
>> -greg
>>
>>
>>
>>
>> ___
>> Rdkit-discuss mailing list

Re: [Rdkit-discuss] Restraining torsions whilst generating conformers

2020-04-25 Thread Taka Seri
Dear Bruce,

How about to use the defined core which has your desired torsions?
Here are examples to generate restricted conformers with user defined cores.
https://www.discngine.com/blog/2019/6/6/tethered-minimization-of-small-molecules-with-rdkit-towards-tethered-docking-on-proteins-with-rdock
http://rdkit.blogspot.com/2019/01/more-on-constrained-embedding.html
Thanks,

Taka



2020年4月26日(日) 1:11 Bruce Milne :

> Hi,
>
> Is it possible to add torsional restraints whilst
> using AllChem.EmbedMultipleConfs() to generate conformers? I did look at
> this some time back but ended up moving on to another project and never
> found out if it could be done. I asked a similar thing in this group at the
> time (about avoiding the generation of cis-peptide bonds) but I don't think
> it got an answer.
>
> I suspect that it may not be possible with AllChem.EmbedMultipleConfs()
> but if anyone knows of an alternative for generating partially constrained
> structures it would be good to know.
>
> Cheers,
> Bruce
>
> --
> Prof. Dr. Bruce F. Milne
> CFisUC
> Department of Physics
> University of Coimbra
> Rua Larga
> 3004 - 516 Coimbra
> Portugal
>
> https://orcid.org/-0002-5522-4808
> https://publons.com/researcher/2905148/bruce-milne/
> https://www.linkedin.com/in/brucemilne
>
> A/h = S/k
> ___
> 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] Restraining torsions whilst generating conformers

2020-04-26 Thread Taka Seri
Hi Bruce,

Thanks for your reply.
I searched rdkit documents and found that RDKit has some constraint method.
https://www.rdkit.org/docs/source/rdkit.ForceField.rdForceField.html
And I tried to use UFFAddTorsionConstraint for an example.
https://gist.github.com/iwatobipen/42c325f2471166ff4084051381d0ef78
By using these method I think you can keep the torsions.
Thanks.

Taka

2020年4月26日(日) 19:35 Bruce Milne :

> Hi Taka,
>
> Thanks for the suggestion. The ConstrainedEmbed method is certainly useful
> but I need to only freeze some selected torsions and allow the rest of the
> macrocycle to remain flexible. If this was only a single part of the
> macrocycle the ConstrainedEmbed method would work but I need to
> simultaneously restrain several parts of the ring that are connected by
> flexible regions.
>
> Cheers,
> Bruce
>
> On Sun, 26 Apr 2020 at 02:00, Taka Seri  wrote:
>
>> Dear Bruce,
>>
>> How about to use the defined core which has your desired torsions?
>> Here are examples to generate restricted conformers with user defined
>> cores.
>>
>> https://www.discngine.com/blog/2019/6/6/tethered-minimization-of-small-molecules-with-rdkit-towards-tethered-docking-on-proteins-with-rdock
>> http://rdkit.blogspot.com/2019/01/more-on-constrained-embedding.html
>> Thanks,
>>
>> Taka
>>
>>
>>
>> 2020年4月26日(日) 1:11 Bruce Milne :
>>
>>> Hi,
>>>
>>> Is it possible to add torsional restraints whilst
>>> using AllChem.EmbedMultipleConfs() to generate conformers? I did look at
>>> this some time back but ended up moving on to another project and never
>>> found out if it could be done. I asked a similar thing in this group at the
>>> time (about avoiding the generation of cis-peptide bonds) but I don't think
>>> it got an answer.
>>>
>>> I suspect that it may not be possible with AllChem.EmbedMultipleConfs()
>>> but if anyone knows of an alternative for generating partially constrained
>>> structures it would be good to know.
>>>
>>> Cheers,
>>> Bruce
>>>
>>> --
>>> Prof. Dr. Bruce F. Milne
>>> CFisUC
>>> Department of Physics
>>> University of Coimbra
>>> Rua Larga
>>> 3004 - 516 Coimbra
>>> Portugal
>>>
>>> https://orcid.org/-0002-5522-4808
>>> https://publons.com/researcher/2905148/bruce-milne/
>>> https://www.linkedin.com/in/brucemilne
>>>
>>> A/h = S/k
>>> ___
>>> Rdkit-discuss mailing list
>>> Rdkit-discuss@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>
>>
>
> --
> Prof. Dr. Bruce F. Milne
> CFisUC
> Department of Physics
> University of Coimbra
> Rua Larga
> 3004 - 516 Coimbra
> Portugal
>
> https://orcid.org/-0002-5522-4808
> https://publons.com/researcher/2905148/bruce-milne/
> https://www.linkedin.com/in/brucemilne
>
> A/h = S/k
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] conda install rdkit

2020-10-11 Thread Taka Seri
Hi Ling,

How about trying to use conda update command?
$ conda activate my-rdkit-env
$ conda update rdkit

Thanks,

Taka

2020年10月11日(日) 7:48 Ling Chan :

> Dear colleagues,
>
> I am trying to install RDKit using conda. According to the manual at
> https://www.rdkit.org/docs/Install.html#how-to-install-rdkit-with-conda
>
> it is very simple. I just need to do
>
> conda create -c rdkit -n my-rdkit-env rdkit
>
> It used to work. Somehow when I try this again, things are not working. When 
> I investigated, it turns out that somehow the 2018.03.2.0 version of rdkit 
> was installed instead of the most current one. It seems to me that I have 
> screwed up my conda setup. Just wonder what have I screwed up? How can I 
> repair it?
>
> One hint could be found at the message when I did conda create. The line for 
> rdkit looks different from the other lines, as indicated below. Unfortunately 
> I still could not figure it out.
>
> Thank you for your insight.
>
> Ling
>
>
> =
>
> > conda create -c rdkit -n tempenv rdkit
>
> The following NEW packages will be INSTALLED:
>
>   _libgcc_mutex  pkgs/main/linux-64::_libgcc_mutex-0.1-main
>   blas   pkgs/main/linux-64::blas-1.0-mkl
>   bzip2  pkgs/main/linux-64::bzip2-1.0.8-h7b6447c_0
> 
>  python pkgs/main/linux-64::python-3.6.12-hcff3b4d_2
>   python-dateutilpkgs/main/noarch::python-dateutil-2.8.1-py_0
>   pytz   pkgs/main/noarch::pytz-2020.1-py_0
>   rdkit  rdkit/linux-64::rdkit-2018.03.2.0-py36h6bb024c_1
>   readline   pkgs/main/linux-64::readline-8.0-h7b6447c_0
>   setuptools pkgs/main/linux-64::setuptools-50.3.0-py36hb0f4dca_1
>   sixpkgs/main/noarch::six-1.15.0-py_0
>  
>
>
> ___
> 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] Num .Of Benzene rings and Substitents

2020-08-09 Thread Taka Seri
Dear Raghu,

Hello,

How about using GetSubstructMatches method to get query structures?
Here is an example to detect phenyl rings and count matches.
https://gist.github.com/iwatobipen/7e922c761a0326493a5115fb615badf5
And also I think IFG code in Contrib seems useful for you.

Kind regards,

Taka


2020年8月9日(日) 21:17 Raghuram Srinivas :

>  Hello
> i am working on some cross domain applications of my original NLP based
> models and new to this domain.
> I was wondering if there are any utility functions to calculate  the
> number of benzene rings (–Ph) and (ii) the total number of small group
> substituents from the RDKIT library from a given SMILES string.
>
> Thanks
> Raghu Srinivas
>
> ___
> 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] Get conformers as independent mols?

2021-01-08 Thread Taka Seri
Dear Gustavo,

As Omar described, you can get each conformer with confId.
Here is an example for rendering multiple confromers with py3Dmol.
https://gist.github.com/iwatobipen/1fbf30ed6c21a4016ec4885c7fd614ed

I hope this will help you.

Thanks,

Taka

2021年1月8日(金) 8:48 Omar H94 :

> Dear  Gustavo,
>
> The show_rdkit function has a "conf_id" keyword argument that takes the id
> of the conformer to display. You may see the documentation:
> http://nglviewer.org/nglview/latest/api.html#nglview.show_rdkit
>
> To get a conformer of a mol as an independent mol, you may use the
> following function which takes a mol and a conformer id then returns a new
> mol that has only the specified conformer:
>
> def ConfToMol(mol, conf_id):
> conf = mol.GetConformer(conf_id)
> new_mol = Chem.Mol(mol)
> new_mol.RemoveAllConformers()
> new_mol.AddConformer(Chem.Conformer(conf))
> return new_mol
>
> I hope this works for you.
> Best regards,
> Omar
>
>
>
> On Fri, Jan 8, 2021 at 1:58 AM Gustavo Seabra 
> wrote:
>
>> Hi all,
>>
>> Could anyone please help me with ideas on how to visualize
>> molecule conformers inside a Jupyter notebook?
>>
>> I generate the conformers, for example, using:
>> AllChem.EmbedMultipleConfs(mol, numConfs=5)
>>
>> And would like to see them in 3D inside the notebook.
>>
>> I tried using NGLView(https://github.com/nglviewer/nglview), but it
>> only shows what I believe is the first conformer in the molecule. How can I
>> change the conformer shown? or maybe is there a way to convert the
>> conformers to Mol objects?
>>
>> Any idea would be greatly appreciated.
>>
>> Thank you!
>> --
>> Gustavo Seabra.
>> ___
>> 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 mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Pandas to Excel

2024-02-22 Thread Taka Seri
Hi Chris,

I think you can do it with SaveXlsxFromFrame.
http://rdkit.org/docs/source/rdkit.Chem.PandasTools.html#SaveXlsxFromFrame

rdkit.Chem.PandasTools.SaveXlsxFromFrame(*frame*, *outFile*,
*molCol='ROMol'*, *size=(300, 300)*, *formats=None*)¶


Saves pandas DataFrame as a xlsx file with embedded images. molCol can be
either a single column label or a list of column labels. It maps numpy data
types to excel cell types: int, float -> number datetime -> datetime object
-> string (limited to 32k character - xlsx limitations)

The formats parameter can be optionally set to a dict of XlsxWriter formats
(https://xlsxwriter.readthedocs.io/format.html#format), e.g.: {

‘write_string’: {‘text_wrap’: True}

} Currently supported keys for the formats dict are: ‘write_string’,
‘write_number’, ‘write_datetime’.

Cells with compound images are a bit larger than images due to excel.
Column width weirdness explained (from xlsxwriter docs): The width
corresponds to the column width value that is specified in Excel. It is
approximately equal to the length of a string in the default font of
Calibri 11. Unfortunately, there is no way to specify “AutoFit” for a
column in the Excel file format. This feature is only available at runtime
from within Excel.

Thanks,
Taka

2024年2月22日(木) 19:19 Chris Swain via Rdkit-discuss <
rdkit-discuss@lists.sourceforge.net>:

> Hi,
>
> Is it possible to export from a Pandas data frame to Excel, inserting the
> structures as images in the excel sheet?
>
> Cheers
>
> Chris
>
> ___
> 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