get_structural_variants
Retrieve structural variants within a specified genomic region using gnomAD datasets. Input chromosome, start, stop positions, and dataset ID to analyze genetic variations efficiently.
Instructions
Get structural variants in a genomic region
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chrom | Yes | Chromosome | |
| dataset | No | Dataset ID (gnomad_sv_r4, gnomad_sv_r2_1) | gnomad_sv_r4 |
| reference_genome | No | Reference genome | GRCh38 |
| start | Yes | Start position | |
| stop | Yes | Stop position |
Implementation Reference
- src/index.ts:721-730 (handler)Handler function for the 'get_structural_variants' tool within the CallToolRequestSchema switch statement. It constructs variables from input arguments, calls makeGraphQLRequest with the predefined GraphQL query, and extracts the structural_variants from the response.case "get_structural_variants": result = await makeGraphQLRequest(QUERIES.getStructuralVariants, { chrom: String(args.chrom), start: parseInt(String(args.start)), stop: parseInt(String(args.stop)), datasetId: parseDatasetId((args.dataset as string) || "gnomad_sv_r4"), referenceGenome: parseReferenceGenome((args.reference_genome as string) || "GRCh38"), }); formattedResult = result.data?.region?.structural_variants || []; break;
- src/index.ts:588-615 (schema)Input schema (JSON Schema) for the 'get_structural_variants' tool, defining parameters like chrom, start, stop, dataset, and reference_genome.inputSchema: { type: "object", properties: { chrom: { type: "string", description: "Chromosome", }, start: { type: "number", description: "Start position", }, stop: { type: "number", description: "Stop position", }, dataset: { type: "string", description: "Dataset ID (gnomad_sv_r4, gnomad_sv_r2_1)", default: "gnomad_sv_r4", }, reference_genome: { type: "string", description: "Reference genome", default: "GRCh38", }, }, required: ["chrom", "start", "stop"], },
- src/index.ts:585-616 (registration)Registration of the 'get_structural_variants' tool in the tools array returned by the ListToolsRequestSchema handler.{ name: "get_structural_variants", description: "Get structural variants in a genomic region", inputSchema: { type: "object", properties: { chrom: { type: "string", description: "Chromosome", }, start: { type: "number", description: "Start position", }, stop: { type: "number", description: "Stop position", }, dataset: { type: "string", description: "Dataset ID (gnomad_sv_r4, gnomad_sv_r2_1)", default: "gnomad_sv_r4", }, reference_genome: { type: "string", description: "Reference genome", default: "GRCh38", }, }, required: ["chrom", "start", "stop"], }, },
- src/index.ts:319-339 (helper)GraphQL query template QUERIES.getStructuralVariants used by the handler to fetch structural variants data from gnomAD API.getStructuralVariants: ` query GetStructuralVariants($chrom: String!, $start: Int!, $stop: Int!, $datasetId: DatasetId!, $referenceGenome: ReferenceGenomeId!) { region(chrom: $chrom, start: $start, stop: $stop, reference_genome: $referenceGenome) { structural_variants(dataset: $datasetId) { variant_id chrom pos end length type alts ac an af homozygote_count hemizygote_count filters } } } `,