Filtering Roadmap
Filtering in the GUI
Samples
You can remove variants associated with a set of sample IDs by unselecting them in the checkboxes here.
+For example, we can filter for
Genes
-Gene-level filtering can be done here. You can dinput a list of genes, separated by line-breaks
+Gene-level filtering can be done here. You can input a list of genes, separated by line-breaks
+Sample Properties
Variant Properties
+In variant properties, you can filter by variant type based on your annotations. For example, let’s filter to missense variants.
+Under Variant Filter:
+-
+
- Click on “Query Builder”. +
- Mouse into the left bottom corner of the query builder window, and click the “+” sign. +
Make your filter by selecting the following dropdown boxes:
+-
+
- Variant Annotation +
- Sequence Ontology +
- One of +
- Missense checkbox +
Finally, click the “Apply Filter” Button:
+ +You will be left with 299 variants. Here’s a visual summary of what we did:
+Boolean Operations
You can build more sophisticated operations by combining each filter step using Boolean logic.
-For example, we might want variants that …
+AND logic
+By default, the filters are combined using AND logic, which are more restrictive, because they require variants to meet both filters.
+Here’s an example of using AND logic. Here we are combining two filters: Missense Variants (from Variant Annotation –> Sequence Ontology) and Pathogenic variants (from ClinVar –> Clinical Significance).
+When we apply the filter, we get 9 variants that meet both criteria. Here’s a visual summary of the filtering:
+OR Logic
+These filters can also be combined using OR logic, which is more permissive (that is, these filters will return a greater number than the AND logic) we might want variants that are either missense OR pathogenic.
+We can do this by clicking the “and” that links our two filters, which will switch it to an “or”:
+When we apply the filter, we get 300 variants. The breakdown is below.
+Combining AND / OR logic
+By default, when you click the “and” / “or” of one set of filters, all filters will be changed. If you want to combine AND / OR logic, you can group one of the logic operations using parentheses.
+For example, say we want the above OR subset combined as an AND with those variants that have PS1 evidence. We can
+This is what our final filter looks like:
+Here’s a visual breakdown of this complex filter:
+NOT Logic
+Deleting a Filter
+Case Study: Filtering Pathogenic Variants
+Exporting Filters as JSON
+Filters can be exported and saved as JSON files for further reuse. They can be applied to a new set of variants in the GUI, or can be applied to result SQLite files on the command line.
Exporting Filters
+Applying JSON filters in the GUI
Applying filters on the command line
+Applying JSON filters on the command line
+JSON filters can also be applied on the command-line using the oc util filtersqlite
command. More information is here.
Making an Annotator Module
Annotator Basic Structure
+Annotator Overview
+Creating an annotator module requires the following:
-
-
- Creating an new annotator skeleton using
oc new annotator <modulename>
+ - Initializing an new annotator skeleton using
oc new annotator <modulename>
- Loading an annotator file into a SQLite database (
<modulename>.sqlite
ss) usingsqlite3
- Mapping the annotator sqlite file in the
<modulename>.py
file - Customizing the output using the
<modulename>.yml
file
This is a quick review of the basic structure of an annotator module.
Annotator Basic
This is a quick review of the basic structure of an annotator module.
/Users/Shared/open-cravat/modules/annotators/sift
├── data
│ └── sift.sqlite ## contains annotations in sqlite format
@@ -292,8 +312,8 @@ Creating our Table
Fill out sift.py
+Mapping our annotator file
Now that our data is loaded into our .sqlite
file, we need to set up our mapping. If we look in sift.py
, we’ll see there are stubs for three methods: setup()
, annotate()
, and cleanup()
: