From 0c74b72b75611b9d24adeae1397e9c49d66dc6f3 Mon Sep 17 00:00:00 2001 From: bharath Date: Fri, 11 Aug 2023 11:03:06 +1000 Subject: [PATCH 1/2] #3481_updated codeQL to use conda env and updated env folder structure. --- .github/workflows/codeql-analysis.yml | 19 +- .gitignore | 18 +- config/settings_config.json | 6 + variantgrid/settings/__init__.py | 19 +- variantgrid/settings/env/dmlccbwest.py | 174 --------- variantgrid/settings/env/dmlhpdesktop.py | 173 --------- variantgrid/settings/env/dmlxps159560.py | 162 -------- variantgrid/settings/env/fromerdp350.py | 166 -------- variantgrid/settings/env/jamessmacbookpro2.py | 1 - variantgrid/settings/env/jamessmbp2.py | 358 ------------------ variantgrid/settings/env/runx1db2.py | 91 ----- 11 files changed, 53 insertions(+), 1134 deletions(-) delete mode 100644 variantgrid/settings/env/dmlccbwest.py delete mode 100644 variantgrid/settings/env/dmlhpdesktop.py delete mode 100644 variantgrid/settings/env/dmlxps159560.py delete mode 100644 variantgrid/settings/env/fromerdp350.py delete mode 100644 variantgrid/settings/env/jamessmacbookpro2.py delete mode 100644 variantgrid/settings/env/jamessmbp2.py delete mode 100644 variantgrid/settings/env/runx1db2.py diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 02e5d2db2..f069f8669 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -18,6 +18,9 @@ jobs: analyze: name: Analyze runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} strategy: fail-fast: false @@ -41,8 +44,7 @@ jobs: # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main - languages: python - setup-python-dependencies: false + languages: python # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) @@ -62,3 +64,16 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 + + # Initializes the CodeQL tools for scanning. + - name: Set up Conda + uses: conda-incubator/setup-miniconda@v2 + with: + channel: conda-forge, bioconda, anaconda, defaults + auto-activate-base: false + auto-update-conda: true + miniconda-version: "latest" + environment-file: environment.yml + + - name: Conda info + run: conda info diff --git a/.gitignore b/.gitignore index b15178a17..6b70fbbd9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,9 +3,11 @@ vcf_reader *~ data/* -media_root/* /.settings/ +### Django ### __pycache__/ +media_root/* + LabNameLocations.csv /jshintrc dump.rdb @@ -19,3 +21,17 @@ lint.txt **/.sass-cache/ /source_id_migration.log csv-editor.xml + +#ignore developers env settings +/variantgrid/settings/env_developers/ + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +.coverage +.coverage.* +.cache +.pytest_cache/ +cover/ \ No newline at end of file diff --git a/config/settings_config.json b/config/settings_config.json index 80dba3190..3013be7ce 100644 --- a/config/settings_config.json +++ b/config/settings_config.json @@ -50,6 +50,12 @@ "host": "https://variantgrid.com", "oauth_url": "", "client_id": "variantgrid-remote-client" + }, + "AWS": { + "S3": { + "access_key_id": null, + "secret_access_key": null + } } } } diff --git a/variantgrid/settings/__init__.py b/variantgrid/settings/__init__.py index df15f6f0a..e6900b6d7 100644 --- a/variantgrid/settings/__init__.py +++ b/variantgrid/settings/__init__.py @@ -28,13 +28,20 @@ flattened_hostname = "s" + flattened_hostname pwd = os.path.dirname(__file__) - flattened_hostname_path = os.path.join(pwd, 'env', f"{flattened_hostname}.py") - - logging.info('LOADING settings file %s', flattened_hostname_path) - if os.path.exists(flattened_hostname_path): - flattened_hostname_module = f"variantgrid.settings.env.{flattened_hostname}" + # Search for the environment file in the 'env_developers' folder first + flattened_hostname_path_override = os.path.join(pwd, 'env_developers', f"{flattened_hostname}.py") + if os.path.exists(flattened_hostname_path_override): + flattened_hostname_module = f"variantgrid.settings.env_developers.{flattened_hostname}" exec(f"from {flattened_hostname_module} import *") else: - logging.error("Settings file doesn't exist %s", flattened_hostname_path) + # If not found, use the environment file from the original 'env' + flattened_hostname_path = os.path.join(pwd, 'env', f"{flattened_hostname}.py") + + logging.info('LOADING settings file %s', flattened_hostname_path) + if os.path.exists(flattened_hostname_path): + flattened_hostname_module = f"variantgrid.settings.env.{flattened_hostname}" + exec(f"from {flattened_hostname_module} import *") + else: + logging.error("Settings file doesn't exist %s", flattened_hostname_path) else: exec(f"from {django_settings_module} import *") diff --git a/variantgrid/settings/env/dmlccbwest.py b/variantgrid/settings/env/dmlccbwest.py deleted file mode 100644 index 0361fabf0..000000000 --- a/variantgrid/settings/env/dmlccbwest.py +++ /dev/null @@ -1,174 +0,0 @@ -# so we don't pull in 'variantgrid.py' in this dir with Python 2.7.2 - -from variantgrid.settings.components.celery_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.default_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.seqauto_settings import * # pylint: disable=wildcard-import, unused-wildcard-import - - -# import all the base settings # -ROLLBAR['enabled'] = False - -USE_DJANGO_DEBUG_TOOLBAR = False -if USE_DJANGO_DEBUG_TOOLBAR: - INSTALLED_APPS += ['debug_toolbar'] - MIDDLEWARE = MIDDLEWARE + ('debug_toolbar.middleware.DebugToolbarMiddleware',) - INTERNAL_IPS = [ - '127.0.0.1', - ] - -#SEQAUTO_LOAD_GENE_COVERAGE=False - -SEQAUTO_CONTROL_SAMPLE_REGEX = NO_DNA_CONTROL_REGEX -VCF_IMPORT_NO_DNA_CONTROL_SAMPLE_REGEX = NO_DNA_CONTROL_REGEX - -ANNOTATION_VEP_PERLBREW_RUNNER_SCRIPT = os.path.join(BASE_DIR, "scripts", "perlbrew_runner.sh") -ANNOTATION_REFERENCE_BASE_DIR = "/data/annotation" -ANNOTATION_VEP_BASE_DIR = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "VEP") -ANNOTATION_VEP_CODE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "ensembl-vep") -ANNOTATION_VEP_CACHE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "vep_cache") -_ANNOTATION_FASTA_BASE_DIR = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "fasta") - -ANNOTATION_ENTREZ_EMAIL = 'davmlaw@gmail.com' - -ANNOTATION[BUILD_GRCH37].update({ - "annotation_consortium": "RefSeq", - "columns_version": 2, - "reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "GCF_000001405.25_GRCh37.p13_genomic.fna.gz") -}) -ANNOTATION[BUILD_GRCH38].update({ - "annotation_consortium": "RefSeq", - "columns_version": 2, - "enabled": True, - "reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "GCF_000001405.39_GRCh38.p13_genomic.fna.gz") -}) - - -ANNOTATION[BUILD_GRCH37]["vep_config"].update({ - "dbnsfp": "annotation_data/GRCh37/dbNSFP4.3a.grch37.stripped.gz", -}) -ANNOTATION[BUILD_GRCH38]["vep_config"].update({ - "dbnsfp": "annotation_data/GRCh38/dbNSFP4.3a.grch38.stripped.gz", -}) - - -COMPANY = "SA_Pathology" # Used for gene lists - -SEQAUTO_SAMPLE_SHEET_EXTRA_COLUMNS = ["SAPOrderNumber", "Sex", "Panel", "R1kDVersion", "RunID", "CaptureID", "RunReference"] - -_SA_PATH_ENRICHMENT_KITS = [{"name": "roche_1k_disease", "version": 6}, {"name": "medical_exomes"}] -SEQAUTO_COVERAGE_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -GENES_DEFAULT_CANONICAL_TRANSCRIPT_COLLECTION_ID = 1 -GENE_GRID_DEFAULT_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -# Fields must be from GoldCoverageSummary and COLUMNS + LABELS must line up! -GENE_GRID_ENRICHMENT_KIT_COLUMNS = ['depth_20x_5th_percentile'] -GENE_GRID_ENRICHMENT_KIT_COLUMN_TOOL_TIPS = ["original_transcript"] -GENE_GRID_ENRICHMENT_KIT_COLUMN_LABELS = ["% at 20x*"] -GENE_GRID_ENRICHMENT_KIT_COLUMN_LABEL_TOOL_TIPS = ["% at 20x for 5th percentile of gold runs (ie expected worst case)"] -GENE_GRID_FAKE_GOLD_COVERAGE = True - -PATHOLOGY_TEST_SORTED_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -# GENES_DEFAULT_CANONICAL_TRANSCRIPT_COLLECTION_ID = 4 - -LIFTOVER_NCBI_REMAP_ENABLED = True -LIFTOVER_NCBI_REMAP_PERLBREW_RUNNER_SCRIPT = os.path.join(BASE_DIR, "scripts", "perlbrew_runner.sh") - -SOMALIER["enabled"] = True -SOMALIER["annotation_base_dir"] = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "somalier") - -PEDIGREE_MADELINE2_COMMAND = "madeline2" - -#CLINGEN_ALLELE_REGISTRY_DOMAIN = "http://reg.test.genome.network" - -#DEBUG = False -COMPRESS_ENABLED = False - -_SHARIANT_MODE = False -_SAPATHOLOGY_MODE = True -_RUNX1_MODE = False - - -VIEW_GENE_HOTSPOT_GRAPH_CLASSIFICATIONS = True -VIEW_GENE_HOTSPOT_GRAPH = True - -if _SHARIANT_MODE: - SHARIANT_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "shariant_static") - STATICFILES_DIRS = (SHARIANT_STATIC_FILES_DIR,) + STATICFILES_DIRS - - DISCORDANCE_ENABLED = True - SHARIANT_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/shariant_templates") - TEMPLATES[0]["DIRS"].insert(0, SHARIANT_TEMPLATES_DIR) - SITE_NAME = "Shariant" - VARIANT_CLASSIFICATION_WEB_FORM_CREATE_BY_NON_ADMIN = False - VARIANT_MANUAL_CREATE_BY_NON_ADMIN = False - - SEARCH_VARIANT_REQUIRE_CLASSIFICATION_FOR_NON_ADMIN = True - - # Don't show annotation or samples on variant page - don't want to be responsible for it - VARIANT_DETAILS_SHOW_ANNOTATION = False - VARIANT_DETAILS_SHOW_SAMPLES = False - VARIANT_SHOW_CANONICAL_HGVS = False - VIEW_GENE_WIKI = False - - URLS_APP_REGISTER.update({"analysis": False, - "expression": False, - "pathtests": False, - "pedigree": False, - "seqauto": False}) - - URLS_NAME_REGISTER.update({"classification_dashboard": True, - "classification_import_tool": True}) - -elif _SAPATHOLOGY_MODE: - SEQAUTO_ENABLED = True - SAPATH_APP = 'sapath.apps.SapathConfig' - INSTALLED_APPS += [SAPATH_APP] - - PATHOLOGY_TEST_EXTERNAL_CODE = "SAPOrderNumber" - SAPATHOLOGY_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "sapathology_static") - if os.path.exists(SAPATHOLOGY_STATIC_FILES_DIR): - STATICFILES_DIRS = (SAPATHOLOGY_STATIC_FILES_DIR,) + STATICFILES_DIRS - - SAPATHOLOGY_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/sapathology_templates") - if os.path.exists(SAPATHOLOGY_TEMPLATES_DIR): - TEMPLATES[0]["DIRS"].insert(0, SAPATHOLOGY_TEMPLATES_DIR) - - HGVS_MAX_REF_ALLELE_LENGTH = 0 # Set to 0 for "del" instead of "delC" etc - - INITIAL_USER_DATA_PREFIX_KWARGS = {"prefix": '/tau', - "replacement": '\\\\frgeneseq01.imvs.sa.gov.au\\tau'} - - SAPATH_HELIX_USER = get_secret("SAPATH.HELIX.user") - SAPATH_HELIX_PASSWORD = get_secret("SAPATH.HELIX.password") - SAPATH_HELIX_GENERATE_CSV_FROM_SQL = False - - PATHOLOGY_TESTS_ENABLED = True - PATHOLOGY_TEST_REQUESTS_REDIRECT_URL = "sapathology_test_requests" - - PATHOLOGY_TEST_EXTERNAL_CODE = "SAPOrderNumber" - PATHOLOGY_TEST_CASE_EXTERNAL_CODE = "HelixID" - -elif _RUNX1_MODE: - - ANALYSIS_TEMPLATES_RUNX1 = True - - RUNX1_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "runx1_static") - STATICFILES_DIRS = (RUNX1_STATIC_FILES_DIR,) + STATICFILES_DIRS - - RUNX1_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/runx1_templates") - TEMPLATES[0]["DIRS"].insert(0, RUNX1_TEMPLATES_DIR) - - PATIENTS_READ_ONLY_SHOW_AGE_NOT_DOB = True - PUBLIC_SAMPLE_GENE_MATRIX_GENOME_BUILD = "GRCh37" - PUBLIC_SAMPLE_GENE_MATRIX_GENE_LIST_ID = 19 - PUBLIC_SAMPLE_GENE_MATRIX_SHOW_PRIVATE_SAMPLES = True - PUBLIC_SAMPLE_GENE_MATRIX_TYPE = 'RUNX1_classified_damage' - PUBLIC_SAMPLE_GENE_MATRIX_HIGHLIGHT_GENE_SYMBOLS = ["RUNX1"] - - LOGIN_REDIRECT_URL = '/snpdb/index' - COHORT_SAMPLE_GENE_DAMAGE_COUNTS = 'annotation.tasks.cohort_sample_gene_damage_counts.CalculateCohortSampleGeneDamageCountsTask' - print(f"before: FINISH_IMPORT_VCF_STEP_TASKS_CLASSES: {FINISH_IMPORT_VCF_STEP_TASKS_CLASSES}") - FINISH_IMPORT_VCF_STEP_TASKS_CLASSES = [COHORT_SAMPLE_GENE_DAMAGE_COUNTS] - SITE_NAME = "RUNX1db" - - PATIENTS_READ_ONLY_SHOW_AGE_NOT_DOB = True - VCF_DOWNLOAD_ADMIN_ONLY = True diff --git a/variantgrid/settings/env/dmlhpdesktop.py b/variantgrid/settings/env/dmlhpdesktop.py deleted file mode 100644 index 8288d4ad9..000000000 --- a/variantgrid/settings/env/dmlhpdesktop.py +++ /dev/null @@ -1,173 +0,0 @@ -# so we don't pull in 'variantgrid.py' in this dir with Python 2.7.2 - -from variantgrid.settings.components.celery_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.default_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.seqauto_settings import * # pylint: disable=wildcard-import, unused-wildcard-import - - -# import all the base settings # -ROLLBAR['enabled'] = False - -USE_DJANGO_DEBUG_TOOLBAR = False -if USE_DJANGO_DEBUG_TOOLBAR: - INSTALLED_APPS += ['debug_toolbar'] - MIDDLEWARE = MIDDLEWARE + ('debug_toolbar.middleware.DebugToolbarMiddleware',) - INTERNAL_IPS = [ - '127.0.0.1', - ] - -#SEQAUTO_LOAD_GENE_COVERAGE=False - -SEQAUTO_CONTROL_SAMPLE_REGEX = NO_DNA_CONTROL_REGEX -VCF_IMPORT_NO_DNA_CONTROL_SAMPLE_REGEX = NO_DNA_CONTROL_REGEX - -ANNOTATION_VEP_PERLBREW_RUNNER_SCRIPT = os.path.join(BASE_DIR, "scripts", "perlbrew_runner.sh") -ANNOTATION_REFERENCE_BASE_DIR = "/media/dlawrence/SpinningIron/reference" -ANNOTATION_VEP_BASE_DIR = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "VEP") -ANNOTATION_VEP_CODE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "ensembl-vep") -ANNOTATION_VEP_CACHE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "vep_cache") -_ANNOTATION_FASTA_BASE_DIR = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "fasta") - -ANNOTATION_ENTREZ_EMAIL = 'davmlaw@gmail.com' - -ANNOTATION[BUILD_GRCH37].update({ - "annotation_consortium": "RefSeq", - "columns_version": 2, - "reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "GCF_000001405.25_GRCh37.p13_genomic.fna.gz") -}) -ANNOTATION[BUILD_GRCH38].update({ - "annotation_consortium": "RefSeq", - "columns_version": 2, - "enabled": True, - "reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "GCF_000001405.39_GRCh38.p13_genomic.fna.gz") -}) - - -ANNOTATION[BUILD_GRCH37]["vep_config"].update({ - "dbnsfp": "annotation_data/GRCh37/dbNSFP4.3a.grch37.stripped.gz", -}) -ANNOTATION[BUILD_GRCH38]["vep_config"].update({ - "dbnsfp": "annotation_data/GRCh38/dbNSFP4.3a.grch38.stripped.gz", -}) - - -COMPANY = "SA_Pathology" # Used for gene lists - -SEQAUTO_SAMPLE_SHEET_EXTRA_COLUMNS = ["SAPOrderNumber", "Sex", "Panel", "R1kDVersion", "RunID", "CaptureID", "RunReference"] - -_SA_PATH_ENRICHMENT_KITS = [{"name": "roche_1k_disease", "version": 6}, {"name": "medical_exomes"}] -SEQAUTO_COVERAGE_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -GENE_GRID_DEFAULT_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -# Fields must be from GoldCoverageSummary and COLUMNS + LABELS must line up! -GENE_GRID_ENRICHMENT_KIT_COLUMNS = ['depth_20x_5th_percentile'] -GENE_GRID_ENRICHMENT_KIT_COLUMN_TOOL_TIPS = ["original_transcript"] -GENE_GRID_ENRICHMENT_KIT_COLUMN_LABELS = ["% at 20x*"] -GENE_GRID_ENRICHMENT_KIT_COLUMN_LABEL_TOOL_TIPS = ["% at 20x for 5th percentile of gold runs (ie expected worst case)"] -GENE_GRID_FAKE_GOLD_COVERAGE = True - -PATHOLOGY_TEST_SORTED_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -GENES_DEFAULT_CANONICAL_TRANSCRIPT_COLLECTION_ID = 4 - -LIFTOVER_NCBI_REMAP_ENABLED = True -LIFTOVER_NCBI_REMAP_PERLBREW_RUNNER_SCRIPT = os.path.join(BASE_DIR, "scripts", "perlbrew_runner.sh") - -SOMALIER["enabled"] = True -SOMALIER["annotation_base_dir"] = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "somalier") - -PEDIGREE_MADELINE2_COMMAND = "madeline2" - -#CLINGEN_ALLELE_REGISTRY_DOMAIN = "http://reg.test.genome.network" - -#DEBUG = False -COMPRESS_ENABLED = False - -_SHARIANT_MODE = False -_SAPATHOLOGY_MODE = True -_RUNX1_MODE = False - - -VIEW_GENE_HOTSPOT_GRAPH_CLASSIFICATIONS = True - -if _SHARIANT_MODE: - SHARIANT_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "shariant_static") - STATICFILES_DIRS = (SHARIANT_STATIC_FILES_DIR,) + STATICFILES_DIRS - - DISCORDANCE_ENABLED = True - SHARIANT_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/shariant_templates") - TEMPLATES[0]["DIRS"].insert(0, SHARIANT_TEMPLATES_DIR) - SITE_NAME = "Shariant" - VARIANT_CLASSIFICATION_WEB_FORM_CREATE_BY_NON_ADMIN = False - VARIANT_MANUAL_CREATE_BY_NON_ADMIN = False - - SEARCH_VARIANT_REQUIRE_CLASSIFICATION_FOR_NON_ADMIN = True - - # Don't show annotation or samples on variant page - don't want to be responsible for it - VARIANT_DETAILS_SHOW_ANNOTATION = False - VARIANT_DETAILS_SHOW_SAMPLES = False - VARIANT_SHOW_CANONICAL_HGVS = False - VIEW_GENE_WIKI = False - VIEW_GENE_HOTSPOT_GRAPH_CLASSIFICATIONS = True - - URLS_APP_REGISTER.update({"analysis": False, - "expression": False, - "pathtests": False, - "pedigree": False, - "seqauto": False}) - - URLS_NAME_REGISTER.update({"classification_dashboard": True, - "classification_import_tool": True}) - -elif _SAPATHOLOGY_MODE: - SEQAUTO_ENABLED = True - SAPATH_APP = 'sapath.apps.SapathConfig' - INSTALLED_APPS += [SAPATH_APP] - - PATHOLOGY_TEST_EXTERNAL_CODE = "SAPOrderNumber" - SAPATHOLOGY_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "sapathology_static") - if os.path.exists(SAPATHOLOGY_STATIC_FILES_DIR): - STATICFILES_DIRS = (SAPATHOLOGY_STATIC_FILES_DIR,) + STATICFILES_DIRS - - SAPATHOLOGY_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/sapathology_templates") - if os.path.exists(SAPATHOLOGY_TEMPLATES_DIR): - TEMPLATES[0]["DIRS"].insert(0, SAPATHOLOGY_TEMPLATES_DIR) - - HGVS_MAX_REF_ALLELE_LENGTH = 0 # Set to 0 for "del" instead of "delC" etc - - INITIAL_USER_DATA_PREFIX_KWARGS = {"prefix": '/tau', - "replacement": '\\\\frgeneseq01.imvs.sa.gov.au\\tau'} - - SAPATH_HELIX_USER = get_secret("SAPATH.HELIX.user") - SAPATH_HELIX_PASSWORD = get_secret("SAPATH.HELIX.password") - SAPATH_HELIX_GENERATE_CSV_FROM_SQL = False - - PATHOLOGY_TESTS_ENABLED = True - PATHOLOGY_TEST_REQUESTS_REDIRECT_URL = "sapathology_test_requests" - - PATHOLOGY_TEST_EXTERNAL_CODE = "SAPOrderNumber" - PATHOLOGY_TEST_CASE_EXTERNAL_CODE = "HelixID" - -elif _RUNX1_MODE: - - ANALYSIS_TEMPLATES_RUNX1 = True - - RUNX1_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "runx1_static") - STATICFILES_DIRS = (RUNX1_STATIC_FILES_DIR,) + STATICFILES_DIRS - - RUNX1_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/runx1_templates") - TEMPLATES[0]["DIRS"].insert(0, RUNX1_TEMPLATES_DIR) - - PATIENTS_READ_ONLY_SHOW_AGE_NOT_DOB = True - PUBLIC_SAMPLE_GENE_MATRIX_GENOME_BUILD = "GRCh37" - PUBLIC_SAMPLE_GENE_MATRIX_GENE_LIST_ID = 19 - PUBLIC_SAMPLE_GENE_MATRIX_SHOW_PRIVATE_SAMPLES = True - PUBLIC_SAMPLE_GENE_MATRIX_TYPE = 'RUNX1_classified_damage' - PUBLIC_SAMPLE_GENE_MATRIX_HIGHLIGHT_GENE_SYMBOLS = ["RUNX1"] - - LOGIN_REDIRECT_URL = '/snpdb/index' - COHORT_SAMPLE_GENE_DAMAGE_COUNTS = 'annotation.tasks.cohort_sample_gene_damage_counts.CalculateCohortSampleGeneDamageCountsTask' - print(f"before: FINISH_IMPORT_VCF_STEP_TASKS_CLASSES: {FINISH_IMPORT_VCF_STEP_TASKS_CLASSES}") - FINISH_IMPORT_VCF_STEP_TASKS_CLASSES = [COHORT_SAMPLE_GENE_DAMAGE_COUNTS] - SITE_NAME = "RUNX1db" - - PATIENTS_READ_ONLY_SHOW_AGE_NOT_DOB = True - VCF_DOWNLOAD_ADMIN_ONLY = True diff --git a/variantgrid/settings/env/dmlxps159560.py b/variantgrid/settings/env/dmlxps159560.py deleted file mode 100644 index 9251845a2..000000000 --- a/variantgrid/settings/env/dmlxps159560.py +++ /dev/null @@ -1,162 +0,0 @@ -from variantgrid.settings.components.celery_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.default_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.seqauto_settings import * # pylint: disable=wildcard-import, unused-wildcard-import - -# import all the base settings # -ROLLBAR['enabled'] = False - -USE_DJANGO_DEBUG_TOOLBAR = False -if USE_DJANGO_DEBUG_TOOLBAR: - INSTALLED_APPS += ['debug_toolbar'] - MIDDLEWARE = ('debug_toolbar.middleware.DebugToolbarMiddleware',) + MIDDLEWARE - INTERNAL_IPS = [ - '127.0.0.1', - ] - -#SEQAUTO_ENABLED = True -AVATAR_CACHE_ENABLED = False # So we can change etc -SEQAUTO_SAMPLE_SHEET_EXTRA_COLUMNS = ["SAPOrderNumber", "Sex", "Panel", "R1kDVersion", "RunID", "CaptureID", "RunReference"] - - -ANALYSIS_TEMPLATES_SAPATH = True -ANALYSIS_TEMPLATES_RUNX1 = True - -COMPANY = "SA_Pathology" # Used for gene lists - -# Automatically run after import -FINISH_IMPORT_VCF_STEP_TASKS_CLASSES = [ - 'annotation.tasks.cohort_sample_gene_damage_counts.CalculateCohortSampleGeneDamageCountsTask', -] - -ANNOTATION_ENTREZ_EMAIL = 'davmlaw@gmail.com' - -ANNOTATION_VEP_PERLBREW_RUNNER_SCRIPT = os.path.join(BASE_DIR, "scripts", "perlbrew_runner.sh") -ANNOTATION_VEP_ARGS = ["--buffer_size", "1000"] # default = 5000 - -ANNOTATION[BUILD_GRCH37]["columns_version"] = 2 - -ANNOTATION[BUILD_GRCH38]["enabled"] = True -ANNOTATION[BUILD_GRCH38]["annotation_consortium"] = "RefSeq" -ANNOTATION[BUILD_GRCH38]["columns_version"] = 2 - -# On laptop I get all kinds of errors using BigWig files, so just turn off -ANNOTATION[BUILD_GRCH37]["vep_config"].update({ - 'phastcons100way': None, - 'phastcons46way': None, - 'phylop100way': None, - 'phylop46way': None, - "dbnsfp": "annotation_data/GRCh37/dbNSFP4.3a.grch37.stripped.gz", - "spliceai_snv": "annotation_data/GRCh37/spliceai_scores.raw.snv.head_100.hg19.vcf.gz", - "spliceai_indel": "annotation_data/GRCh37/spliceai_scores.raw.indel.head_100.hg19.vcf.gz", -}) -ANNOTATION[BUILD_GRCH38]["vep_config"].update({ - 'phastcons100way': None, - 'phastcons30way': None, - 'phylop100way': None, - 'phylop30way': None, - "dbnsfp": "annotation_data/GRCh38/dbNSFP4.3a.grch38.stripped.gz", - "spliceai_snv": "annotation_data/GRCh38/spliceai_scores.raw.snv.head_100.hg38.vcf.gz", - "spliceai_indel": "annotation_data/GRCh38/spliceai_scores.raw.indel.head_100.hg38.vcf.gz", -}) - -LIFTOVER_NCBI_REMAP_ENABLED = True -LIFTOVER_NCBI_REMAP_PERLBREW_RUNNER_SCRIPT = None # Use system Perl - -_SA_PATH_ENRICHMENT_KITS = [{"name": "idt_gmp_focus"}, {"name": "idt_exome"}] -SEQAUTO_COVERAGE_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -GENE_GRID_DEFAULT_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -PATHOLOGY_TEST_SORTED_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS - -VIEW_GENE_HOTSPOT_GRAPH_CLASSIFICATIONS = True -VIEW_GENE_HOTSPOT_GRAPH = True - -PEDIGREE_MADELINE2_COMMAND = "madeline2" - -URLS_NAME_REGISTER["view_patient_contact_tab"] = True - -# CLINGEN_ALLELE_REGISTRY_DOMAIN = "http://reg.test.genome.network" -GENES_DEFAULT_CANONICAL_TRANSCRIPT_COLLECTION_ID = 1 - -_SAPATHOLOGY_MODE = True -_SHARIANT_MODE = False -_RUNX1_MODE = False -_VG_COM_MODE = False - -SOMALIER["enabled"] = True -SOMALIER["admin_only"] = True - -# SOMALIER["annotation_base_dir"] = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "somalier") - -USE_OIDC = False -COMPRESS_ENABLED = False - -if _SAPATHOLOGY_MODE: - SEQAUTO_ENABLED = True - SAPATH_APP = 'sapath.apps.SapathConfig' - INSTALLED_APPS += [SAPATH_APP] - CELERY_IMPORTS += ('sapath.tasks.import_helix_task',) - PATHOLOGY_TEST_REQUESTS_REDIRECT_URL = "sapathology_test_requests" - SAPATHOLOGY_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "sapathology_static") - if os.path.exists(SAPATHOLOGY_STATIC_FILES_DIR): - STATICFILES_DIRS = (SAPATHOLOGY_STATIC_FILES_DIR,) + STATICFILES_DIRS - - SAPATHOLOGY_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/sapathology_templates") - if os.path.exists(SAPATHOLOGY_TEMPLATES_DIR): - TEMPLATES[0]["DIRS"].insert(0, SAPATHOLOGY_TEMPLATES_DIR) - PATHOLOGY_TESTS_ENABLED = True -elif _SHARIANT_MODE: - - VARIANT_DETAILS_SHOW_ANNOTATION = False - VARIANT_CLASSIFICATION_STATS_USE_SHARED = True # False=Use visible to user. True = Shared - - SHARIANT_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "shariant_static") - STATICFILES_DIRS = (SHARIANT_STATIC_FILES_DIR,) + STATICFILES_DIRS - - SHARIANT_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/shariant_templates") - TEMPLATES[0]["DIRS"].insert(0, SHARIANT_TEMPLATES_DIR) - SITE_NAME = "Shariant" - LOGIN_REDIRECT_URL = '/snpdb/index' - - SEARCH_VARIANT_REQUIRE_CLASSIFICATION_FOR_NON_ADMIN = True # set True to only find classified variants - VARIANT_CLASSIFICATION_WEB_FORM_CREATE_BY_NON_ADMIN = False - VARIANT_MANUAL_CREATE_BY_NON_ADMIN = False - - USER_SETTINGS_SHOW_GROUPS = False - - URLS_NAME_REGISTER.update({"classification_dashboard": True, - "classification_import_tool": True}) - - URLS_NAME_REGISTER.update({ # Disable selected urls - # Variants - "variants": False, - "variant_tags": False, - "manual_variant_entry": False, - "variantopedia_wiki": False, - }) - -elif _RUNX1_MODE: - RUNX1_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "runx1_static") - STATICFILES_DIRS = (RUNX1_STATIC_FILES_DIR,) + STATICFILES_DIRS - - RUNX1_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/runx1_templates") - TEMPLATES[0]["DIRS"].insert(0, RUNX1_TEMPLATES_DIR) - - PUBLIC_SAMPLE_GENE_MATRIX_GENOME_BUILD = "GRCh37" - PUBLIC_SAMPLE_GENE_MATRIX_GENE_LIST_ID = None # Was 1 - PUBLIC_SAMPLE_GENE_MATRIX_SHOW_PRIVATE_SAMPLES = True - PUBLIC_SAMPLE_GENE_MATRIX_TYPE = 'RUNX1_classified_damage' - PUBLIC_SAMPLE_GENE_MATRIX_HIGHLIGHT_GENE_SYMBOLS = ["RUNX1"] - - LOGIN_REDIRECT_URL = '/snpdb/index' - COHORT_SAMPLE_GENE_DAMAGE_COUNTS = 'annotation.tasks.cohort_sample_gene_damage_counts.CalculateCohortSampleGeneDamageCountsTask' - FINISH_IMPORT_VCF_STEP_TASKS_CLASSES = [COHORT_SAMPLE_GENE_DAMAGE_COUNTS] - SITE_NAME = "RUNX1db" - - PATIENTS_READ_ONLY_SHOW_AGE_NOT_DOB = True -elif _VG_COM_MODE: - _VG_COM_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "variantgrid_com_static") - STATICFILES_DIRS = (_VG_COM_STATIC_FILES_DIR,) + STATICFILES_DIRS - - _VG_COM_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/variantgrid_com_templates") - if os.path.exists(_VG_COM_TEMPLATES_DIR): - TEMPLATES[0]["DIRS"].insert(0, _VG_COM_TEMPLATES_DIR) diff --git a/variantgrid/settings/env/fromerdp350.py b/variantgrid/settings/env/fromerdp350.py deleted file mode 100644 index 22e276587..000000000 --- a/variantgrid/settings/env/fromerdp350.py +++ /dev/null @@ -1,166 +0,0 @@ -# so we don't pull in 'variantgrid.py' in this dir with Python 2.7.2 - -from variantgrid.settings.components.celery_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.default_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.seqauto_settings import * # pylint: disable=wildcard-import, unused-wildcard-import - - -# import all the base settings # -ROLLBAR['enabled'] = False - -USE_DJANGO_DEBUG_TOOLBAR = False -if USE_DJANGO_DEBUG_TOOLBAR: - INSTALLED_APPS += ['debug_toolbar'] - MIDDLEWARE = ('debug_toolbar.middleware.DebugToolbarMiddleware',) + MIDDLEWARE - INTERNAL_IPS = [ - '127.0.0.1', - ] - -#SEQAUTO_LOAD_GENE_COVERAGE=False - -SEQAUTO_CONTROL_SAMPLE_REGEX = NO_DNA_CONTROL_REGEX -VCF_IMPORT_NO_DNA_CONTROL_SAMPLE_REGEX = NO_DNA_CONTROL_REGEX - -ANNOTATION_VEP_PERLBREW_RUNNER_SCRIPT = os.path.join(BASE_DIR, "scripts", "perlbrew_runner.sh") -ANNOTATION_REFERENCE_BASE_DIR = "/data/annotation" -ANNOTATION_VEP_BASE_DIR = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "VEP") -ANNOTATION_VEP_CODE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "ensembl-vep") -ANNOTATION_VEP_CACHE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "vep_cache") -_ANNOTATION_FASTA_BASE_DIR = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "fasta") - -ANNOTATION_ENTREZ_EMAIL = 'davmlaw@gmail.com' - -ANNOTATION[BUILD_GRCH37].update({ - "annotation_consortium": "RefSeq", - "columns_version": 2, - "reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "GCF_000001405.25_GRCh37.p13_genomic.fna.gz") -}) -ANNOTATION[BUILD_GRCH38].update({ - "annotation_consortium": "RefSeq", - "columns_version": 2, - "enabled": True, - "reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "GCF_000001405.39_GRCh38.p13_genomic.fna.gz") -}) - -ANNOTATION[BUILD_GRCH37]["vep_config"].update({ - "dbnsfp": "annotation_data/GRCh37/dbNSFP4.3a.grch37.stripped.gz", -}) -ANNOTATION[BUILD_GRCH38]["vep_config"].update({ - "dbnsfp": "annotation_data/GRCh38/dbNSFP4.3a.grch38.stripped.gz", -}) - - -COMPANY = "SA_Pathology" # Used for gene lists - -SEQAUTO_SAMPLE_SHEET_EXTRA_COLUMNS = ["SAPOrderNumber", "Sex", "Panel", "R1kDVersion", "RunID", "CaptureID", "RunReference"] - -_SA_PATH_ENRICHMENT_KITS = [{"name": "roche_1k_disease", "version": 6}, {"name": "medical_exomes"}] -SEQAUTO_COVERAGE_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -GENE_GRID_DEFAULT_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -# Fields must be from GoldCoverageSummary and COLUMNS + LABELS must line up! -GENE_GRID_ENRICHMENT_KIT_COLUMNS = ['depth_20x_5th_percentile'] -GENE_GRID_ENRICHMENT_KIT_COLUMN_TOOL_TIPS = ["original_transcript"] -GENE_GRID_ENRICHMENT_KIT_COLUMN_LABELS = ["% at 20x*"] -GENE_GRID_ENRICHMENT_KIT_COLUMN_LABEL_TOOL_TIPS = ["% at 20x for 5th percentile of gold runs (ie expected worst case)"] - -PATHOLOGY_TEST_SORTED_ENRICHMENT_KITS = _SA_PATH_ENRICHMENT_KITS -GENES_DEFAULT_CANONICAL_TRANSCRIPT_COLLECTION_ID = 2 - -HGVS_DEFAULT_METHOD = "combo" # HGVSConverterType (any case) ie "pyhgvs", "biocommons_hgvs" - -LIFTOVER_NCBI_REMAP_ENABLED = True -LIFTOVER_NCBI_REMAP_PERLBREW_RUNNER_SCRIPT = os.path.join(BASE_DIR, "scripts", "perlbrew_runner.sh") - -SOMALIER["enabled"] = True -SOMALIER["annotation_base_dir"] = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, "somalier") - -#CLINGEN_ALLELE_REGISTRY_DOMAIN = "http://reg.test.genome.network" - -#DEBUG = False -COMPRESS_ENABLED = False - -_SHARIANT_MODE = False -_SAPATHOLOGY_MODE = True -_RUNX1_MODE = False - -if _SHARIANT_MODE: - SHARIANT_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "shariant_static") - STATICFILES_DIRS = (SHARIANT_STATIC_FILES_DIR,) + STATICFILES_DIRS - - DISCORDANCE_ENABLED = True - SHARIANT_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/shariant_templates") - TEMPLATES[0]["DIRS"].insert(0, SHARIANT_TEMPLATES_DIR) - SITE_NAME = "Shariant" - VARIANT_CLASSIFICATION_WEB_FORM_CREATE_BY_NON_ADMIN = False - VARIANT_MANUAL_CREATE_BY_NON_ADMIN = False - - SEARCH_VARIANT_REQUIRE_CLASSIFICATION_FOR_NON_ADMIN = True - - # Don't show annotation or samples on variant page - don't want to be responsible for it - VARIANT_DETAILS_SHOW_ANNOTATION = False - VARIANT_DETAILS_SHOW_SAMPLES = False - VARIANT_SHOW_CANONICAL_HGVS = False - VIEW_GENE_WIKI = False - VIEW_GENE_HOTSPOT_GRAPH_CLASSIFICATIONS = True - - URLS_APP_REGISTER.update({"analysis": False, - "expression": False, - "pathtests": False, - "pedigree": False, - "seqauto": False}) - - URLS_NAME_REGISTER.update({"classification_dashboard": True, - "classification_import_tool": True}) - -elif _SAPATHOLOGY_MODE: - SEQAUTO_ENABLED = True - SAPATH_APP = 'sapath.apps.SapathConfig' - INSTALLED_APPS += [SAPATH_APP] - - PATHOLOGY_TEST_EXTERNAL_CODE = "SAPOrderNumber" - SAPATHOLOGY_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "sapathology_static") - if os.path.exists(SAPATHOLOGY_STATIC_FILES_DIR): - STATICFILES_DIRS = (SAPATHOLOGY_STATIC_FILES_DIR,) + STATICFILES_DIRS - - SAPATHOLOGY_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/sapathology_templates") - if os.path.exists(SAPATHOLOGY_TEMPLATES_DIR): - TEMPLATES[0]["DIRS"].insert(0, SAPATHOLOGY_TEMPLATES_DIR) - - INITIAL_USER_DATA_PREFIX_KWARGS = {"prefix": '/tau', - "replacement": '\\\\frgeneseq01.imvs.sa.gov.au\\tau'} - - SAPATH_HELIX_USER = get_secret("SAPATH.HELIX.user") - SAPATH_HELIX_PASSWORD = get_secret("SAPATH.HELIX.password") - SAPATH_HELIX_GENERATE_CSV_FROM_SQL = False - - PATHOLOGY_TESTS_ENABLED = True - PATHOLOGY_TEST_REQUESTS_REDIRECT_URL = "sapathology_test_requests" - - PATHOLOGY_TEST_EXTERNAL_CODE = "SAPOrderNumber" - PATHOLOGY_TEST_CASE_EXTERNAL_CODE = "HelixID" - -elif _RUNX1_MODE: - - ANALYSIS_TEMPLATES_RUNX1 = True - - RUNX1_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "runx1_static") - STATICFILES_DIRS = (RUNX1_STATIC_FILES_DIR,) + STATICFILES_DIRS - - RUNX1_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/runx1_templates") - TEMPLATES[0]["DIRS"].insert(0, RUNX1_TEMPLATES_DIR) - - PATIENTS_READ_ONLY_SHOW_AGE_NOT_DOB = True - PUBLIC_SAMPLE_GENE_MATRIX_GENOME_BUILD = "GRCh37" - PUBLIC_SAMPLE_GENE_MATRIX_GENE_LIST_ID = 19 - PUBLIC_SAMPLE_GENE_MATRIX_SHOW_PRIVATE_SAMPLES = True - PUBLIC_SAMPLE_GENE_MATRIX_TYPE = 'RUNX1_classified_damage' - PUBLIC_SAMPLE_GENE_MATRIX_HIGHLIGHT_GENE_SYMBOLS = ["RUNX1"] - - LOGIN_REDIRECT_URL = '/snpdb/index' - COHORT_SAMPLE_GENE_DAMAGE_COUNTS = 'annotation.tasks.cohort_sample_gene_damage_counts.CalculateCohortSampleGeneDamageCountsTask' - print(f"before: FINISH_IMPORT_VCF_STEP_TASKS_CLASSES: {FINISH_IMPORT_VCF_STEP_TASKS_CLASSES}") - FINISH_IMPORT_VCF_STEP_TASKS_CLASSES = [COHORT_SAMPLE_GENE_DAMAGE_COUNTS] - SITE_NAME = "RUNX1db" - - PATIENTS_READ_ONLY_SHOW_AGE_NOT_DOB = True - VCF_DOWNLOAD_ADMIN_ONLY = True diff --git a/variantgrid/settings/env/jamessmacbookpro2.py b/variantgrid/settings/env/jamessmacbookpro2.py deleted file mode 100644 index 38c9f9342..000000000 --- a/variantgrid/settings/env/jamessmacbookpro2.py +++ /dev/null @@ -1 +0,0 @@ -from variantgrid.settings.env.jamessmbp2 import * # pylint: disable=wildcard-import, unused-wildcard-import diff --git a/variantgrid/settings/env/jamessmbp2.py b/variantgrid/settings/env/jamessmbp2.py deleted file mode 100644 index 535f031d1..000000000 --- a/variantgrid/settings/env/jamessmbp2.py +++ /dev/null @@ -1,358 +0,0 @@ -""" -See https://bitbucket.org/sacgf/variantgrid/wiki/Annotation%20Setup -(test) -""" -from variantgrid.settings.components.default_settings import get_aws_secrets - -# export LDFLAGS="-L/opt/homebrew/opt/llvm/lib" -# export CPPFLAGS="-I/opt/homebrew/opt/llvm/include" - -#GDAL_LIBRARY_PATH="/opt/homebrew/Cellar/gdal/3.6.4_4/lib/libgdal.32.3.6.4.dylib" -#GEOS_LIBRARY_PATH="/opt/homebrew/Cellar/geos/3.11.2/lib/libgeos_c.1.17.2.dylib" -# IMPORTANT : THE BELOW IMPORTS ARE USED TO APPLY THEIR RESPECTIVE SETTINGS VALUES - -from variantgrid.settings.components.celery_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.default_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.seqauto_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -import re - -""" -EMAIL_BACKEND = 'django_amazon_ses.EmailBackend' -aws_dict = get_aws_secrets() -AWS_SES_ACCESS_KEY_ID, AWS_SES_SECRET_ACCESS_KEY, AWS_SES_REGION = \ - [aws_dict[k] for k in ('AWS_SES_ACCESS_KEY_ID', 'AWS_SES_SECRET_ACCESS_KEY', 'AWS_SES_REGION')] - -KEYCLOAK_SYNC_DETAILS = get_keycloak_sync_secrets() -""" - -SYNC_DETAILS = get_shariant_sync_secrets() - -AWS_S3_REGION_NAME = "ap-southeast-2" - -aws_s3_dict = get_s3_secrets() -AWS_S3_ACCESS_KEY_ID, AWS_S3_SECRET_ACCESS_KEY = \ - [aws_s3_dict[k] for k in ("AWS_S3_ACCESS_KEY_ID", "AWS_S3_SECRET_ACCESS_KEY")] - -CELERY_ENABLED = False -CLINVAR_EXPORT = get_clinvar_export_secrets() - -# import all the base settings # -VARIANT_CLASSIFICATION_NEW_GROUPING = True -DISCORDANCE_ENABLED = True -DISCORDANCE_EMAIL = None # 'discordance@shariant.org.au' -ACCOUNTS_EMAIL = 'accounts@shariant.org.au' -DEBUG = True -ROLLBAR['enabled'] = False - -# MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware',) -# INSTALLED_APPS.append('debug_toolbar') - -MIDDLEWARE += ('eventlog.middleware.PageViewsMiddleware', ) -LOG_ACTIVITY_APPS = {"classification", "variantopedia", "snpdb", "genes", "ontology"} - -VARIANT_CLASSIFICATION_OMNI_IMPORTER_APP_DIR = "/Users/jamesandrews/Projects/VariantGrid/shariant-omni-importer" -VARIANT_CLASSIFICATION_OMNI_IMPORTER_PUBLISH_LEVEL = "logged_in_users" -VARIANT_CLASSIFICATION_OMNI_IMPORTER_INCLUDE_SOURCE = True - -""" -AUTHENTICATION_BACKENDS = ( - 'auth.backend.VariantGridOIDCAuthenticationBackend', - 'django.contrib.auth.backends.ModelBackend', # default - 'guardian.backends.ObjectPermissionBackend', -) - -MIDDLEWARE += ( - 'auth.session_refresh.VariantGridSessionRefresh', - # 'debug_toolbar.middleware.DebugToolbarMiddleware', - 'auth.oidc_error_handler.HandleOIDC400Middleware', -) - -REST_FRAMEWORK = { - 'DEFAULT_PERMISSION_CLASSES': ( - 'rest_framework.permissions.IsAuthenticated', - ), - 'DEFAULT_AUTHENTICATION_CLASSES': [ - 'mozilla_django_oidc.contrib.drf.OIDCAuthentication', - 'rest_framework.authentication.SessionAuthentication' - ], -} - -OIDC_DRF_AUTH_BACKEND = 'auth.backend.VariantGridOIDCAuthenticationBackend' -USE_OIDC = True -OIDC_REQUIRED_GROUP = '/variantgrid/shariant_production' -LOGIN_URL = '/oidc_login/' - -OIDC_RP_SIGN_ALGO = 'RS256' -OIDC_RP_CLIENT_ID = 'variantgrid' -OIDC_RP_CLIENT_SECRET = get_secret('OIDC.client_secret') -KEY_CLOAK_BASE = 'http://localhost:8080/auth' - -KEY_CLOAK_REALM = 'agha' -KEY_CLOAK_PROTOCOL_BASE = KEY_CLOAK_BASE + '/realms/' + KEY_CLOAK_REALM + '/protocol/openid-connect' -OIDC_OP_JWKS_ENDPOINT = KEY_CLOAK_PROTOCOL_BASE + '/certs' -OIDC_OP_AUTHORIZATION_ENDPOINT = KEY_CLOAK_PROTOCOL_BASE + '/auth' -OIDC_OP_TOKEN_ENDPOINT = KEY_CLOAK_PROTOCOL_BASE + '/token' -OIDC_OP_USER_ENDPOINT = KEY_CLOAK_PROTOCOL_BASE + '/userinfo' -OIDC_USER_SERVICES = KEY_CLOAK_BASE + '/realms/' + KEY_CLOAK_REALM + '/account' -OIDC_OP_LOGOUT_URL_METHOD = 'auth.backend.provider_logout' -LOGIN_REDIRECT_URL = '/variantopedia/dashboard' -LOGOUT_REDIRECT_URL = KEY_CLOAK_PROTOCOL_BASE + '/logout?redirect_uri=http%3A%2F%2F127.0.0.1%3A8000' -LOGIN_REDIRECT_URL_FAILURE = '/accounts/logout' - -ALLOWED_HOSTS = ["*"] -COMPRESS_ENABLED = False -""" - -VARIANT_CLASSIFICATION_AUTOFUZZ_AGE = True -VARIANT_CLASSIFICATION_GRID_SHOW_USERNAME = True - -# Overwrite settings for your system below -ALLOWED_HOSTS = ["*"] - -INTERNAL_IPS = [ - '127.0.0.1', - '10.211.55.2' -] - -ANNOTATION_ENTREZ_EMAIL = 'James.Andrews@sa.gov.au' - -ANNOTATION_BASE_DIR = "/Users/jamesandrews/Projects/VariantGrid/data/annotation" -ANNOTATION_VCF_DUMP_DIR = os.path.join(ANNOTATION_BASE_DIR, 'annotation_scratch') -ANNOTATION_VEP_BASE_DIR = os.path.join(ANNOTATION_BASE_DIR, "VEP") -ANNOTATION_VEP_CODE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "ensembl-vep") -ANNOTATION_VEP_CACHE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "vep_cache") -_ANNOTATION_FASTA_BASE_DIR = os.path.join(ANNOTATION_BASE_DIR, "fasta") - -ANNOTATION = { - BUILD_GRCH37: { - "enabled": True, - "annotation_consortium": "Ensembl", - "reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "Homo_sapiens.GRCh37.75.dna.primary_assembly.fa.gz"), - "reference_fasta_has_chr": False, - "cytoband": os.path.join(VG_REFERENCE_DIR, "hg19", "cytoband.hg19.txt.gz"), - - # VEP paths are relative to ANNOTATION_VEP_BASE_DIR - worked out at runtime - # so you can change just that variable and have everything else work - # The names correspond to VEPPlugin or VEPCustom entries (but lower case) - "vep_config": { - "dbnsfp": "annotation_data/GRCh37/dbNSFP4.0b2a.hg19.stripped.gz", - "dbscsnv": "annotation_data/GRCh37/dbscSNV1.1_GRCh37.txt.gz", - "gnomad": "annotation_data/GRCh37/gnomad_GRCh37_combined_af.vcf.bgz", - "maxentscan": "annotation_data/all_builds/maxentscan", - 'phastcons100way': "annotation_data/GRCh37/hg19.100way.phastCons.bw", - 'phastcons30way': None, # n/a for GRCh37 - 'phastcons46way': "annotation_data/GRCh37/hg19.phastCons46way.placental.bw", - 'phylop100way': "annotation_data/GRCh37/hg19.100way.phyloP100way.bw", - 'phylop30way': None, # n/a for GRCh37 - 'phylop46way': "annotation_data/GRCh37/hg19.phyloP46way.placental.bw", - "repeatmasker": "annotation_data/GRCh37/repeatmasker_hg19.bed.gz", - "topmed": "annotation_data/GRCh37/TOPMED_GRCh37.vcf.gz", - "uk10k": "annotation_data/GRCh37/UK10K_COHORT.20160215.sites.vcf.gz", - } - }, - # GRCh38 is NOT enabled by default - overwrite "enabled" in your server settings to use - BUILD_GRCH38: { - "enabled": True, - "annotation_consortium": "Ensembl", - "reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz"), - "reference_fasta_has_chr": False, - "cytoband": os.path.join(VG_REFERENCE_DIR, "hg38", "cytoband.hg38.txt.gz"), - - # VEP paths are relative to ANNOTATION_VEP_BASE_DIR - worked out at runtime - # so you can change just that variable and have everything else work - # The names correspond to VEPPlugin or VEPCustom entries (but lower case) - "vep_config": { - "dbnsfp": "annotation_data/GRCh38/dbNSFP4.0b2a.hg38.stripped.gz", - "dbscsnv": "annotation_data/GRCh38/dbscSNV1.1_GRCh38.txt.gz", - "gnomad": "annotation_data/GRCh38/gnomad_GRCh38_combined_af.vcf.bgz", - "maxentscan": "annotation_data/all_builds/maxentscan", - 'phastcons100way': "annotation_data/GRCh38/hg38.phastCons100way.bw", - 'phastcons30way': "annotation_data/GRCh38/hg38.phastCons30way.bw", - 'phylop100way': "annotation_data/GRCh38/hg38.phyloP100way.bw", - 'phylop30way': "annotation_data/GRCh38/hg38.phyloP30way.bw", - "repeatmasker": "annotation_data/GRCh38/repeatmasker_hg38.bed.gz", - "topmed": "annotation_data/GRCh38/TOPMED_GRCh38_20180418.vcf.gz", - "uk10k": "annotation_data/GRCh38/UK10K_COHORT.20160215.sites.GRCh38.vcf.gz", - } - }, -} - -ANNOTATION[BUILD_GRCH37]["annotation_consortium"] = "RefSeq" -ANNOTATION[BUILD_GRCH38]["enabled"] = True -ANNOTATION[BUILD_GRCH38]["annotation_consortium"] = "RefSeq" - -VARIANT_CLASSIFICATION_WEB_FORM_CREATE_INITIALLY_REQUIRE_SAMPLE = False - -_SHARIANT_MODE = False -if _SHARIANT_MODE: - LOGIN_REDIRECT_URL = '/classification/dashboard' - - SHARIANT_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "shariant_static") - SHARIANT_TEST_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "shariant_test_static") - STATICFILES_DIRS = (SHARIANT_TEST_STATIC_FILES_DIR, SHARIANT_STATIC_FILES_DIR,) + STATICFILES_DIRS - - SHARIANT_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/shariant_templates") - TEMPLATES[0]["DIRS"].insert(0, SHARIANT_TEMPLATES_DIR) - SITE_NAME = "Shariant Dev" - -#SAPATH_APP = 'sapath.apps.SapathConfig' -#INSTALLED_APPS += [SAPATH_APP] - - -LOGGING = { - 'version': 1, - 'disable_existing_loggers': True, - 'root': { - 'level': 'DEBUG', - }, - 'formatters': { - 'verbose': { - 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' - }, - 'simple': { - 'format': '%(levelname)s %(message)s' - }, - }, - 'handlers': { - 'null': { - 'level': 'DEBUG', - 'class': 'logging.NullHandler', - }, - 'console':{ - 'level': 'DEBUG', - 'class': 'logging.StreamHandler', - 'formatter': 'simple' - }, - 'db':{ - 'level': 'DEBUG', - 'class': 'eventlog.loggers.EventLogHandler', - 'formatter': 'verbose' - }, - -# 'mail_admins': { -# 'level': 'ERROR', -# 'class': 'django.utils.log.AdminEmailHandler', -# } - }, - 'loggers': { - 'django': { - 'handlers': ['console', 'db'], - 'propagate': True, - 'level': 'WARNING', - }, -# 'django.request': { -# 'handlers': ['mail_admins'], -# 'level': 'ERROR', -# 'propagate': False, -# }, - 'snpdb': { - 'handlers': ['console'], - 'level': 'DEBUG', - }, - 'django.db.backends': { - 'handlers': ['console'], - 'propagate': False, -# 'level':'DEBUG', - }, - } -} - - -VARIANT_CLASSIFICATION_REQUIRE_OVERWRITE_NOTE = False -VARIANT_CLASSIFICATION_AUTOFUZZ_AGE = True -VARIANT_CLASSIFICATION_GRID_SHOW_USERNAME = False # In Shariant - this may be a lab's API user so hide it -VARIANT_CLASSIFICATION_STATS_USE_SHARED = True # False=Use visible to user. True = Shared -VARIANT_CLASSIFICATION_WEB_FORM_CREATE_INITIALLY_REQUIRE_SAMPLE = False -VARIANT_CLASSIFICATION_WEB_FORM_CREATE_BY_NON_ADMIN = False -VARIANT_CLASSIFICATION_GRID_SHOW_ORIGIN = False - -VARIANT_SHOW_CANONICAL_HGVS = False - -# Lock down Shariant menu - hide a lot of VariantGrid urls -# Completely hide URLS from these apps - -URLS_APP_REGISTER.update({"analysis": False, - "expression": False, - "pathtests": False, - "pedigree": False, - "seqauto": False}) - -URLS_NAME_REGISTER.update({ # Disable selected snpdb urls - "data": False, - - # Selected patient urls - "cohorts": False, - "patient_record_imports": False, - "patient_term_approvals": False, - "patients": False, - - "gene_lists": False, - "genes": False, - "gene_grid": False, - - # Variants - "variants": False, - "manual_variant_entry": False, - "variantopedia_wiki": False, - - # Annotation - "version_diffs": False, - - # Settings - "change_password": True, - "custom_columns": False, - "tag_settings": False, - "igv_integration": False, - "sequencing_software_versions": False, - "classification_dashboard": True, - "classification_import_tool": True, - "keycloak_admin": True, - "hgvs_issues": True, - - # Upload - list all URLS (only want them visible by admin) - "upload": False, - "upload_poll": False, - "view_uploaded_file": False, - "view_upload_pipeline": False, - "view_upload_pipeline_warnings_and_errors": False, - "upload_retry_import": False, - "upload_step_grid": False, - "upload_pipeline_modified_variants_grid": False, - "view_upload_stats": False, - "accept_vcf_import_info_tag": False, - "jfu_upload": False, - "jfu_delete": False, - "download_uploaded_file": False, - "clinvar_key_summary": True, - "clinvar_match": True, - - "condition_matchings": True, - "condition_match_test": True, - "classification_upload_unmapped": True, - "classification_view_metrics": True, - "discordance_reports": True, - "vus": True -}) - -# mimic shariant -VARIANT_DETAILS_SHOW_ANNOTATION = True -VARIANT_DETAILS_SHOW_SAMPLES = False -VARIANT_CLASSIFICATION_NON_ACMG_ASSERTION_METHOD = [ - re.compile(r'.*VCGS.*', flags=re.IGNORECASE), - re.compile(r'.*Sherloc.*', flags=re.IGNORECASE) -] - - -UNSHARED_FLAG_ENABLED = True -os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = 'true' - - -SEARCH_VARIANT_REQUIRE_CLASSIFICATION_FOR_NON_ADMIN = True -VARIANT_VCF_DB_PREFIX = 'stv' -PREFER_ALLELE_LINKS = True - -VARIANT_MANUAL_CREATE_BY_NON_ADMIN = False -GENE_RELATION_PANEL_APP_LIVE_UPDATE = True -COMPRESS_ENABLED = False -VARIANT_CLASSIFICATION_ALLOW_DELETE = False -SEQAUTO_ENABLED = True diff --git a/variantgrid/settings/env/runx1db2.py b/variantgrid/settings/env/runx1db2.py deleted file mode 100644 index 30feeb5b0..000000000 --- a/variantgrid/settings/env/runx1db2.py +++ /dev/null @@ -1,91 +0,0 @@ -""" -See https://bitbucket.org/sacgf/variantgrid/wiki/Annotation%20Setup - -""" - -# IMPORTANT : THE BELOW IMPORTS ARE USED TO APPLY THEIR RESPECTIVE SETTINGS VALUES -from variantgrid.settings.components.celery_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.default_settings import * # pylint: disable=wildcard-import, unused-wildcard-import -from variantgrid.settings.components.seqauto_settings import * # pylint: disable=wildcard-import, unused-wildcard-import - -SYNC_DETAILS = get_secrets("SYNC", ["enabled", "username", "password", "host"]) - -# import all the base settings # -# Overwrite settings for your system below -ANALYSIS_TEMPLATES_RUNX1 = True - -ANNOTATION_ENTREZ_EMAIL = 'your@email.com' -ALLOWED_HOSTS = ["runx1db.runx1-fpd.org", "runx1db.runx1.com", "144.6.226.231", "43.240.97.68", "localhost"] -DEBUG = False -SEND_EMAILS = True - -ANNOTATION_BASE_DIR = "/mnt/annotation" # Set this to where you downloaded annotation (${ANNOTATION_BASE_DIR} from wiki) -ANNOTATION_VEP_BASE_DIR = os.path.join(ANNOTATION_BASE_DIR, "VEP") -ANNOTATION_VEP_CODE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "ensembl-vep") -ANNOTATION_VEP_CACHE_DIR = os.path.join(ANNOTATION_VEP_BASE_DIR, "vep_cache") -ANNOTATION_VEP_PERLBREW_RUNNER_SCRIPT = os.path.join(BASE_DIR, "scripts", "perlbrew_runner.sh") -_ANNOTATION_FASTA_BASE_DIR = os.path.join(ANNOTATION_BASE_DIR, "fasta") - -ANNOTATION[BUILD_GRCH37].update({ - "reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "GCF_000001405.25_GRCh37.p13_genomic.fna.gz"), -}) - -GENES_DEFAULT_CANONICAL_TRANSCRIPT_COLLECTION_ID = 1 # MedEx - -PATIENTS_READ_ONLY_SHOW_AGE_NOT_DOB = True -PUBLIC_SAMPLE_GENE_MATRIX_GENOME_BUILD = "GRCh37" -PUBLIC_SAMPLE_GENE_MATRIX_GENE_LIST_ID = None # was 5 -PUBLIC_SAMPLE_GENE_MATRIX_SHOW_PRIVATE_SAMPLES = True -PUBLIC_SAMPLE_GENE_MATRIX_TYPE = 'RUNX1_classified_damage' -PUBLIC_SAMPLE_GENE_MATRIX_HIGHLIGHT_GENE_SYMBOLS = ["RUNX1"] - -LOGIN_REDIRECT_URL = '/snpdb/index' -SITE_NAME = "RUNX1db" -SITE_ID = 7 - -PEDIGREE_MADELINE2_COMMAND = "madeline2" - -SOMALIER["enabled"] = True -SOMALIER["annotation_base_dir"] = os.path.join(ANNOTATION_BASE_DIR, "somalier") - -RUNX1_STATIC_FILES_DIR = os.path.join(VARIANTGRID_APP_DIR, "static_files", "runx1_static") -STATICFILES_DIRS = (RUNX1_STATIC_FILES_DIR,) + STATICFILES_DIRS - -#AUTHENTICATION (RUNX1 ONLY) -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - 'OPTIONS': { - 'min_length': 10, - } - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - -FINISH_IMPORT_VCF_STEP_TASKS_CLASSES = [ - 'annotation.tasks.cohort_sample_gene_damage_counts.CalculateCohortSampleGeneDamageCountsTask', -] - -RUNX1_TEMPLATES_DIR = os.path.join(VARIANTGRID_APP_DIR, "templates/runx1_templates") -TEMPLATES[0]["DIRS"].insert(0, RUNX1_TEMPLATES_DIR) - -# Lock down menu - hide some VariantGrid urls / menu -URLS_NAME_REGISTER.update({ - "sequencing_data": False, - - # Variants - "variants": False, - "manual_variant_entry": False, - "variantopedia_wiki": False, - - # patients - "cases": False, -}) From 9634fed7e2b2990075cfe1866e067b3052040b3e Mon Sep 17 00:00:00 2001 From: bharath Date: Fri, 11 Aug 2023 12:06:09 +1000 Subject: [PATCH 2/2] #3481_updated codeQL to use default workflow --- .github/workflows/codeql-analysis.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f069f8669..18795798b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -18,9 +18,6 @@ jobs: analyze: name: Analyze runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} strategy: fail-fast: false @@ -45,6 +42,7 @@ jobs: # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main languages: python + setup-python-dependencies: false # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) @@ -64,16 +62,3 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 - - # Initializes the CodeQL tools for scanning. - - name: Set up Conda - uses: conda-incubator/setup-miniconda@v2 - with: - channel: conda-forge, bioconda, anaconda, defaults - auto-activate-base: false - auto-update-conda: true - miniconda-version: "latest" - environment-file: environment.yml - - - name: Conda info - run: conda info