# Command Line Start Guide

{% hint style="info" %}
If you are new to command line / bash, you can start [here](/evolver/guides/command-line-usage.md)!
{% endhint %}

## Overview

Reasons you might use command line experiment start:

1. Doing a custom experiment
2. Unable to install GUI or getting errors you aren't able to fix easily (post on the forum first)

## Protocol

{% hint style="warning" %}
Set your computer to never fall asleep to prevent experiments from being halted.
{% endhint %}

1. In a command line window, enter the dpu virtual environment.
   1. Navigate to the DPU directory
      * Use this command: `cd <path_to_dpu>`
   2. Enter the command:
      * On Mac OS:
        * `source dpu-env/bin/activate`
      * On Windows PowerShell:
        * `dpu-env\Scripts\Activate.ps1`
2. Navigate to your experiment folder
   1. This should be in `dpu/experiment`
3. Copy the template folder and rename it for each experiment
   1. Navigate into your new experiment folder
4. Alter settings in `custom_script.py`
   1. `EVOLVER_PORT` = set correct IP of the eVOLVER
   2. Set initial temp and stir settings
   3. `custom_script.py` has basic settings for running chemostat and turbidostat experiments, but you can also customize. To learn more click [here](/evolver/software/dpu/custom_script.py.md).
5. Start the experiment using the command:
   1. `python3 eVOLVER.py -i <your_evolver's_IP_address>`
   2. `python3 eVOLVER.py -i 192.168.1.9`
6. [Calibrate to blank](/evolver/experiments/starting-an-experiment/od-blank.md)
   1. Temperature should be fully equilibrated before this
   2. DO NOT add cells before blanking, whatever OD value the cells + media have will be subtracted from future measurements
7. Stop the experiment using the keyboard shortcut `control+C`
   1. One `control+C` pauses the experiment from recording data
   2. Two `control+C` stops the experiment
8. To change parameters mid-experiment or restart from blank data files:
   1. Stop the experiment fully
   2. Change parameters in `custom_script.py`
   3. Restart the experiment
      1. Continue to keep your data
         1. Overwrite to make new blank data files and throw away your old experiment. NOTE: you will lose your OD blank and will need to make a new one (a hassle if you have already inoculated with cells)
9. You can run experiments on more than one eVOLVER at a time
   1. Create a new experiment folder (different `custom_script.py`) and change IP
   2. Follow this procedure in an additional command line window

{% hint style="info" %}
You can graph your experiment using the graphing tool [here](https://github.com/FYNCH-BIO/dpu/tree/master/graphing).
{% endhint %}

## Ending an Experiment

1. [Clean up](/evolver/experiments/starting-an-experiment/cleaning-up-after-experiment.md) the experiment
2. Data is in the [data files](/evolver/software/dpu/experiment-data-files.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://khalil-lab.gitbook.io/evolver/experiments/starting-an-experiment/command-line-start-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
