This is ChatMol copilot, just like other copilot, it is designed to help your work. Here the LLM is enpowered by computational biology tools and databases. We showed some cases in the video, and you can also try it by yourself.
git https://github.com/JinyuanSun/ChatMol
cd ChatMol/copilot_public
pip install -r requirements.txt
streamlit run main.py
After the copliot is strateted, change the Project Name
to examples/enzyme-for-toxin-degradation
, you will see the history of how copliot:
You can easily add more functionality to ChatMol copilot.
# 1. Define a function
def translate_to_protein(self, seq:str, pname=None):
from Bio.Seq import Seq
nucleotide_seq = Seq(seq)
protein_seq = nucleotide_seq.translate()
if pname:
return f"The protein sequence of {seq} is `>{pname}\n{protein_seq}`"
else:
return f"The protein sequence of {seq} is `>protein\n{protein_seq}`"
# 2. Add it to the conversation
cfn.translate_to_protein = translate_to_protein.__get__(cfn)
conversation.tools.append(
{ # This is the description of the function
"type": "function",
"function": {
"name": "translate_to_protein",
"description": "Translate a DNA/RNA sequence to a protein sequence",
"parameters": {
"type": "object",
"properties": {
"seq": {"type": "string", "description": "The DNA/RNA sequence"},
},
},
"required": ["seq"],
},
}
)
conversation.available_functions["translate_to_protein"] = cfn.translate_to_protein
By adding the above code to main.py
at line 97 after conversation = ConversationHandler(client, cfn, model_name=model)
, you can add this translation function to ChatMol copilot.
You are more than welcome to contribute any function to ChatMol copilot.
copilot_public/new_function_template.py
.test_data
. You can refer to the existing content in copilot_public/new_function_template.py
. We have a button named Add from template
. You can click it to add your function to ChatMol copilot.If you still don’t know what to do, just paste this and the content in copilot_public/new_function_template.py
to the input box of ChatGPT and ask it to do all the coding for you.
Remeber to add the magic prompt: “I don’t have fingers, can you write the complete code for me.”
Protein Design and Engineering: Design a tool for engineering proteins with specific functions or properties, like enzyme activity or substrate binding.
Protein-Protein Interaction Prediction: Develop a tool to predict protein-protein interaction partners and binding sites based on their 3D structures.
We provided an online version for you. Click here to try it.