Skip to content

Commit

Permalink
fix: missing/problematic clinvar version (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Jun 21, 2023
1 parent 1e46327 commit b11a8a4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 35 deletions.
4 changes: 3 additions & 1 deletion clinvar_tsv/__main__.py
Expand Up @@ -182,7 +182,9 @@ def main(argv=None):
parser_merge_tsvs.set_defaults(func=run_merge_tsvs)

args = parser.parse_args(argv)
os.environ["CLINVAR_VERSION"] = args.clinvar_version
clinvar_version = os.environ.get("CLINVAR_VERSION", getattr(args, "clinvar_version", None))
if clinvar_version:
os.environ["CLINVAR_VERSION"] = clinvar_version
return run(args)


Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Expand Up @@ -3,7 +3,7 @@
# Base Requirements
-r base.txt

black ==22.3.0
black ==23.3.0
isort >=5.10.1, <6.0
flake8 >=5.0.4, <6.0
pytest
Expand Down
43 changes: 10 additions & 33 deletions tests/test_merge_tsvs.py
Expand Up @@ -31,10 +31,7 @@ def test_summarize_stratified_single(cvs_factory, rcva_factory, cva_factory):
stratify_by_review_status=True,
)
expected = ReviewedPathogenicity(
review_statuses=(
ReviewStatus.SINGLE_SUBMITTER,
ReviewStatus.CRITERIA_PROVIDED,
),
review_statuses=(ReviewStatus.SINGLE_SUBMITTER, ReviewStatus.CRITERIA_PROVIDED),
pathogenicities=(Pathogenicity.LIKELY_BENIGN,),
)
assert result == expected
Expand Down Expand Up @@ -64,10 +61,7 @@ def test_summarize_unstratified_single(cvs_factory, rcva_factory, cva_factory):
stratify_by_review_status=False,
)
expected = ReviewedPathogenicity(
review_statuses=(
ReviewStatus.SINGLE_SUBMITTER,
ReviewStatus.CRITERIA_PROVIDED,
),
review_statuses=(ReviewStatus.SINGLE_SUBMITTER, ReviewStatus.CRITERIA_PROVIDED),
pathogenicities=(Pathogenicity.LIKELY_BENIGN,),
)
assert result == expected
Expand Down Expand Up @@ -216,10 +210,7 @@ def test_summarize_stratified_lb_vus(cvs_factory, rcva_factory, cva_factory):
stratify_by_review_status=True,
)
expected = ReviewedPathogenicity(
review_statuses=(
ReviewStatus.SINGLE_SUBMITTER,
ReviewStatus.CRITERIA_PROVIDED,
),
review_statuses=(ReviewStatus.SINGLE_SUBMITTER, ReviewStatus.CRITERIA_PROVIDED),
pathogenicities=(Pathogenicity.LIKELY_BENIGN,),
)
assert result == expected
Expand Down Expand Up @@ -320,10 +311,7 @@ def test_summarize_unstratified_lb_b(cvs_factory, rcva_factory, cva_factory):
ReviewStatus.CRITERIA_PROVIDED,
ReviewStatus.NO_CONFLICTS,
),
pathogenicities=(
Pathogenicity.BENIGN,
Pathogenicity.LIKELY_BENIGN,
),
pathogenicities=(Pathogenicity.BENIGN, Pathogenicity.LIKELY_BENIGN),
)
assert result == expected

Expand Down Expand Up @@ -370,10 +358,7 @@ def test_summarize_unstratified_lp_p(cvs_factory, rcva_factory, cva_factory):
ReviewStatus.CRITERIA_PROVIDED,
ReviewStatus.NO_CONFLICTS,
),
pathogenicities=(
Pathogenicity.LIKELY_PATHOGENIC,
Pathogenicity.PATHOGENIC,
),
pathogenicities=(Pathogenicity.LIKELY_PATHOGENIC, Pathogenicity.PATHOGENIC),
)
assert result == expected

Expand Down Expand Up @@ -440,8 +425,7 @@ def test_summarize_expert_panel(cvs_factory, rcva_factory, cva_factory):
),
cv_assertions=(
cva_factory(
review_status="reviewed by expert panel",
pathogenicity="likely pathogenic",
review_status="reviewed by expert panel", pathogenicity="likely pathogenic"
),
),
),
Expand All @@ -453,8 +437,7 @@ def test_summarize_expert_panel(cvs_factory, rcva_factory, cva_factory):
),
cv_assertions=(
cva_factory(
review_status="criteria provided, single submitter",
pathogenicity="benign",
review_status="criteria provided, single submitter", pathogenicity="benign"
),
),
),
Expand Down Expand Up @@ -483,22 +466,16 @@ def test_summarize_practice_guideline(cvs_factory, rcva_factory, cva_factory):
),
cv_assertions=(
cva_factory(
review_status="practice guideline",
pathogenicity="likely pathogenic",
review_status="practice guideline", pathogenicity="likely pathogenic"
),
),
),
cvs_factory(
ref_cv_assertion=rcva_factory(
gold_stars=3,
review_status="reviewed by expert panel",
pathogenicity="benign",
gold_stars=3, review_status="reviewed by expert panel", pathogenicity="benign"
),
cv_assertions=(
cva_factory(
review_status="reviewed by expert panel",
pathogenicity="benign",
),
cva_factory(review_status="reviewed by expert panel", pathogenicity="benign"),
),
),
],
Expand Down

0 comments on commit b11a8a4

Please sign in to comment.