Re: [Rdkit-discuss] Merge two fragments at connection point

2016-03-10 Thread Steven Combs
Thanks!

I ended up doing this:

1) convert Rosetta restypes to RDKit ROMols
2) use combineMols(), to get a merged ROMol
3) static cast to RWMol and add bond between connecting atoms
4) Convert back to Rosetta
5) Use Rosetta transformations on the atoms that needed to be moved (I
didnt find the Transform methods in RDKit in time!)

Steven Combs


On Thu, Mar 10, 2016 at 12:23 AM, Greg Landrum <greg.land...@gmail.com>
wrote:

> Hi Steven,
>
> On Mon, Mar 7, 2016 at 5:03 PM, Steven Combs <steven.com...@gmail.com>
> wrote:
>
>>
>> I am developer for Rosetta <https://www.rosettacommons.org/>. Recently
>> we have incorporated RDKit into our software suite for testing. In
>> particular, my project is to include drug design elements into the game
>> Foldit <http://fold.it/portal/>. I have been using a separate
>> chemioinformatics tool for this process, but recently have decided to
>> switch to RDKit because it is so much easier to cross-compile the library
>> than the other chemioinformatics suite.
>>
>
> Welcome to the community, and thanks for letting us know what you're doing
> with the RDKit! It's great to hear that the toolkit is starting to be used
> within Rosetta.
>
>
>> I am using the C++ api for RDKit.
>>
>> My question is pretty simple. If I have two 3D fragments and want to
>> connect them at a specific atom, how would I go about doing this? I know
>> there are two functions that I can use in ChemTransforms.h,
>> replaceSubstructs and combineMols. I want to keep the 3D conformation of
>> mol1, but transform and combine mol2 to mol1 at a specific atom (ie replace
>> a hydrogen on the atom in mol1 and create a bond between the parent atom's
>> hydrogen to a specific atom on mol2).
>>
>> Is replaceSubstructs the way to go? I am not exactly sure how to set up
>> the query for this.
>>
>
> I feel like this question has come up before but I cannot, for the life of
> me, find the thread to point you to.
>
> I would start by transforming mol2 so that its atoms are in the positions
> you want them in when the molecules are combined. The convenient way to do
> this is with MolTransforms::transformMolsAtoms() and the approproriate
> RDGeom::Transform3D (
> http://rdkit.org/docs/cppapi/classRDGeom_1_1Transform3D.html#a5715778fa5c085ed42f47acd2649721c
> )
>
> Once mol2 is appropriately oriented, I'd convert it to an RWMol (if it's
> not one already) and remove the H on the atom that's going to bond to mol1.
> I'd convert mol1 into an RWMol (if it's not one already) and remove the H
> on the atom where I want to attach mol2.
> You can then call newMol = combineMols(mol1,mol2); and you've got a single
> molecule that has all atoms in it.
> The last step is to cast the result of combineMols() to an RWMol and add
> the bond between the molecules.
>
> I hope this helps, but please let me know if you need more details,
>
> -greg
>
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Merge two fragments at connection point

2016-03-07 Thread Steven Combs
Hi!

I am developer for Rosetta <https://www.rosettacommons.org/>. Recently we
have incorporated RDKit into our software suite for testing. In particular,
my project is to include drug design elements into the game Foldit
<http://fold.it/portal/>. I have been using a separate chemioinformatics
tool for this process, but recently have decided to switch to RDKit because
it is so much easier to cross-compile the library than the other
chemioinformatics suite.

I am using the C++ api for RDKit.

My question is pretty simple. If I have two 3D fragments and want to
connect them at a specific atom, how would I go about doing this? I know
there are two functions that I can use in ChemTransforms.h,
replaceSubstructs and combineMols. I want to keep the 3D conformation of
mol1, but transform and combine mol2 to mol1 at a specific atom (ie replace
a hydrogen on the atom in mol1 and create a bond between the parent atom's
hydrogen to a specific atom on mol2).

