get_region_variants
Retrieve genetic variants within a specified genomic region using chromosome, start, and stop positions. Access variant data from the gnomAD database with customizable dataset and reference genome options.
Instructions
Get variants in a specific genomic region
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chrom | Yes | Chromosome (1-22, X, Y) | |
| dataset | No | Dataset ID | gnomad_r4 |
| reference_genome | No | Reference genome | GRCh38 |
| start | Yes | Start position | |
| stop | Yes | Stop position |
Implementation Reference
- src/index.ts:697-706 (handler)The main handler logic for the get_region_variants tool. It constructs variables from input arguments, invokes the GraphQL query via makeGraphQLRequest, and extracts the variants array from the response.case "get_region_variants": result = await makeGraphQLRequest(QUERIES.getRegionVariants, { chrom: String(args.chrom), start: parseInt(String(args.start)), stop: parseInt(String(args.stop)), datasetId: parseDatasetId((args.dataset as string) || "gnomad_r4"), referenceGenome: parseReferenceGenome((args.reference_genome as string) || "GRCh38"), }); formattedResult = result.data?.region?.variants || []; break;
- src/index.ts:526-557 (registration)Tool registration in the list of available tools, defining the name, description, and input schema for get_region_variants.{ name: "get_region_variants", description: "Get variants in a specific genomic region", inputSchema: { type: "object", properties: { chrom: { type: "string", description: "Chromosome (1-22, X, Y)", }, start: { type: "number", description: "Start position", }, stop: { type: "number", description: "Stop position", }, dataset: { type: "string", description: "Dataset ID", default: "gnomad_r4", }, reference_genome: { type: "string", description: "Reference genome", default: "GRCh38", }, }, required: ["chrom", "start", "stop"], }, },
- src/index.ts:529-556 (schema)Input schema defining the parameters and validation for the get_region_variants tool.inputSchema: { type: "object", properties: { chrom: { type: "string", description: "Chromosome (1-22, X, Y)", }, start: { type: "number", description: "Start position", }, stop: { type: "number", description: "Stop position", }, dataset: { type: "string", description: "Dataset ID", default: "gnomad_r4", }, reference_genome: { type: "string", description: "Reference genome", default: "GRCh38", }, }, required: ["chrom", "start", "stop"], },
- src/index.ts:254-280 (helper)GraphQL query template (QUERIES.getRegionVariants) used by the handler to fetch variants in the specified genomic region.getRegionVariants: ` query GetRegionVariants($chrom: String!, $start: Int!, $stop: Int!, $datasetId: DatasetId!, $referenceGenome: ReferenceGenomeId!) { region(chrom: $chrom, start: $start, stop: $stop, reference_genome: $referenceGenome) { variants(dataset: $datasetId) { variant_id pos rsids consequence hgvsc hgvsp lof exome { ac an af filters } genome { ac an af filters } } } } `,