get_motif_features
Retrieve transcription factor binding motifs within a specified genomic region to identify potential regulatory elements and analyze gene expression patterns.
Instructions
Get transcription factor binding motifs in genomic region
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | Yes | Genomic region (chr:start-end) | |
| species | No | Species name (default: homo_sapiens) | |
| binding_matrix | No | Specific binding matrix (optional) |
Implementation Reference
- src/index.ts:1418-1446 (handler)The handler function that executes the get_motif_features tool. It validates arguments, queries the Ensembl regulatory motif API endpoint (/regulatory/species/{species}/microarray/{region}), and returns the motif features data.private async handleGetMotifFeatures(args: any) { if (!isValidMotifArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid motif feature arguments'); } try { const species = this.getDefaultSpecies(args.species); const region = this.formatGenomicRegion(args.region); const params: any = {}; if (args.binding_matrix) { params.binding_matrix = args.binding_matrix; } const response = await this.apiClient.get(`/regulatory/species/${species}/microarray/${region}`, { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleError(error, 'fetching motif features'); } }
- src/index.ts:725-736 (schema)The input schema definition for the get_motif_features tool, registered in the list_tools handler.name: 'get_motif_features', description: 'Get transcription factor binding motifs in genomic region', inputSchema: { type: 'object', properties: { region: { type: 'string', description: 'Genomic region (chr:start-end)' }, species: { type: 'string', description: 'Species name (default: homo_sapiens)' }, binding_matrix: { type: 'string', description: 'Specific binding matrix (optional)' }, }, required: ['region'], }, },
- src/index.ts:861-862 (registration)Registration of the get_motif_features tool handler in the CallToolRequestSchema switch statement.case 'get_motif_features': return this.handleGetMotifFeatures(args);
- src/index.ts:323-334 (schema)Type guard function used for input validation of get_motif_features tool arguments.const isValidMotifArgs = ( args: any ): args is { region: string; species?: string; binding_matrix?: string } => { return ( typeof args === 'object' && args !== null && typeof args.region === 'string' && args.region.length > 0 && (args.species === undefined || typeof args.species === 'string') && (args.binding_matrix === undefined || typeof args.binding_matrix === 'string') ); };