# Merge matrices

In complex projects, different data matrices (e.g. observations on rows and features on columns) need to be merged in order to achieve the analysis goals. For example, two cell populations were identified on separate branches of the analysis pipeline and to combine them before any joint downstream steps, the expression matrices have to be combined. Alternatively, two assays (gene expression and protein expression) were performed on the same cells so the expression matrices have to be merged for joint analysis.

*Merge matrices* task is located in the *Pre-analysis tools* section of the toolbox and it can handle two scenarios: *Merge cells/samples* and *Merge features*. To start, select the first **data node** on the pipeline (e.g. single cell counts) and then select the **Merge matrices** task.

<div align="left"><figure><img src="/files/eiZztZyxtwUoh3KryNYN" alt=""><figcaption></figcaption></figure></div>

## Merge Cells/Samples

To use the *Merge cells* option, the data matrices (one or more) that are to be merged with the currently selected one should have the same features (e.g. genes), but distinct cells. Push the **Select data nodes** button to display a preview of the pipeline; the data nodes that can be merged are shown in color of the branch, other data nodes are disabled (greyed out). Left click on the data node that you want to merge with the current one and click the **Select** button, you can select multiple data nodes to merge. The selected node(s) will be shown under the *Select data nodes* button. If you made a mistake, use the *Clear selection* icon. Push **Finish** to proceed.

<div align="left"><figure><img src="/files/tZn3G4HvxEHgGLGdO3Xu" alt=""><figcaption></figcaption></figure></div>

## Merge Features

To use the *Merge features* option, the data matrices (one or more) that are to be merged with the currently selected one should have the same cells (or samples), but distinct features (e.g. gene and protein expression). Push the **Select data nodes** button to display a preview of the pipeline; the data nodes that can be merged are shown in color of the branch, others are disabled (greyed out). Left lick on the data node that you want to merge with the current one and push the **Select** button. The selected node will be shown under the *Select data nodes* button. Repeat the procedure if you would like to merge additional nodes. If you made a mistake, use the *Clear selection* icon. Push **Finish** to proceed.

The output of the *Merge matrices* task is a *Merged counts* data node.


---

# 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://help.multiomics.illumina.com/icm/analyses/analysis-functionality/task-menu/pre-analysis-tools/merge-matrices.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.
