# How do I make subgroups?

Use the find samples feature (highlighted below) to make subgroups:

![](/files/-MRS-_lT8r6J_AnfURYn)

First, search for all the patient's samples you want in one of your subgroups. Next, click the Filter + Subgroup menu and choose 'New subgroup column'.

This will create a new subgroup column. All the patient's samples that matched your search term will be in one subgroup labeled as 'true' and all the samples that did not match your search term will in the other subgroup labeled as 'false'.&#x20;

Your new column can be used for a [KM analysis](/project/how-do-i/how-do-i-make-a-km-plot.md) or to [compare gene expression](https://ucsc-xena.gitbook.io/project/how-to-pages-1/how-do-i-compare-gene-expression-between-subgroups).

{% hint style="info" %}
More information:

* [How to search for samples](/project/overview-of-features/filter-and-subgrouping.md)
* [Search terms for filtering and subgrouping](/project/overview-of-features/filter-and-subgrouping.md#supported-search-terms)
  {% endhint %}

## Example

In this example we are creating two subgroups in the TCGA Lung Adenocarcinoma study: patient's samples with aberrations in *EGFR* and those without. These aberrations could be mutations or copy number amplifications.

![](/files/-MRRwn4fq8x9mCTrImdf)

#### Steps

1. Type **'**(mis OR infra) OR C:>0.5'  into the samples search bar. This will select samples that either have a missense or inframe deletion '(mis OR infra)', or where copy number variation (column C) is greater than 0.5. Note that I arbitrarily choose a cutoff of 0.5.
2. Click the filter menu and select 'New column subgroup'. This will create a new column that has samples that met our search term marked as 'true' (ie. those that have an *EGFR* aberration) and those that did not meet our search term as 'false' (ie. those that do not have an *EGFR* aberration).

{% hint style="info" %}
For more information see our [Basic Tutorial: Section 2](/project/tutorials/basic-tutorial-section-2.md).
{% endhint %}

{% hint style="info" %}
[See our help on renaming the subgroup labels](https://ucsc-xena.gitbook.io/project/overview-of-features/filter-and-subgrouping#changing-subgroup-labels) from 'true' and 'false' to something more biologically meaningful.
{% endhint %}


---

# 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://ucsc-xena.gitbook.io/project/how-do-i/how-do-i-make-subgroups.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.
