> For the complete documentation index, see [llms.txt](https://medomicslab.gitbook.io/medomics-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://medomicslab.gitbook.io/medomics-docs/tutorials/design/input-module/medprofiles.md).

# MEDprofiles

{% hint style="warning" %}
MEDprofiles is currently disabled because it did not pass all the stability checks; however, it will be available in future releases.
{% endhint %}

{% embed url="<https://youtu.be/BFR1UnIjnYQ?si=xSZtLOA-yRYouB6E>" %}
MEDprofiles Video Tutorial
{% endembed %}

The *MEDprofiles 'Prepare Data' component* is accessible on the [*Input Module*](/medomics-docs/tutorials/design/input-module.md) page and looks like this:

<figure><img src="/files/JTYrvPDl57eeWdTv93jS" alt=""><figcaption><p>MEDprofiles dashboard</p></figcaption></figure>

## 2. Create or select your master table

The master table is the entry point of the *MEDprofiles* process. It is a CSV file that must adhere to the following format:

* Column names must be 'PatientID', 'Date', 'Time\_point', and others must contain '\_'.
* The first line (after columns) must contain 'string' or 'num' in the first position, 'datetime.date' in the second, and 'num' in all others.
* The first column (excluding the first line) must contain strings or integers.
* The second column (excluding the first line) must contain datetime values.
* The third column (excluding the first line) must contain null or integer values.
* The other columns (excluding the first line) must contain numerical values.

If you have already created a master table, it will be automatically detected and you should be able to select it in the third input box (see figure below). If this is not the case, this component will allow you to create one. Depending on your actions in the application, different options will be available:

<figure><img src="/files/oRGeW5OXuVAb2IPnGndm" alt=""><figcaption><p>Create or select your master table</p></figcaption></figure>

* *Select CSV files*: If you have generated embedding data using the extraction module, the generated files will appear in the list box and you can select the ones to use for master table creation.

<figure><img src="/files/Ixi5nLCgfwyok9IJamIV" alt=""><figcaption></figcaption></figure>

* Otherwise, the input box list will be empty. In this case, if you want to use the *MEDprofiles prepare data component*, you will need to explore the[ extraction module](/medomics-docs/tutorials/design/extraction-modules.md) and generate data that adheres to the master table format (refer to the extraction pages tutorials for more information).

This section is divided into two subparts: one for master table creation and the other for master table selection.

### 2.1. Create your master table

You need to select the files you want to include in your master table. Afterward, you can choose the name under which you want to save your master table. The default name is 'master\_table.csv.' It's important that your chosen name ends with the CSV extension. If some of your selected files contain columns with type mismatches (for example, if your patient identifiers are numbers in some files and strings in another), a warning will appear, and you won't be able to proceed with master table creation. If this is the case, check your data types.

<figure><img src="/files/DwIqGkFj6mHd487gxdbG" alt=""><figcaption></figcaption></figure>

If everything is in order, you can press the '*Create Master Table*' button. Once the master table creation process is complete (which usually takes a few seconds), a message will appear at the bottom (see figure below), indicating that the master table has been generated and saved in the mongoDB database under DATA/MEDprofiles/master\_tables. This will also update the master table selection input box.

<figure><img src="/files/6WzCaDwL5LulSsB2DXJs" alt=""><figcaption><p>Master table created successfully</p></figcaption></figure>

The '*Create Master Table*' button will also analyzes your selected master table and create the classes that will be associated with your MEDprofiles (i.e. the *MEDclasses*). The created classes will be registered under 'DATA/MEDprofiles/MEDclasses' and will be displayed in the application as follows :

{% hint style="info" %}
The classes will be created based on the column names of the master table.
{% endhint %}

{% hint style="info" %}
In the master table, the column names adhere to the format 'className\_attributeName'.
{% endhint %}

<figure><img src="/files/6jZBU8nQVpzqJ4nne3dG" alt=""><figcaption><p>Generated MEDclasses</p></figcaption></figure>

### 2.2. Select your master table

Here, you only need to select a master table from the list of available master tables in your chosen folder. If the selector indicates 'No CSV files to show,' it means that no CSV files matching the required format are available in your selected folder from the first part.

<figure><img src="/files/hFJDr3I8ccLcwP5K22Mb" alt=""><figcaption><p>Available master tables selection</p></figcaption></figure>

## 3. Instantiate MEDprofiles

Once a master table is selected, you can instantiate your master table data as [MEDprofiles](https://github.com/MEDomics-UdeS/MEDprofiles). You can choose the name under which you want your data to be registered. It is important that the filename ends with the '.pkl' extension.

<figure><img src="/files/0AOmT2vN94TYslt1UCfY" alt=""><figcaption><p>Instantiate MEDprofiles</p></figcaption></figure>

The process of instantiating MEDprofiles data may take a few minutes. While the process is running, a progress bar will be displayed, indicating the advancement of the process.

{% hint style="warning" %}
If the button "Instantiate MEDprofiles" is disabled, make sure you have selected a master table in the section 2 and the generated MEDclasses are displayed.
{% endhint %}

## 5. Visualize your MEDprofiles data

To open the MEDprofiles figure, you need to select the recently created MEDprofiles binary file (files with the right format are detected and added the list box automatically).&#x20;

<figure><img src="/files/gFNquvzVMkkD8dq3dkLP" alt=""><figcaption><p>MEDprofiles binary file selection</p></figcaption></figure>

Once a binary file is selected, click 'open MEDprofiles Viewer' to access the data viewer:

<figure><img src="/files/k5CcL2Vee0NjUKa5Ke6r" alt=""><figcaption><p>Visualize you MEDprofiles data</p></figcaption></figure>

{% hint style="warning" %}
If either of the two elements (MEDclasses folder and/or MEDprofiles binary file) doesn't contain elements to select, ensure that the previous steps have been completed successfully.
{% endhint %}

Check out the next page to learn more about the MEDprofiles viewer!

{% content-ref url="/pages/msV69UlPy4LrLO9OkU27" %}
[MEDprofiles Viewer](/medomics-docs/tutorials/design/input-module/medprofiles/medprofiles-viewer.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://medomicslab.gitbook.io/medomics-docs/tutorials/design/input-module/medprofiles.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
