#### This project is still in development.

# CureQ

This is the repository of the CureQ consortium.<br>
For more information about the CureQ project, visit https://cureq.nl/
This repository contains a library with functions for analyzing Microelectrode Array (MEA) experiments.<br>
This repository is maintained by the Amsterdam University of Applied Sciences (AUMC).<br>
This library can process both Multi Channel Systems and Axion Biosystems MEA data, although the latter will have to be converted to hdf5 format using our MATLAB script, which can be found in the repository.
For more information about the analysis or how to use the library, check out the "CureQ MEA-analysis library User Guide.pdf" file.<br>

___

## Install the library

First, make sure you have installed a version of python on your machine, all python releases can be found here: https://www.python.org/downloads/ <br>
Secondly, make sure you have installed a package manager, like pip or conda. <br>
Next, open a terminal and navigate to your home folder.

#### Install library with pip
Install the MEA analyzer with the following command when you are using Pip:
```shell
pip install CureQ 
```

#### Install library with conda
Install the MEA analyzer with the following command when you are using Conda:
```shell
conda install CureQ::CureQ
```

More elaborate and simple installation instructions can be found in the user guide.

---

## Library usage
Now you can try the CureQ library functions in your Python environment. <br>
Import the function you need, call this function and watch how the pipeline analyzes your MEA file!

#### Example for analyzing all MEA wells
```python
from CureQ.mea import analyse_wells, get_default_parameters

fileadress='C:/mea_data/mea_experiment.h5'
sampling_rate=20000
electrode_amount=12

# Get and edit parameters
parameters = get_default_parameters()
parameters['use multiprocessing'] = True

if __name__ == '__main__':
    analyse_wells(fileadress=fileadress,
                  sampling_rate=sampling_rate,
                  electrode_amnt=electrode_amount,
                  parameters=parameters
                  )
```

---

## MEA GUI
Addionally, the CureQ mea library contains a graphical user interface that can be used to perform the analysis. <br>
The GUI is also used to inspect the raw MEA data and the analysis results. Example visualisations can be found below. <br>
The GUI can be opened as follows:

#### Opening the GUI
```python
from CureQ.mea_analysis_tool import MEA_GUI

if __name__=="__main__":
    MEA_GUI()
```

#### Launch from command prompt
Additionally, he GUI can be launched from the command prompt. Simply open the command prompt, and enter “cureq”.
```shell
C:\Users>cureq
Successfully launched MEA GUI
```
The output should look like this, and the GUI should appear on your screen.

#### Create shortcuts
This process can be simplified by creating shortcuts that in essence perform the same process. In the command prompt, enter “cureq –create-shortcut”.

```shell
C:\Users>cureq --create-shortcut
Desktop shortcut created at C:\Users\Desktop\CureQ.lnk
```
The output should look like this, and a shortcut should appear on your desktop:

Additionally a shortcut can be added to the start menu. In the command prompt, enter “cureq –add-to-start-menu”.
```shell
C:\Users>cureq --add-to-start-menu
Start Menu shortcut created at C:\Users \AppData\Roaming\Microsoft\Windows\Start Menu\Programs\CureQ\CureQ.lnk
```

The output should look likes this, and the shortcut should appear in your start menu.
The shortcut can also be added to the taskbar by pressing “Pin to taskbar”.

---

## Example visualisations

#### Spike detection
![Spike detection](https://github.com/CureQ/CureQ/blob/main/Example_visualisations/spike_detection.png)

#### Single channel burst detection
![Burst detection](https://github.com/CureQ/CureQ/blob/main/Example_visualisations/burst_detection.PNG)

#### Network burst detection
![Network burst detection](https://github.com/CureQ/CureQ/blob/main/Example_visualisations/network_burst_detection.PNG)

#### Batch processing
![Batch processing](https://github.com/CureQ/CureQ/blob/main/Example_visualisations/batch_processing.png)

#### Group comparison
![Group comparison](https://github.com/CureQ/CureQ/blob/main/Example_visualisations/group_comparison.png)

![Features over time](https://github.com/CureQ/CureQ/blob/main/Example_visualisations/features_over_time.png)

![Boxplots](https://github.com/CureQ/CureQ/blob/main/Example_visualisations/boxplot.png)

<!--
**CureQ/CureQ** is a ✨ _special_ ✨ repository because its `README.md` (this file) appears on your GitHub profile.
-->
