Skip to main content
OpenBio’s Code Mode enables powerful Python-based data analysis directly within your research conversations. When activated, OpenBio prioritizes using a stateful Jupyter notebook environment for computational tasks, data visualization, and scientific computing.
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.
Watch a demo of Code Mode in action:

Activating Code Mode

Toggle Button

Location: Code icon button (<>) in the chat input toolbar
  1. Look for the code icon in the chat input area
  2. Click to toggle Code Mode on/off
  3. When active, the icon and the chat input area highlights in purple
  4. 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:
Analyze the protein expression data in @experiment_results.csv
Create a scatter plot showing correlation between variables
Calculate statistical significance of the differences

Visualization

Generate plots, charts, and visualizations:
Create a heatmap of gene expression data
Plot the binding affinity distribution
Generate a 3D visualization of the molecular structure

Scientific Computing

Perform calculations and simulations:
Calculate GC content for these DNA sequences
Perform statistical analysis on the experimental results
Simulate protein folding kinetics

Bioinformatics Analysis

Process biological data:
Parse FASTA files and extract sequences
Calculate sequence similarity scores
Analyze phylogenetic relationships

Working with Files

Using File References

Reference uploaded files with @:
Analyze the sequences in @protein_sequences.fasta
This ensures OpenBio knows which file you mean and will use it for the analysis. OpenBio will also automatically upload the file to the sandbox for you.

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:
Download the processed_data.csv and plot.png to my project
Files are saved to your project filesystem and you can access them through the Files tab.
When working on a file, it is better to create a folder that OpenBio can use to save the results. You should save the input files in the same folder as the analysis files. Also, better to reference the folder in your query to make sure OpenBio saves the results in the same folder.
Analyze the sequences in @sequences folder, and save the results in the same folder.

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

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 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”
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%”
Ask for plots and charts explicitly:
  • “Create a bar chart showing…”
  • “Generate a heatmap of…”
  • “Plot the distribution of…”
Always download important outputs:
  • “Save the processed data to my project”
  • “Download the visualization as PNG”
  • “Export the results to CSV”
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

Next Steps

Pro Tip: Code Mode is perfect for exploratory data analysis. Start with a simple question, review results, then ask follow-up questions to dive deeper into your data.