5. Adding Quality Filters to the Filter ChainΒΆ

Creation of the filter chain has been split into two chapters or pages. This first chapter covers adding quality filters, creating a filter container and moving filter cards into this container.

  1. The first filter we are going to add is a read depth filter. For this data, the field we prefer is the Read Depth (DP) or Read Depth.

    We will add this filter from the table view. From the table, right click on the Read Depth (DP) column and select Add to Filter Chain. See Figure 5-1.

    Add DP Filter

    Figure 5-1: Adding DP filter from the Table View

  2. In the Read Depth (DP) (Current) filter card, on the left, the (Current) refers to the current sample as indicated above the Filter Chain. If you switch samples the values in this card will update to the sample indicated.

    For this data a good threshold is 2500. So change the value in the text box from 0 to 2500 and click on Equal to 2500 and Greater than 2500. See Figure 5-2.

    Read Depth (DP) Filter Card

    Figure 5-2: Filter Variants to remove those with poor Read Depth (DP) values

  3. Next, we are going to create a genotype quality filter. Right-click on the Genotype Qualities (GQ) column and select Add to Filter Chain. See Figure 5-3.

    Add Genotype Quality Filter

    Figure 5-3: Adding Genotype Quality filter from the Table View

  4. Change the threshold for the Genotype Qualities (GQ) filter card to be 50 and click on Equal to 50 and Greater than 50. See Figure 5-4.

    Genotype Quality Filter Card with Threshold

    Figure 5-4: Filter Variants to remove those with poor Genotype Quality values

  5. In addition to filter cards, you can group filter cards together in the filter chain. This is done by creating a filter container. Create a filter container by right-clicking in the Filter View and selecting Add Filter Container. See Figure 5-5.

    Filter Container

    Figure 5-5: Creating a Filter Container

  6. We are going to put both the read depth and genotype qualities filter cards into this container. First, we will change the title of the filter container to be more descriptive. Double-click on the title of the filter container and edit the title to be Quality Filters. See Figure 5-6.

    Edit Title

    Figure 5-6: Edit the title of a filter container

  7. Click and drag the two quality filter cards ( Read Depth (DP) and GQ) into the Quality Filters container. See Figure 5-7.

    Filters in Container

    Figure 5-7: Drag and drop filters into container

    These two filters are applied sequentially, the container in this situation is a way to group similar filters. Filter containers have logical conditions to determine how variants pass through the various filter cards within the containers. By default this sequential logic or AND logic means that for a variant to pass through the filter container it has to pass through all filter cards in the container. The logical condition can be changed to OR which would mean that a variant would only have to pass through at least one filter card in the container.

    Try this now, by clicking on the wrench icon for the Quality Filter container and choose OR. See Figure 5-8.

    Filter container options

    Figure 5-8: Logic operator options for filter containers

    Notice how the cards are rearranged to be side-by-side instead of vertically stacked? This is a visual cue so that you know the logic being used for the filter container. See Figure 5-9.

    Quality Filters OR'd

    Figure 5-9: Quality Filters container with OR logic

    Now, switch the logic back to AND.

  8. Now that we are finished with the quality filters, we will collapse the filter container so that it takes up less space in the filter chain. To do this, click on the dash in the upper right corner. This same behavior can be used to collapse filter cards as well. See Figure 5-10.

    Collapse Filter Container

    Figure 5-10: Collapse Quality Filters container to save space


    If the filter container logic was set to OR, instead of a horizontal bar the collapse button would be a vertical line.

At the end of these steps your filter chain should look like this: See Figure 5-11.

Filter Chain after QC Filters

Figure 5-11: Filter chain after collapsing Quality Filters container.