Spaces:
Running on Zero
Running on Zero
hardiksood21
feat: upgrade VariantLLM with Meta ESM-2 zero-shot foundation scoring and HF Space support
b0f65a7 Download tests/test_inference.py from hardiksood21/variantllm: direct link, hf CLI and curl.
- Browser
- Download file 925 Bytes
-
https://huggingface.co/spaces/hardiksood21/variantllm/resolve/main/tests/test_inference.py
- Command line
-
hf download hf://spaces/hardiksood21/variantllm/tests/test_inference.py
-
curl -L -o test_inference.py https://huggingface.co/spaces/hardiksood21/variantllm/resolve/main/tests/test_inference.py
925 Bytes
| import pytest | |
| from variantllm.inference.scorer import ZeroShotVariantScorer | |
| def test_zero_shot_scorer_esm2(): | |
| scorer = ZeroShotVariantScorer(model_name="facebook/esm2_t6_8M_UR50D") | |
| # Test TP53 R175H (known pathogenic mutation) | |
| wt = "MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQAMDDLMLSPDDIEQWFTEDPGPDEAPRMPEAAPPVAPAPAAPTPAAPAPAPSWPLSSSVPSQKTYQGSYGFRLGFLHSGTAKSVTCTYSPALNKMFCQLAKTCPVQLWVDSTPPPGTRVRAMAIYKQSQHMTEVVRRCPHHERCSDSD" | |
| mut = "MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQAMDDLMLSPDDIEQWFTEDPGPDEAPRMPEAAPPVAPAPAAPTPAAPAPAPSWPLSSSVPSQKTYQGSYGFRLGFLHSGTAKSVTCTYSPALNKMFCQLAKTCPVQLWVDSTPPPGTHVRAMAIYKQSQHMTEVVRRCPHHERCSDSD" | |
| res = scorer.score_sequence_pair(wt, mut) | |
| assert "zero_shot_llr_score" in res | |
| assert "pathogenicity_prob" in res | |
| assert "prediction" in res | |
| assert res["gene_position"] > 0 | |
| assert res["wildtype_residue"] == "R" | |
| assert res["mutant_residue"] == "H" | |