1616from anyvlm .utils .types import (
1717 ChromosomeName ,
1818 EndpointTag ,
19- GenomicSequence ,
2019 GrcAssemblyId ,
21- UscsAssemblyBuild ,
20+ NucleotideSequence ,
21+ UcscAssemblyBuild ,
2222)
2323
2424
@@ -36,33 +36,24 @@ def ingest_vcf(vcf_path: Path) -> None:
3636 description = "Search for a single sequence variant and receive allele counts by zygosity, in accordance with the Variant-Level Matching protocol" ,
3737 tags = [EndpointTag .SEARCH ],
3838)
39+ # ruff: noqa: D103, N803 (allow camelCase args and don't require docstrings)
3940def variant_counts (
4041 request : Request ,
41- assemblyId : Annotated [ # noqa: N803
42- GrcAssemblyId | UscsAssemblyBuild ,
42+ assemblyId : Annotated [
43+ GrcAssemblyId | UcscAssemblyBuild ,
4344 Query (..., description = "Genome reference assembly" ),
4445 ],
45- referenceName : Annotated [ # noqa: N803
46+ referenceName : Annotated [
4647 ChromosomeName , Query (..., description = "Chromosome with optional 'chr' prefix" )
4748 ],
4849 start : Annotated [int , Query (..., description = "Variant position" )],
49- referenceBases : Annotated [ # noqa: N803
50- GenomicSequence , Query (..., description = "Genomic bases ('T', 'AC', etc.)" )
50+ referenceBases : Annotated [
51+ NucleotideSequence , Query (..., description = "Genomic bases ('T', 'AC', etc.)" )
5152 ],
52- alternateBases : Annotated [ # noqa: N803
53- GenomicSequence , Query (..., description = "Genomic bases ('T', 'AC', etc.)" )
53+ alternateBases : Annotated [
54+ NucleotideSequence , Query (..., description = "Genomic bases ('T', 'AC', etc.)" )
5455 ],
5556) -> VlmResponse :
56- """Accept a Variant-Level Matching network request and return allele counts by zygosity.
57-
58- :param request: FastAPI `Request` object
59- :param assemblyId: The genome reference assembly. Must be a GRC assembly identifier (e.g., "GRCh38) or a USCS assembly build (e.g., "hg38")
60- :param referenceName: The name of the reference chromosome, with optional 'chr' prefix
61- :param start: The start of the variant's position
62- :param referenceBases: Genomic bases ('T', 'AC', etc.)
63- :param alternateBases: Genomic bases ('T', 'AC', etc.)
64- :return: A VlmResponse object containing cohort allele frequency data. If no matches are found, endpoint will return a status code of 200 with an empty set of results.
65- """
6657 anyvar_client : BaseAnyVarClient = request .app .state .anyvar_client
6758 caf_data : list [CohortAlleleFrequencyStudyResult ] = get_caf (
6859 anyvar_client , assemblyId , referenceName , start , referenceBases , alternateBases
0 commit comments