I was wrong, the "F" option retains bonds' order and it even works for
aromatic atoms.
For future reference, to generate smiles of fragment by atom indices in
Python you can do:

> idxs = [1,2,3,4]
> mol.write('smi', opt={'F': ' '.join(map(str, idxs))}).strip()


----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
[email protected]

2017-06-19 17:19 GMT+02:00 Maciek Wójcikowski <[email protected]>:

> No worries :) I planned to do Chem.FindAtomEnvironmentOfRadiusN() and
> Chem.PathToSubMol() in RDKit, but the function you've suggested is also
> feasible.
>
> @Geoff - the smiles fragment does not perserve any bond information from
> what I've tested so far.
>
> ----
> Pozdrawiam,  |  Best regards,
> Maciek Wójcikowski
> [email protected]
>
> 2017-06-19 17:12 GMT+02:00 Andrew Dalke <[email protected]>:
>
>> Me:
>> > Perhaps you want Chem.MolFragmentToSmiles(mol, atomsToUse=idxs)?
>> >
>> > http://www.rdkit.org/docs-beta/api/rdkit.Chem.rdmolfiles-
>> module.html#MolFragmentToSmiles
>>
>> Err, umm, *blush*. Forgot which list I was reading.
>>
>> [Andrew! It says it right in the subject line! :]
>>
>>                                 Andrew
>>                                 [email protected]
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to