> For the complete documentation index, see [llms.txt](https://disc4all-qupath.gitbook.io/qupath-project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://disc4all-qupath.gitbook.io/qupath-project/result-analysis-docs/final-spreadsheet-creation.md).

# Final Spreadsheet creation

Final spreadsheet creation by merging multiple file by the same ID, ID\_Sample

To create a final spreadsheet, linking the donor/sample information with the positivity rates of the antibodies within specific regions, we are again working in GitBash and calling a python file.&#x20;

1. Download the merger from [here](https://github.com/mapoferri/process_scan/blob/main/merger.py). Click on ![](https://2829430504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSleK316zl0BYwa7DfK2J%2Fuploads%2FC5m0zyDDBnYaa0TglgZK%2Fimage.png?alt=media\&token=807a541f-da35-4d17-8960-bffeada8396f) download raw file.
2. Create a Data\_output-all folder containing the subelements:&#x20;

{% tabs %}
{% tab title="Immunopositivity" %}
This folder contains all the data\_output files from the different antibodies. Just copy them from the folder generated in the previous step.&#x20;
{% endtab %}

{% tab title="merger" %}
merger is the python file that is used to merge the data. In the previous step, you downloaded the file so that you can relocate it from the downloads to the data\_output\_all folder.
{% endtab %}

{% tab title="Sample\_Information" %}
This an Excel sheet containing the donor information linked to the ID\_Sample. The information stored within the file can be chosen freely, however, the **ID\_Sample** is necessary to later on merge all the files.&#x20;
{% endtab %}
{% endtabs %}

<figure><img src="https://2829430504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSleK316zl0BYwa7DfK2J%2Fuploads%2Fjr21SQCH11j5oj5zp6Co%2Fimage.png?alt=media&amp;token=c39e6b04-ca8d-4839-9eb5-5cb4769f1ea5" alt=""><figcaption><p>organisation of the folder to perform merging to a final spreadsheet</p></figcaption></figure>

**Open Git Bash:**

To open **Git Bash** <img src="https://2829430504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSleK316zl0BYwa7DfK2J%2Fuploads%2FCj8wFY6WcLENbTftm7IO%2Fimage.png?alt=media&amp;token=84194b2f-16b8-4814-9e57-2dac3cd97646" alt="" data-size="line">search for it on your computer Menu and double-click on the icon to open. A standard prompt window will open.

1. **Open the Data\_output\_all Folder**

   You can open the Data\_output-all Folder from the terminal using the command ***cd.***

```
cd Path/To/Data_output_all
```

### Launch the merger from the terminal

From the same **Git Bash** terminal, the Python script is going to be launched.

{% code overflow="wrap" %}

```
python merger.py Path/To/Data_output_all/Sample_Information.xlsx Path/To/Data_output_all/Immunopositivity MergedFile.csv
```

{% endcode %}

The MergedFile is your new output file, containing all the information of the donor/sample merged together with the positivity rate for each region, antibody and sample.&#x20;

<figure><img src="https://2829430504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSleK316zl0BYwa7DfK2J%2Fuploads%2FyLf6vrc8gkczrWyOYQM8%2Fimage.png?alt=media&amp;token=c37ab174-4ff6-4aca-9096-06a2fc852d06" alt=""><figcaption><p>An examples for a final MergedFile</p></figcaption></figure>
