What is Code Mode?Code Mode is a toggle that tells OpenBio to use Python code execution tools for computational analysis. When enabled, OpenBio will use the code sandbox environment for data analysis, visualizations, calculations, and other computational tasks.
Activating Code Mode
Toggle Button
Location: Code icon button (<>) in the chat input toolbar
- Look for the code icon in the chat input area
- Click to toggle Code Mode on/off
- When active, the icon and the chat input area highlights in purple
- Your preference is saved automatically
Visual Indicator
When Code Mode is active:- The code icon and the chat input area appears highlighted (purple background)
- OpenBio will prioritize Python execution tools
- Code execution results appear inline in your chat
What Code Mode Does
When Code Mode is enabled, OpenBio:- Prioritizes code execution for computational tasks
- Uses Python tools for data analysis, visualizations, and calculations
- Maintains state across multiple code executions in the same chat
- Provides a sandboxed environment with pre-installed scientific libraries
Available Capabilities
Pre-installed Libraries
The code sandbox includes popular data science packages:- Data manipulation:
pandas,numpy - Visualization:
matplotlib,seaborn - Scientific computing:
scipy,scikit-learn - Bioinformatics: Standard Python libraries for sequence analysis
File Management Integration
Code Mode integrates with OpenBio’s file system:- Upload files: Transfer project files to the sandbox for analysis
- Download results: Save analysis outputs back to your project
- List files: See what’s available in the sandbox environment
Common Use Cases
Data Analysis
Analyze experimental data, datasets, and research results:Visualization
Generate plots, charts, and visualizations:Scientific Computing
Perform calculations and simulations:Bioinformatics Analysis
Process biological data:Working with Files
Using File References
Reference uploaded files with @:Downloading Results
After the analysis is complete, OpenBio will automatically save the analysis outputs back to your project. In case it does not, you can ask OpenBio to download the results:Rich Output Support
For each session, the outputs and code of the analysis are available in the research panel. You can open the “Python Session” tab to view the outputs from the visualizations and code of the analysis. This displays the outputs in a readable format.- Text output: Print statements and return values
- DataFrames: Formatted tables from pandas
- Images: Generated figures and charts
- HTML: Interactive visualizations
Best Practices
Be Specific About Data
Be Specific About Data
Tell OpenBio what data you want to analyze:
- “Analyze the protein sequences in @sequences.fasta”
- “Create a plot of binding affinities from @experiment.csv”
Describe Your Data
Describe Your Data
Describe the data you are working on:
- “I am working on the protein sequences in @sequences.fasta”
- “I am working on the binding affinities from @experiment.csv”
Describe Your Goals
Describe Your Goals
Explain what you want to achieve:
- “Calculate the mean and standard deviation”
- “Create a scatter plot with regression line”
- “Find sequences with GC content > 60%”
Request Visualizations
Request Visualizations
Ask for plots and charts explicitly:
- “Create a bar chart showing…”
- “Generate a heatmap of…”
- “Plot the distribution of…”
Save Important Results
Save Important Results
Always download important outputs:
- “Save the processed data to my project”
- “Download the visualization as PNG”
- “Export the results to CSV”
Use File References
Use File References
Reference uploaded files with @:
- “@my_data.csv” instead of “my_data.csv”
- This ensures OpenBio knows which file you mean
Limitations
- Timeout protection: Long-running code may timeout and in case you leave the page, the session will be lost.
- Resource limits: Very large datasets may need optimization
- Package installation: Some packages may need to be installed on-demand, OpenBio will install them for you.
- State scope: Variables persist only within the same chat session