Skip to main content
Glama

get_variant_liftover

Convert genomic variant coordinates between GRCh37 and GRCh38 reference genomes using the gnomAD database, enabling cross-version data analysis and comparison.

Instructions

[gnomAD API] Retrieve liftover info (v2 only) Args: reference_genome (str): Reference genome (GRCh37 or GRCh38) source_variant_id (str, optional): Source variant ID (e.g. 12-112241766-G-A on GRCh37) liftover_variant_id (str, optional): Lifted over variant ID (e.g. 12-111803962-G-A on GRCh38) Returns: dict: liftover info Note: Not supported in v3/v4.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reference_genomeYes
source_variant_idNo
liftover_variant_idNo
datasetNognomad_r2_1

Implementation Reference

  • The implementation of get_variant_liftover, which validates input parameters and calls run_query_with_metadata to fetch liftover data.
    def get_variant_liftover(
        reference_genome: str,
        source_variant_id: Optional[str] = None,
        liftover_variant_id: Optional[str] = None,
        dataset: str = 'gnomad_r2_1'
    ) -> dict:
        """
        [gnomAD API] Retrieve liftover info (v2 only)
        Args:
            reference_genome (str): Reference genome (GRCh37 or GRCh38)
            source_variant_id (str, optional): Source variant ID (e.g. 12-112241766-G-A on GRCh37)
            liftover_variant_id (str, optional): Lifted over variant ID (e.g. 12-111803962-G-A on GRCh38)
        Returns:
            dict: liftover info
        Note:
            Not supported in v3/v4.
        """
    
        if dataset != 'gnomad_r2_1':
            raise ValueError("Only v2 is supported for liftover.")
        
        if source_variant_id and liftover_variant_id:
            raise ValueError("Only one of source_variant_id or liftover_variant_id must be provided.")
        
        # Build check
        if source_variant_id:
            if reference_genome != 'GRCh37':
                raise ValueError("Source variant ID must be on GRCh37.")
        elif liftover_variant_id:
            if reference_genome != 'GRCh38':
                raise ValueError("Lifted over variant ID must be on GRCh38.")
        else:
            raise ValueError("Either source_variant_id or liftover_variant_id must be provided.")
    
        variables = {
            'dataset': dataset,
            'reference_genome': reference_genome,
            'source_variant_id': source_variant_id,
            'liftover_variant_id': liftover_variant_id,
        }
        return run_query_with_metadata('liftover', variables)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/koido/gnomad-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server