Skip to content

Commit

Permalink
Merge branch 'main' into version_4.60
Browse files Browse the repository at this point in the history
  • Loading branch information
dnil authored Oct 12, 2022
2 parents 96baccc + 188126a commit e6b26f8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
- Mitochondrial deletion signatures (mitosign) can be uploaded and shown with mtDNA report
- A `Type of analysis` column on Causatives and Validated variants pages
- List of "safe" gene panels available for matching causatives and managed variants in institute settings, to avoid secondary findings
- `svdb_origin` as a synonym for `FOUND_IN` to complement `set` for variants found by all callers
### Changed
- Hide removed gene panels by default in panels page
- Removed option for filtering cancer SVs by Tumor and Normal alt AF
Expand Down
2 changes: 1 addition & 1 deletion docs/admin-guide/loading-variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document will describe the process of variant loading, how it is done and w

## Rank Score

In Scout rank score is a central theme. Rank Scores is a estimation on how potentially dangerous a variant is, similar to the CADD score with the intention of work with all types of variation.
In Scout rank score is a central theme. Rank Scores is a estimation on how potentially dangerous a variant is, similar to the CADD score with the intention of work with all types of variation.
The uploading of variants is based on a rank score threshold, this is to avoid to clog the database with millions of variants that we at the moment have a hard time to say anything about.

The rank score is a summary of the annotations of a variant. Rank scores are calculated and annotated by [GENMOD][genmod]
Expand Down
4 changes: 3 additions & 1 deletion docs/user-guide/variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ This is the first a user looks at when assesing the variant.
- CLINSIG number

#### SV frequency - SVDB
Structural variant database freqency is annotated with [SVDB](https://github.com/J35P312/SVDB), using a clustering algorithm [DBSCAN](https://en.wikipedia.org/wiki/DBSCAN). Variant type and chromosome are exact, but start and end positions for matches are approximate, and depend on previous cases from the database. In a region with multiple, inexactly positioned events, matching will be more relaxed than if only tightly clustered variants with near similar start and end coordinates have been found. Databases include research cases from Clinical genetics (WGS at NGI), clinical cases with arrayCGH (benign or pathogenic collections), Decipher, SweGen and local cases.
Structural variant database freqency is annotated with [SVDB](https://github.com/J35P312/SVDB), using a clustering algorithm [DBSCAN](https://en.wikipedia.org/wiki/DBSCAN).
Variant type and chromosome are exact, but start and end positions for matches are approximate, and depend on previous cases from the database. In a region with multiple, inexactly positioned events, matching will be more relaxed than if only tightly clustered variants with near similar start and end coordinates have been found.
Databases include research cases from Clinical genetics (WGS at NGI), clinical cases with arrayCGH (benign or pathogenic collections), Decipher, SweGen and local cases.

## Details

Expand Down
27 changes: 19 additions & 8 deletions scout/parse/variant/callers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
def parse_callers(variant, category="snv"):
"""Parse how the different variant callers have performed
Caller information can be passed in one of three ways, in order of priority:
1. If a FOUND_IN tag (comma separated) is found, callers listed will be marked Pass
2. If a svdb_origin tag (pipe separated) is found, callers listed will be marked Pass
3. If a set tag (dash separated, GATK CombineVariants) is found, callers will be marked Pass or Filtered accordingly
Args:
variant (cyvcf2.Variant): A variant object
Expand All @@ -17,8 +22,19 @@ def parse_callers(variant, category="snv"):
"""
relevant_callers = CALLERS[category]
callers = {caller["id"]: None for caller in relevant_callers}

other_info = variant.INFO.get("FOUND_IN")
svdb_origin = variant.INFO.get("svdb_origin")
raw_info = variant.INFO.get("set")
if raw_info:

if other_info:
for info in other_info.split(","):
called_by = info.split("|")[0]
callers[called_by] = "Pass"
elif svdb_origin:
for called_by in svdb_origin.split("|"):
callers[called_by] = "Pass"
elif raw_info:
info = raw_info.split("-")
for call in info:
if call == "FilteredInAll":
Expand All @@ -33,15 +49,10 @@ def parse_callers(variant, category="snv"):
callers[caller] = "Filtered"
elif call in set(callers.keys()):
callers[call] = "Pass"
# The following is parsing of a custom made merge
other_info = variant.INFO.get("FOUND_IN")
if other_info:
for info in other_info.split(","):
called_by = info.split("|")[0]
callers[called_by] = "Pass"

if raw_info or other_info:
if raw_info or svdb_origin or other_info:
return callers

if category == "snv":
# cyvcf2 FILTER is None if VCF file column FILTER is "PASS"
filter_status = "Pass"
Expand Down
15 changes: 15 additions & 0 deletions tests/parse/test_parse_callers.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ def test_parse_callers_intersection(cyvcf2_variant):
assert callers["samtools"] == "Pass"


def test_parse_callers_intersection_svdb_info(cyvcf2_variant):
variant = cyvcf2_variant
# GIVEN information that all callers agree on Pass
variant.INFO["svdb_origin"] = "gatk|deepvariant"
variant.INFO["set"] = "Intersection"

# WHEN parsing the information
callers = parse_callers(variant)

# THEN the svdb info selected callers should be passed
assert callers["gatk"] == "Pass"
assert callers["deepvariant"] == "Pass"
assert callers["samtools"] is None


def test_parse_callers_filtered_all(cyvcf2_variant):
variant = cyvcf2_variant
# GIVEN information that all callers agree on filtered
Expand Down

0 comments on commit e6b26f8

Please sign in to comment.