Skip to content

Commit

Permalink
Make gene panel manual inheritance models more clear (#3046)
Browse files Browse the repository at this point in the history
* Made some improvements but custom models stringfield is still displaying an empoty array

* modify field name

* update changelog

* Rename the gene panels inheritance models in constants

* rename the 2 cols

* fix genetic models parsing in panels
  • Loading branch information
northwestwitch committed Dec 10, 2021
1 parent cdc3cef commit cb6c1a4
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
### Added
### Changed
- Start Scout also when loqusdbapi is not reachable
- Clearer definition of manual standard and custom inheritance models in gene panels
### Fixed
- Gene panel crashing on edit action

Expand Down
2 changes: 1 addition & 1 deletion scout/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from .file_types import FILE_TYPE_MAP
from .filters import CLINICAL_FILTER_BASE, CLINICAL_FILTER_BASE_CANCER, CLINICAL_FILTER_BASE_SV
from .gene_tags import (
GENE_CUSTOM_INHERITANCE_MODELS,
GENE_PANELS_INHERITANCE_MODELS,
INCOMPLETE_PENETRANCE_MAP,
MODELS_MAP,
PANEL_GENE_INFO_MODELS,
Expand Down
22 changes: 11 additions & 11 deletions scout/constants/gene_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# which are specified by GENETIC_MODELS (in variant_tags.py).
# The following models are used while describing inheritance of genes in gene panels
# It's a custom-compiled list of values
GENE_CUSTOM_INHERITANCE_MODELS = (
("AD", "Autosomal Dominant"),
("AR", "Autosomal recessive"),
("XL", "X Linked"),
("XD", "X Linked Dominant"),
("XR", "X Linked Recessive"),
("NA", "not available"),
("AD (imprinting)", "Autosomal Dominant (imprinting)"),
("digenic", "Digenic"),
("AEI", "Allelic expression imbalance"),
("other", "Other"),
GENE_PANELS_INHERITANCE_MODELS = (
("AD", "AD - Autosomal Dominant"),
("AR", "AR - Autosomal recessive"),
("XL", "XL - X Linked"),
("XD", "XD - X Linked Dominant"),
("XR", "XR - X Linked Recessive"),
("NA", "NA - not available"),
("AD (imprinting)", "AD (imprinting) - Autosomal Dominant (imprinting)"),
("digenic", "digenic - Digenic"),
("AEI", "AEI - Allelic expression imbalance"),
("other", "other - Other"),
)

VALID_MODELS = ("AR", "AD", "MT", "XD", "XR", "X", "Y")
Expand Down
2 changes: 1 addition & 1 deletion scout/parse/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def parse_gene(gene_info):

# Collect whichever model provided by the user.
# Then populate inheritance_models and custom_inheritance_models on gene build step
gene["inheritance_models"] = [model.strip() for model in models.split(",")]
gene["inheritance_models"] = [model.strip() for model in models.split(",") if model != ""]

# If a gene is known to be associated with mosaicism this is annotated
gene["mosaicism"] = bool(gene_info.get("mosaicism"))
Expand Down
7 changes: 4 additions & 3 deletions scout/server/blueprints/panels/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
from flask_wtf import FlaskForm
from wtforms import BooleanField, SelectMultipleField, StringField

from scout.constants import GENE_CUSTOM_INHERITANCE_MODELS
from scout.constants import GENE_PANELS_INHERITANCE_MODELS


class PanelGeneForm(FlaskForm):
disease_associated_transcripts = SelectMultipleField("Disease transcripts", choices=[])
reduced_penetrance = BooleanField()
mosaicism = BooleanField()
database_entry_version = StringField()

inheritance_models = SelectMultipleField(
"Standard inheritance models", choices=GENE_CUSTOM_INHERITANCE_MODELS
"Manual inheritance (pre-set terms)", choices=GENE_PANELS_INHERITANCE_MODELS
)
custom_inheritance_models = StringField(
"Other non-standard inheritance models (free text, comma separated)"
"Manual inheritance (free text terms)",
)
comment = StringField()
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
<div class="row">
<div class="col-md-4">
{{ form.inheritance_models.label(class="control-label") }}<br>
{{ form.inheritance_models(class="selectpicker") }}
{{ form.inheritance_models(class="selectpicker", data_width="100%") }}
</div>
<div class="col-md-4">
{{ form.custom_inheritance_models.label(class="control-label") }}
{{ form.custom_inheritance_models(class="form-control") }}
{{ form.custom_inheritance_models(class="form-control", placeholder="free text, comma separated") }}
</div>
<div class="col-md-4">
<div class="col-md-2">
{{ form.database_entry_version.label(class="control-label") }}
(ex: 1.2)
{{ form.database_entry_version(class="form-control") }}
Expand Down
4 changes: 2 additions & 2 deletions scout/server/blueprints/panels/templates/panels/panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
<th>Reduced penetrance</th>
<th>Mosaicism</th>
<th>Entry version</th>
<th>Standard inheritance models</th>
<th>Custom inheritance models</th>
<th>Manual inheritance (pre-set terms)</th>
<th>Manual inheritance (free text terms)</th>
<th>Comment</th>
<th>Action</th>
</tr>
Expand Down
12 changes: 7 additions & 5 deletions scout/server/blueprints/panels/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ def tx_choices(hgnc_id, panel_obj):
@templated("panels/gene-edit.html")
def gene_edit(panel_id, hgnc_id):
"""Edit additional information about a panel gene."""

panel_obj = store.panel(panel_id)
hgnc_gene = store.hgnc_gene(hgnc_identifier=hgnc_id, build="37") or store.hgnc_gene(
hgnc_identifier=hgnc_id, build="38"
Expand All @@ -254,14 +253,17 @@ def gene_edit(panel_id, hgnc_id):
info_data["custom_inheritance_models"] = info_data["custom_inheritance_models"].split(
","
)

store.add_pending(panel_obj, hgnc_gene, action=action, info=info_data)
return redirect(url_for(".panel", panel_id=panel_id))

if panel_gene:
form.custom_inheritance_models.data = ", ".join(
panel_gene.get("custom_inheritance_models", [])
)
custom_models = [
model for model in panel_gene.get("custom_inheritance_models", []) if model != ""
]
if custom_models:
form.custom_inheritance_models.data = ", ".join(
panel_gene.get("custom_inheritance_models")
)
for field_key in [
"disease_associated_transcripts",
"reduced_penetrance",
Expand Down

0 comments on commit cb6c1a4

Please sign in to comment.