I wrote a simple script following Prof. Jürgen's suggestion. I have
attached it to this email. It will only serve the purpose of generating
combinations based on specified positions and fragments.

regards,
harsh


On Mon, Aug 11, 2014 at 8:31 PM, Harshavardhan Khare <harshkh...@gmail.com>
wrote:

> Hi Jürgen,
>
> Thanks! I didn't think of this. It will be quite easy this way.
>
> regards,
> harsh
>
>
> On Mon, Aug 11, 2014 at 8:17 PM, Jurgen Bosch <jbos...@jhu.edu> wrote:
>
>>  you can do this via SMILES and your own script in any flavor and then
>> use your preferred program afterwards.
>> Jürgen
>>
>>  ......................
>> Jürgen Bosch
>> Johns Hopkins University
>> Bloomberg School of Public Health
>> Department of Biochemistry & Molecular Biology
>> Johns Hopkins Malaria Research Institute
>> 615 North Wolfe Street, W8708
>> Baltimore, MD 21205
>> Office: +1-410-614-4742
>> Lab:      +1-410-614-4894
>> Fax:      +1-410-955-2926
>> http://lupo.jhsph.edu
>>
>>  On Aug 11, 2014, at 10:34 AM, Harshavardhan Khare <harshkh...@gmail.com>
>> wrote:
>>
>>  Dear all,
>> I have a small organic molecule with three functional groups. I also have
>> another list of functional groups. I want to generate all possible
>> combinations of the molecule and any of the three functional groups from
>> the list.
>>  Does anybody know a program that performs this task and writes all the
>> generated structure coordinates?
>>
>>  Thanks.
>>
>>  regards,
>> harsh
>>
>>
>>
>
###########################################################################################
### SIMPLE PYTHON SCRIPT TO GENERATE A SMILES COMBINATORIAL LIBRARY USING SPECIFIED     ###
### REPLACEMENT FRAGMENTS AND POSITIONS WHERE THE FRAGMENTS SHOULD BE ADDED.            ###
### WARNING: THIS IS A VERY PRELIMINARY SCRIPT AND MAY NOT WORK FOR ALL THE MOLECULES.  ###
###          I HAVE TESTED IT ON ONLY A FEW MOLECULES.                                  ###
###########################################################################################

### SMILES NOTATION FOR THE ORIGINAL MOLECULE.
molSmiles = "CCC(CC)C1=CC=CC2=C1OC(=O)C(CCC1=[N+](C)C=C3C=CC=CC3=C1(COC(C)C))=C2"

### THESE ARE THE POSITIONS OF STARTING BRACKETS THAT DEFINE THE FRAGMENTS IN SMILES STRING.
### NOTE THAT THE CHARACTER NUMBERING IN STRING STARTS FROM ZERO.
mutationPos = [3,26,54]

###THESE ARE THE FRAGMENTS IN SMILES NOTATION. THESE WILL BE USED AS REPLACEMENT FRAGMENTS.
fragmentSmiles = ["CC(C)C","NC(=O)C"]

### THIS IS THE OUTPUT FILE WHICH CAN BE OPENED IN MOLECULAR EDITORS.
### I USED MARVIN-SKETCH TO VIEW ALL THE COMBINATIONS AT A TIME.
smilesCombFileName = "mutantSmiles.smi"

############################### DO NOT EDIT BELOW THIS LINE ###############################
brackets = []
bracketPairs = {}

### GENERATE DICTIONARY OF PAIRING BRACKETS.
for i in range(0,len(molSmiles)):
	if molSmiles[i] == "(":
		brackets.append(i)
	if molSmiles[i] == ")":
		if len(brackets) > 0:
			bracketPairs[brackets.pop()] = i

print "\nFollowing bracket pairs are found:"
print bracketPairs

### GENERATE COMBINATIONS AND WRITE TO OUTPUT FILE.
print "\nWriting mutated SMILES combinations to " + smilesCombFileName + " ..."
smilesCombFile = open(smilesCombFileName,'w')
for pos in mutationPos:
	for frag in fragmentSmiles:
		print "Adding fragment " + frag + " to bracket position " + str(pos)
		smilesCombFile.write(molSmiles[:pos+1] + frag + molSmiles[bracketPairs[pos]:] + "\n")
smilesCombFile.close()

print "DONE\n"

Reply via email to