Is replaceSubstructs the way to go? I am not exactly sure how to set up the
query for this.

Steven Combs
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] mmFF minimization in context of two ligands/binding pocket

2016-04-01 Thread Steven Combs
Hi,

Is it possible to do a minimization in mmFF in context of two
small-molecules or a single small molecule and sidechains from a binding
pocket? From what I gather, I have two options:

1) Make a single RWMol object with the ligand and all residues from the
binding pocket, then run mmFF on the combine molecule. The steps would look
like this
   -use combineMols() for all residues
   -use mmFF on the complex

2) Use a hacked version of MCS from here:
http://rdkit.blogspot.com/2013/12/using-allchemconstrainedembed.html


Is there a better way of doing this? I am using the C++ api.

Steven Combs
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] sdf reading error between osx and windows

2016-04-27 Thread Steven Combs
and that fixed it. Thanks again Paolo!

Steven Combs

On Wed, Apr 27, 2016 at 12:28 PM, Steven Combs <steven.com...@gmail.com>
wrote:

> I will give that a try and let you know!
>
> On Wed, Apr 27, 2016 at 12:20 PM, Paolo Tosco <paolo.to...@unito.it>
> wrote:
>
>> Dear Steven,
>>
>> did you try to open the file in binary mode on the Windows build ans see
>> if it makes a difference? It does not make any difference on Linux and OS
>> X, but it will change how newlines are handled on Windows. I suspect that's
>> where the problem might be. Please get back to me, later I'll try and
>> reproduce the problem.
>>
>> Cheers,
>> p.
>>
>>
>> On 04/27/16 17:04, Steven Combs wrote:
>>
>> Hi!
>>
>> I am writing in c++ and loading an sdf file. This works perfectly for an
>> osx build, but when I try to load the same file with the windows build of
>> the program, I get errors and crashing (note: no errors in either the osx
>> or linux build). I have attached the sdf file as well.
>>
>> The errors I get are:
>> [11:57:17] ERROR: Cannot convert to int on line 24
>> [11:57:17] ERROR: moving to the begining of the next molecule
>> [11:57:17] ERROR: Cannot convert to int on line 51
>> [11:57:17] ERROR: moving to the begining of the next molecule
>> [11:57:17] ERROR: Cannot convert to int on line 71
>> [11:57:17] ERROR: moving to the begining of the next molecule
>> [11:57:17] ERROR: Cannot convert to int on line 100
>> [11:57:17] ERROR: moving to the begining of the next molecule
>> [11:57:17] ERROR: Cannot convert to int on line 138
>> [11:57:17] ERROR: moving to the begining of the next molecule
>> [11:57:17] ERROR: Cannot convert 1 8 to int on line 171
>> [11:57:17] ERROR: moving to the begining of the next molecule
>> [11:57:17] ERROR: Counts line too short: '' on line231
>> [11:57:17] ERROR: moving to the begining of the next molecule
>>
>>
>> Here is the relevant code snippet:
>>
>> void load_sdf( std::string const & filename, utility::vector1< 
>> ::RDKit::ROMolOP > & mol_vector, bool removeHs) {
>>  utility::io::izstream data( filename );
>>  if ( ! data.good() ) {
>>  TR.Error << "ERROR: Cannot open fragment file '" << filename << 
>> "'" << std::endl;
>>  utility_exit_with_message("Cannot open fragment file 
>> "+filename);
>>  }
>>  ::RDKit::SDMolSupplier supplier( (), /*takeOwnership=*/ false, 
>> /*sanitize=*/ true, removeHs); // Yes, pointer to std::istream - that's what 
>> RDKit wants
>>  while( ! supplier.atEnd() ) {
>>  ::RDKit::ROMolOP mol( supplier.next() );
>>  if( mol ) {
>>  mol_vector.push_back( mol );
>>  }
>>  }
>>
>> }
>>
>>  Regards,
>>
>> Steven Combs
>>
>>
>>
>> --
>> Find and fix application performance issues faster with Applications Manager
>> Applications Manager provides deep performance insights into multiple tiers 
>> of
>> your business applications. It resolves application problems quickly and
>> reduces your MTTR. Get your free 
>> trial!https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>>
>>
>>
>> ___
>> Rdkit-discuss mailing 
>> listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>>
>
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] sdf reading error between osx and windows

