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_api.py from hardiksood21/variantllm: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/hardiksood21/variantllm/resolve/main/tests/test_api.py
- Command line
-
hf download hf://spaces/hardiksood21/variantllm/tests/test_api.py
-
curl -L -o test_api.py https://huggingface.co/spaces/hardiksood21/variantllm/resolve/main/tests/test_api.py
1.12 kB
| from fastapi.testclient import TestClient | |
| from variantllm.api.main import app | |
| client = TestClient(app) | |
| def test_health_endpoint(): | |
| response = client.get("/health") | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert data["status"] == "healthy" | |
| assert "foundation_model" in data | |
| def test_predict_endpoint(): | |
| payload = { | |
| "gene_symbol": "TP53", | |
| "wildtype_seq": "MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQAMDDLMLSPDDIEQWFTEDPGPDEAPRMPEAAPPVAPAPAAPTPAAPAPAPSWPLSSSVPSQKTYQGSYGFRLGFLHSGTAKSVTCTYSPALNKMFCQLAKTCPVQLWVDSTPPPGTRVRAMAIYKQSQHMTEVVRRCPHHERCSDSD", | |
| "mutant_seq": "MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQAMDDLMLSPDDIEQWFTEDPGPDEAPRMPEAAPPVAPAPAAPTPAAPAPAPSWPLSSSVPSQKTYQGSYGFRLGFLHSGTAKSVTCTYSPALNKMFCQLAKTCPVQLWVDSTPPPGTHVRAMAIYKQSQHMTEVVRRCPHHERCSDSD", | |
| "variant_annotation": "p.Arg175His" | |
| } | |
| response = client.post("/predict/variant", json=payload) | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert "prediction" in data | |
| assert "pathogenicity_probability" in data | |
| assert "zero_shot_llr_delta" in data | |