# Filter groups (samples or cells)

* [Configuring a filter](#configuring-a-filter)
* [Configuring multiple filters](#configuring-multiple-filters)
* [Filter groups task report](#filter-groups-task-report)

Filter samples or cells in order to perform downstream analysis on a subset of data.

To filter groups, click a count matrix or single cell counts data node, click the Filtering section of the toolbox, and choose to **Filter samples** (bulk data) or **Filter cells** (single cell data).

The dialog lets you build a series of filters based on sample or cell attributes.

Click **Finish** to apply the filter. If no sample or cell will pass the filter criteria, a warning message will appear and the task will not run.

## Configuring a filter

The first drop-down menu allows you to choose to **include** or **exclude** based on the specified criteria.

The second drop-down menu allows you to choose any categorical or numeric attribute to use for the filter criteria.

If the attribute is **categorical**, the third drop-down menu includes **in** and **not in** as options. A fourth drop-down menu allows you to search and choose from the levels of the selected attribute (Figure 1).

<div align="left"><img src="https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-032824542d8917657948153abe0dcdfb0f0b2078%2Fimage2023-9-12_14-28-36.png?alt=media" alt="Figure 1. Filtering by a categorical attribute"></div>

If the attribute is **numeric**, the the third drop-down includes:

* <: less than
* <=: less than or equal to
* \== equal to
* \>: greater than
* \>=: greater than or equal to

The threshold is set using the text box (Figure 2). The input must be a number; it can be an integer or decimal, positive or negative.

<div align="left"><img src="https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-dce616cf07bb8db6675450c4c99193c0c64e7aeb%2Fimage2023-9-12_14-34-8.png?alt=media" alt="Figure 2. Filtering groups by a numeric attribute"></div>

## Configuring multiple filters

Using the **OR** and **AND** options, you can combine multiple filters.

When combining multiple filters all set to **Include**:

With **AND**, if all statements must be true for the sample to meet the filter criteria.

With **OR**, if any statement is true, the sample will meet the filter criteria.

When combining multiple filters all set to **Exclude**:

With **AND**, if any statement is true, the sample will meet the filter criteria.

With **OR**, all statements must be true for the sample to meet the filter criteria.

## Filter groups task report

The filter groups task report lists the filter criteria and reports feature distribution statistics for the remaining samples (Figure 3).

<div align="left"><figure><img src="https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-bfc0304f9068444df0365e48c152b94211ef9e88%2Fimage2023-9-12_14-39-52.png?alt=media" alt=""><figcaption><p>Figure 3. Filter samples task report - feature distribution table</p></figcaption></figure></div>

If the input was a count matrix data node, the percentage of samples remaining after the filter is listed and charts are provided to show the breakdown of samples by categorical attributes before and after filtering (Figure 4).

<div align="left"><img src="https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-7bb3f41f8d4441fa460d505e1e1455f0cc0aa18f%2Fimage2018-11-21%2014_3_42.png?alt=media" alt="Figure 4. Filter samples report - feature distribution table"></div>

If the input was a single cell counts data node, a second table displays the details from each sample based on the filtered criteria (Figure 5).

![Figure 5. Filter cells - cell classification table](https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-5cc688caf4d990fc14c7901de044fb52e34a3c0e%2Fimage2023-9-12_14-47-11.png?alt=media)

If the input was a classified groups single cell counts data node, the cell count table includes a breakdown by classification and a bar chart is provided to show the number of cells from each classification remaining after filtering (Figure 6).

<div align="left"><img src="https://1384254481-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJVEESmJAPppJ3ijFq5aR%2Fuploads%2Fgit-blob-5b3029bb5585d8edceb1cdba56646e44a657766c%2Fimage2018-11-21%2013_24_40.png?alt=media" alt="Figure 6. Filter cells - classification bar chart"></div>

## Additional Assistance

If you need additional assistance, please visit [our support page](http://www.partek.com/support) to submit a help ticket or find phone numbers for regional support.
