> For the complete documentation index, see [llms.txt](https://ucsc-xena.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ucsc-xena.gitbook.io/project/how-do-i/how-do-i-make-subgroups.md).

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