2016-04-27 Thread Steven Combs
Hi!

I am writing in c++ and loading an sdf file. This works perfectly for an
osx build, but when I try to load the same file with the windows build of
the program, I get errors and crashing (note: no errors in either the osx
or linux build). I have attached the sdf file as well.

The errors I get are:
[11:57:17] ERROR: Cannot convert to int on line 24
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert to int on line 51
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert to int on line 71
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert to int on line 100
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert to int on line 138
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert 1 8 to int on line 171
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Counts line too short: '' on line231
[11:57:17] ERROR: moving to the begining of the next molecule


Here is the relevant code snippet:

void load_sdf( std::string const & filename, utility::vector1<
::RDKit::ROMolOP > & mol_vector, bool removeHs) {
utility::io::izstream data( filename );
if ( ! data.good() ) {
TR.Error << "ERROR: Cannot open fragment file '" << filename << 
"'"
<< std::endl;
utility_exit_with_message("Cannot open fragment file 
"+filename);
}
::RDKit::SDMolSupplier supplier( (), /*takeOwnership=*/ false,
/*sanitize=*/ true, removeHs); // Yes, pointer to std::istream -
that's what RDKit wants
while( ! supplier.atEnd() ) {
::RDKit::ROMolOP mol( supplier.next() );
if( mol ) {
mol_vector.push_back( mol );
}
}

}


Regards,

Steven Combs


basic_fragments.sdf
Description: Binary data
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] MolFromPDBBlock and heterocycles

2016-09-07 Thread Steven Combs
Hello!

I have a pdb block that I am working with, which is attached to this email.
The ligand has aromatic ring structures in it; however, when it is read
into RDKit and converted into a smiles string, the aromatic rings are
converted into aliphatic rings. Any thoughts?

Here is the python code:

def extract_data( filename):
extracted_info = ""
with open(filename) as f:
for line in f.readlines():
if "HETATM" in line:
extracted_info += ( line)
return extracted_info

for index, filename in enumerate(solution_pdb_filenames):
row = extract_data( filename)
m = Chem.MolFromPDBBlock(row, sanitize=True, removeHs=False )
Chem.SetHybridization(m)
Chem.SetAromaticity(m)
Chem.SanitizeMol(m,
sanitizeOps=Chem.rdmolops.SanitizeFlags.SANITIZE_ALL) #not needed since
sanitizing during read in, but trying to figure out if it actually worked
print ("Parsing file " + str(index) + " of " +
str(len(solution_pdb_filenames)))
print (Chem.MolToSmiles(m, kekuleSmiles=True, allHsExplicit=True))

The output smile string is:

[H][O][CH]1[NH][CH]([C]([H])([H])[CH]([OH])[OH])[CH]([C]([H])([H])[C]([H])([H])[H])[CH]([CH]([OH])[CH]2[CH]([H])[CH]([H])[CH]([H])[CH]([N]([H])[H])[CH]2[H])[CH]1[N]([C]([H])([H])[H])[C]([H])([H])[H]

Steven Combs


test.pdb
Description: Protein Databank data
--
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] windows 32 shared library

2016-10-14 Thread Steven Combs
Has anyone compiled rdkit into a 32bit shared library dll?

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


[Rdkit-discuss] Reactions saved as ctfile RD format

2017-03-01 Thread Steven Combs
Hi,

Is there a way to save out reactions in the RD file format specified by the
CTFile format specifications or should I just write out my own format?

Steven Combs
--
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