Commit 13e3708e authored by JinyuanSun's avatar JinyuanSun
Browse files

modified: copilot_public/README.md

	modified:   copilot_public/new_function_template.py
parent c2d615e8
Loading
Loading
Loading
Loading
+29 −1
Original line number Diff line number Diff line
@@ -64,7 +64,35 @@ You are more than welcome to contribute any function to ChatMol copilot.
4. Create a pull request
5. We will review your code and merge it to the main branch  

**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."*
**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."*


## TODO
### Analysis tools
- [ ] **Protein Docking Simulation**: Develop a simulation tool for docking small molecule ligands to protein targets, exploring potential binding modes.
  - AutoDock Vina (High priority)
  - DiffDock (Low priority)
  
- [ ] **Protein Structure and Sequence Comparison**: Build a tool for comparing the structures of multiple proteins, identifying similarities, differences, and motifs.
  - TM-align (High priority)
  - Kalign (Medium priority)
  - MMseqs2 (Low priority)

- [ ] **Ligand Binding Affinity Prediction**: Create a tool to predict the binding affinity of ligands with protein targets, aiding in understanding ligand-protein interaction strength.
  - RF-Score (High priority)
  - 

- [ ] **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.

- [ ] **Protein Function Prediction**: Build a tool for predicting the biological function of proteins based on their structure and sequence.


### visualization tools
- [ ] **Protein-Ligand Interaction Visualization**: Create a tool for visualizing and analyzing protein-ligand interactions, focusing on key binding residues.


## Online Version
We provided an online version for you. [Click here](https://chatmol.org/copilot/) to try it.  
 No newline at end of file
+88 −0
Original line number Diff line number Diff line
@@ -221,6 +221,94 @@ test_data = {
    }
}

import types


def predict_rna_secondary_structure(self, rna_seq: str):
    from seqfold import fold, dg, dot_bracket
    """
    Predict the secondary structure of an RNA sequence using the seqfold library.

    Parameters:
    - rna_seq (str): The RNA sequence to be analyzed.

    Returns:
    - A dictionary with the minimum free energy and the dot-bracket representation of the structure.
    """

    # Calculate the minimum free energy (MFE) using seqfold
    mfe = dg(rna_seq)

    # Get the structural details using seqfold
    structs = fold(rna_seq)

    # Get the dot-bracket representation of the structure
    dot_bracket_structure = dot_bracket(rna_seq, structs)

    return f"Minimum Free Energy (MFE): `{mfe}`\nDot-Bracket Structure: `{dot_bracket_structure}`"

# Update the function description in the function_descriptions list
function_descriptions.append({
    "type": "function",
    "function": {
        "name": "predict_rna_secondary_structure",
        "description": "Predict the secondary structure of an RNA sequence using the seqfold library",
        "parameters": {
            "type": "object",
            "properties": {
                "rna_seq": {"type": "string", "description": "The RNA sequence"},
            },
        },
        "required": ["rna_seq"],
    },
})

# Update test data for the new function
test_data["predict_rna_secondary_structure"] = {
    "input": {
        "self": None,
        "rna_seq": "GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC",
    },
    "output": {"Minimum Free Energy (MFE): `-13.4`\nDot-Bracket Structure: `((((((((.((((......))))..((((.......)))).))))))))`"
        # "Minimum Free Energy (MFE)": -13.4,
        # "Dot-Bracket Structure": "((((((((.((((......))))..((((.......)))).))))))))"
    },
}



def predict_logp_from_smiles(self, smiles: str):
    from rdkit import Chem
    from rdkit.Chem import Crippen
    mol = Chem.MolFromSmiles(smiles)
    if mol is None:
        return "Invalid SMILES string"
    logp = Crippen.MolLogP(mol)
    return f"The predicted logP value for the molecule {smiles} is {logp}"

function_descriptions.append({
    "type": "function",
    "function": {
        "name": "predict_logp_from_smiles",
        "description": "Predicts the logP value of a molecule from its SMILES notation",
        "parameters": {
            "type": "object",
            "properties": {
                "smiles": {"type": "string", "description": "The SMILES notation of the molecule"},
            },
        },
        "required": ["smiles"],
    },
})

test_data["predict_logp_from_smiles"] = {
    "input": {
        "self": None,
        "smiles": "CCO",
    },
    "output": "The predicted logP value for the molecule CCO is 0.4605",  # Example output
}

### DO NOT MODIFY BELOW THIS LINE ###
def get_all_functions():
    all_functions = []