Skip to content

Commit

Permalink
fixed bug where the automatic classification did not consider assays …
Browse files Browse the repository at this point in the history
…& fixed no_proxy setting for requests
  • Loading branch information
MarvinDo committed Dec 1, 2024
1 parent 7c5d501 commit bd5ad8c
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,16 @@ def get_autoclass_json(self, variant_id, conn: Connection) -> str:

splicing_assays = assays_dict.get("splicing")

#print(splicing_assays)

all_splicing_assays = []
if splicing_assays is not None:
for assay in all_splicing_assays:
for assay in splicing_assays:
if assay.metadata.get("minigene") is None or assay.metadata.get("patient_rna") is None or assay.metadata.get("allele_specific") is None: # skip legacy assays
continue
minigene = assay.metadata.get("minigene", "") == "True"
patient_rna = assay.metadata.get("patient_rna", "") == "True"
allelic = assay.metadata.get("allele_specific", "False")
minigene = assay.get_metadata_value("minigene", "False") == "True"
patient_rna = assay.get_metadata_value("patient_rna", "False") == "True"
allelic = assay.get_metadata_value("allele_specific", "False")
quantification = functions.percent_to_decimal(assay.metadata.get("minimal_percentage", None))
all_splicing_assays.append({"minigene": minigene,
"patient_rna": patient_rna,
Expand All @@ -339,8 +341,8 @@ def get_autoclass_json(self, variant_id, conn: Connection) -> str:
for assay in functional_assays:
if assay.metadata.get("functional_category") is None or assay.metadata.get("functional_category") is None: # skip legacy assays
continue
is_pathogenic = assay.metadata.get("functional_category", "") == "pathogenic"
is_benign = assay.metadata.get("functional_category", "") == "benign"
is_pathogenic = assay.get_metadata_value("functional_category", "") == "pathogenic"
is_benign = assay.get_metadata_value("functional_category", "") == "benign"
all_functional_assays.append({"pathogenic": is_pathogenic,
"benign": is_benign})
result["functional_data"] = all_functional_assays
Expand Down Expand Up @@ -391,8 +393,7 @@ def get_autoclass_json(self, variant_id, conn: Connection) -> str:

result_json = json.dumps(result)

with open("/var/www/html/heredivar-demo/logs/herediclassify_jsons/test.json", "w") as f:
f.write(result_json)
#print(result_json)

return result_json

Expand Down
46 changes: 23 additions & 23 deletions src/annotation_service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,40 @@
def get_default_job_config():
job_config = {
# heredicare annotations
'do_heredicare': True,
'do_heredicare': False,

# external programs
'do_phylop': True,
'do_spliceai': True,
'do_hexplorer': True,
'do_maxentscan': True,
'do_phylop': False,
'do_spliceai': False,
'do_hexplorer': False,
'do_maxentscan': False,

# consequences
'do_consequence': True,
'do_vep': True,
'do_consequence': False,
'do_vep': False,

#vcf annotate from vcf
'do_dbsnp': True,
'do_revel': True,
'do_cadd': True,
'do_clinvar': True,
'do_gnomad': True,
'do_brca_exchange': True,
'do_flossies': True,
'do_dbsnp': False,
'do_revel': False,
'do_cadd': False,
'do_clinvar': False,
'do_gnomad': False,
'do_brca_exchange': False,
'do_flossies': False,

'do_tp53_database': True,
'do_priors': True,
'do_bayesdel': True,
'do_cosmic': True,
'do_tp53_database': False,
'do_priors': False,
'do_bayesdel': False,
'do_cosmic': False,

# assays
'do_cspec_brca_assays': True,
'do_cspec_brca_assays': False,

# additional annotations
'do_cancerhotspots': True,
'do_taskforce_domains': True,
'do_coldspots': True,
'do_litvar': True,
'do_cancerhotspots': False,
'do_taskforce_domains': False,
'do_coldspots': False,
'do_litvar': False,
'do_auto_class': True

# outdated
Expand Down
5 changes: 5 additions & 0 deletions src/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,11 @@ class Assay:

metadata: Any # dict of Assay Metadata

def get_metadata_value(self, metadata_type, default):
if metadata_type in self.metadata:
return self.metadata.get(metadata_type).value
return default

def get_header(self):
## Separator-symbol-hierarchy: ; -> & -> | -> $ -> +
header = {'assays': '##INFO=<ID=assays,Number=.,Type=String,Description="All types of assays (e. g. functional or splicing) which were submitted to HerediVar. Assays are separated by "&" symbols. Format:assay_type|date|link|metadata. Metadata itself is a $ separated list of key+value pairs.">\n'}
Expand Down
1 change: 1 addition & 0 deletions src/frontend_celery/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Config(object):

HOST = os.environ.get('HOST')
PORT = os.environ.get('PORT')
os.environ["no_proxy"] = os.environ.get("NO_PROXY", "")

LOGIN_REQUIRED = os.environ.get('LOGIN_REQUIRED', "True").lower() in ["true"]

Expand Down
1 change: 1 addition & 0 deletions src/frontend_celery/start_celery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export WEBAPP_ENV=$we
vep_install_dir=$ROOT/tools/ensembl-vep-release-107.0
cpan_dir=$vep_install_dir/cpan
export PERL5LIB=$vep_install_dir/Bio/:$cpan_dir/lib/perl5/:$PERL5LIB
export no_proxy=$NO_PROXY


if [ -z "${WEBAPP_ENV}" ]
Expand Down
2 changes: 1 addition & 1 deletion src/frontend_celery/start_herediclass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ set -o allexport
extension=env_
source $ROOT/.$extension$WEBAPP_ENV
set +o allexport

export no_proxy=$NO_PROXY

autoclass_path=$ROOT/tools/herediclass
cd $autoclass_path
Expand Down
2 changes: 1 addition & 1 deletion src/frontend_celery/start_keycloak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ set -o allexport
extension=env_
source $ROOT/.$extension$WEBAPP_ENV
set +o allexport

export no_proxy=$NO_PROXY


if [ "${WEBAPP_ENV}" == "dev" ]
Expand Down
1 change: 1 addition & 0 deletions src/frontend_celery/start_redis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ set -o allexport
extension=env_
source $ROOT/.$extension$WEBAPP_ENV
set +o allexport
export no_proxy=$NO_PROXY

cd tools/redis-stable
src/redis-server --port $REDIS_PORT
1 change: 1 addition & 0 deletions src/frontend_celery/start_webapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ then
extension=env_
source $ROOT/.$extension$WEBAPP_ENV
set +o allexport
export no_proxy=$NO_PROXY

logsdir=$ROOT/logs
mkdir -p $logsdir/gunicorn-access-logs
Expand Down
8 changes: 8 additions & 0 deletions src/frontend_celery/webapp/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ <h4>Overview</h4>
<div class="bst bsb">
<h4>Changelog</h4>

<div class="underline">v 1.14.5 ()</div>
<div>
Bugfixes:
<ul>
<li>Fixed a bug where assay annotations would not be considered for automatic classification</li>
</ul>
</div>

<div class="underline">v 1.14.4 (03.11.2024)</div>
<div>
General changes:
Expand Down

0 comments on commit bd5ad8c

Please sign in to comment.