---
## Neurotransmitter Synthesis
This repository contains scripts to simulate the synthesis of neurotransmitters from amino acids using RDKit. It includes the biochemical pathways for creating neurotransmitters such as serotonin from tryptophan.
### Features
- Simulate the conversion of tryptophan to serotonin.
- Generate and save molecular structure images at each step.
- Easily extendable to other neurotransmitter synthesis pathways.
### Setup and Usage
1. Clone the repository:
```sh
git clone https://github.com/AdwikParashar
/NeurotransmitterSynthesis.git
cd NeurotransmitterSynthesis
```
2. Install the required packages:
```sh
pip install -r requirements.txt
```
3. Run the script to simulate serotonin synthesis:
```sh
python Serotonin_synthesis.py
```
### Requirements
- RDKit
- Pillow
The script generates images of the molecules at each step and saves them in the current directory.
---
Serotonin
Code Starts From Here, can be run thrugh pycharm through bio_sim Conda Enivironment
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
import os
# Define a function to display a molecule and save it to a file
def display_and_save_molecule(mol, filename, title):
if mol is not None:
img = Draw.MolToImage(mol)
img.save(filename)
print(f"{title} molecule created and saved as {filename}.")
else:
print(f"Failed to create {title} molecule.")
# Define the SMILES string for tryptophan
tryptophan_smiles = "N[C@@H](C(O)=O)Cc1c[nH]c2ccccc12"
# Step 1: Create the molecule object for tryptophan
tryptophan = Chem.MolFromSmiles(tryptophan_smiles)
display_and_save_molecule(tryptophan, "tryptophan.png", "Tryptophan")
# Step 2: Manually simulate the hydroxylation of Tryptophan to 5-HTP
htp_smiles = "N[C@@H](C(O)=O)Cc1c[nH]c2ccc(O)cc12"
htp = Chem.MolFromSmiles(htp_smiles)
display_and_save_molecule(htp, "5-htp.png", "5-HTP")
# Step 3: Decarboxylation of 5-HTP to Serotonin
if htp is not None:
# Define the decarboxylation reaction (removes the carboxyl group)
decarboxylation_reaction = AllChem.ReactionFromSmarts('[C:1](C(=O)O)[C:2]>>[C:1][C:2]')
# Apply the decarboxylation reaction to 5-HTP
products = decarboxylation_reaction.RunReactants((htp,))
if products:
serotonin = products[0][0] # Get the first product
serotonin.UpdatePropertyCache() # Ensure the molecule properties are up-to-date
display_and_save_molecule(serotonin, "serotonin.png", "Serotonin")
else:
print("Decarboxylation reaction failed.")
else:
print("Skipping decarboxylation step due to failed hydroxylation.")
# Check the current working directory
print("Current working directory:", os.getcwd())
# Verify that the images are saved in the current working directory
print("Files in current directory:", os.listdir(os.getcwd()))
Comments
Post a Comment
If you have any queries, please don't hesitate to ask .