Generated banner for Dbsnp Database
Generated logo for Dbsnp Database

Dbsnp Database

Google DeepMindOfficialPublished by Google DeepMind

  • Skill
  • Tool integration
  • Science and research
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Use when you want to look up, map, and search for short genetic variants (SNPs, indels) in NCBI's dbSNP database. Resolves between rsIDs, genomic coordinates in VCF format, and HGVS strings. For an rsID, returns variant type, gene associations, clinical significance, allele frequencies, and genomic coordinates (GRCh38).
— the description by Google DeepMind

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The dbsnp-database skill provides a structured interface for interacting with the NCBI dbSNP database. It enables users to resolve genetic variants between different formats, including rsIDs, VCF genomic coordinates, and HGVS strings. The skill is designed to handle rate-limited API interactions automatically, providing a reliable way to retrieve variant metadata such as variant type, gene associations, clinical significance, and allele frequencies.

What it does

  • Maps genomic coordinates or HGVS strings to canonical rsIDs.
  • Retrieves detailed RefSNP records for specific rsIDs.
  • Converts rsIDs into genomic coordinates on GRCh38 or GRCh37 assemblies.
  • Searches for all known variants within a specified chromosomal region.
  • Handles automatic assembly fallback for coordinate resolution.
  • Manages NCBI API rate limiting and request retries.

When to use it

  • When you need to identify a variant's rsID from VCF coordinates or HGVS notation.
  • When you need to look up clinical significance or allele frequency data for a known rsID.
  • When you need to survey all known variants within a specific genomic range.
  • When you need to translate between different genetic variant nomenclature systems.

Advantages

  • Simplifies complex NCBI API interactions into a single CLI tool.
  • Automates assembly-specific coordinate lookups and fallbacks.
  • Provides consistent JSON output for downstream data processing.
  • Includes built-in rate-limiting logic to prevent service disruption.

Usage examples

“What are the details for rs7412?”
The agent uses the get-variant command to retrieve and display the variant type, gene associations, and clinical significance for rs7412.
“Find the rsID for the variant at chromosome 8, position 19962213, changing C to T.”
The agent executes the resolve-variant command to map these VCF coordinates to the corresponding rsID.
“List all variants in the region of chromosome 7 from 117100000 to 117300000.”
The agent uses the search-region command to return a list of rsIDs found within the specified chromosomal boundaries.
“Convert the HGVS string NC_000008.11:g.19962213del to an rsID.”
The agent uses the resolve-hgvs command to translate the provided HGVS expression into its canonical rsID.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/google-deepmind/dbsnp-database/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip dbsnp-database.zip -d .agents/skills

Documentation by Google DeepMind

dbSNP Database Integration

Prerequisites

  1. uv: Read the uv skill and follow its Setup instructions to ensure uv is installed and on PATH.

  2. User Notification: If .licenses/dbsnp_database_LICENSE.txt does not already exist in the workspace root directory then (1) prominently notify the user to check the terms at https://www.ncbi.nlm.nih.gov/snp/, then (2) create the file recording the notification text and timestamp.

  3. .env file: Make sure the .env file exists in your home directory. Create one if it does not exist.

  4. NCBI_API_KEY (optional): Raises the NCBI rate limit from 3 to 10 requests/second. The skill works without it, but a key is recommended if the user plans many queries or encounters a 429 error. You can register for a key for free at https://www.ncbi.nlm.nih.gov/account/settings/. You MUST use the safe credentials protocol in the credentials skill to check for and request this key if this skill looks relevant to the user's request.

Core Rules

  • Use the Wrapper: ALWAYS execute the provided wrapper script scripts/dbsnp_cli.py to query the database rather than constructing custom HTTP or curl requests. The script automatically handles rate limiting, retries, and JSON parsing.

  • Command Choice: Do NOT use search-region to find the rsID of a specific variant; use resolve-variant instead.

  • Output Size: Avoid using --full on get-variant unless specifically needed, as raw payloads can exceed 1 MB.

  • Shell Safety: Always wrap HGVS strings in single quotes to prevent shell expansion errors.

  • Notification: If this skill is used, ensure this is mentioned in the output.

When to Use

Use this skill when you need to:

  • Map a genomic variant to its canonical rsID (from VCF coordinates or HGVS notation).

  • Retrieve summary data for an rsID: variant type, gene associations, clinical significance, and population allele frequencies.

  • Convert an rsID back to genomic coordinates on a specific assembly.

  • Find all known variants within a chromosomal region.

Do NOT use when you need to:

  • Obtain clinical pathogenicity classifications with submitter rationales (use clinvar-database).

  • Get precise population-level allele frequencies stratified by ancestry (use gnomad-database).

  • Predict the functional effect of a novel mutation (use alphagenome-single-variant-analysis).

  • View 3D protein structures affected by a variant (use alphafold-database-fetch-and-analyze / pdb-database).

Command Selection Guide

Pick the right command on the first try. Match the user's input to the correct subcommand below — one command call is almost always sufficient.

  • User gives you…: Run this command

  • An rsID (e.g. rs7412, rs268): get-variant

  • Genomic coordinates: chrom pos ref alt (e.g. 8 19962213 C T): resolve-variant

  • An HGVS string (e.g. NC_000008.11:g.19962213del): resolve-hgvs

  • An rsID and they want coordinates back: resolve-rsid

  • A chromosomal region (chrom start end): search-region

[!CAUTION] Do NOT use search-region to find the rsID of a specific variant. If the user provides a chromosome, position, reference allele, and alternate allele (four values), use resolve-variant — it is a direct, single-API-call lookup. search-region is only for surveying all variants within a positional range and returns hundreds/thousands of results.

Quick Start

# Look up variant rs7412: type, gene, clinical significance, MAF
uv run scripts/dbsnp_cli.py get-variant rs7412 --output /tmp/rs7412.json

# Find the rsID for a variant at chr8:19962213 C>T
uv run scripts/dbsnp_cli.py resolve-variant 8 19962213 C T \
  --output /tmp/resolve.json

All subcommands write JSON to disk. Always save output in the /tmp/ directory. The --output flag is required.

Commands

1. get-variant — Fetch Variant Record

Retrieve the RefSNP record for one rsID. By default the output is abbreviated to the most useful fields. Both rs268 and 268 are accepted.

uv run scripts/dbsnp_cli.py get-variant rs268 --output /tmp/rs268.json
uv run scripts/dbsnp_cli.py get-variant 268 --assembly GCF_000001405.40 \
  --output /tmp/rs268.json

Arguments:

  • rsid (positional, required): The RefSNP identifier.

  • --assembly: RefSeq assembly accession (default: GCF_000001405.40 = GRCh38).

  • --full: Return the complete raw JSON payload — see warning below.

  • --output: Output file path (default: /tmp/dbsnp_output.json).

Abbreviated output fields:

  • refsnp_id: Numeric rsID

  • variant_type: e.g. snv, ins, del, delins

  • genes: Sorted list of gene symbols (locus names)

  • clinical_significances: List of clinical significance labels

  • minor_allele_frequencies: Study name, allele count, total count

  • placements: Genomic placements for the requested assembly

[!WARNING] About --full: The raw RefSNP payload is typically 50–500 KB and can exceed 1 MB for clinically significant variants with many submissions. Only use --full when you specifically need data absent from the abbreviated output — for example:

  • The complete HGVS nomenclature across every transcript and protein isoform.

  • Full submission history with individual submitter details and timestamps.

  • Population-level allele frequency breakdowns by sub-population within a study (e.g. per-population gnomAD counts).

  • The full set of genomic placements across multiple assemblies (GRCh37 and GRCh38 simultaneously).

  • Merge history showing which older rsIDs were merged into this one.

2. resolve-variant — Genomic Coordinates → rsID

Determine the rsID(s) for a variant given its genomic coordinates (chromosome, position, reference allele, alternate allele). This is the command to use when the user provides a variant as space-separated coordinates like 8 19962213 C T.

uv run scripts/dbsnp_cli.py resolve-variant 8 19962213 C T \
  --output /tmp/resolve.json

Arguments:

  • chrom (positional): Chromosome number (e.g. 8) or RefSeq sequence accession (e.g. NC_000008.11). Chromosomes X and Y must be passed as their numeric equivalents: 23 for X and 24 for Y.

  • pos (positional): 1-based genomic position.

  • ref (positional): Reference allele (e.g. C).

  • alts (positional): Alternate allele(s), comma-separated (e.g. T).

  • --assembly: RefSeq assembly accession (default: GCF_000001405.40).

  • --output: Output file path (default: /tmp/dbsnp_output.json).

Output: {"rsids": ["12345", "67890"]}

3. resolve-rsid — rsID → Genomic Coordinates

Get the genomic placement (sequence ID and allele details) for a known rsID on a specific assembly.

uv run scripts/dbsnp_cli.py resolve-rsid rs7412 --output /tmp/coords.json

Arguments:

  • rsid (positional): The RefSNP identifier.

  • --assembly: RefSeq assembly accession (default: GCF_000001405.40).

  • --output: Output file path (default: /tmp/dbsnp_output.json).

Output: {"rsid": "7412", "assembly": "...", "placements": [...]}

4. resolve-hgvs — HGVS → rsID

Find the rsID(s) corresponding to an HGVS expression.

uv run scripts/dbsnp_cli.py resolve-hgvs 'NC_000008.11:g.19962213del' \
  --output /tmp/hgvs.json

Arguments:

  • hgvs (positional): The HGVS string.

  • --assembly: RefSeq assembly accession (default: GCF_000001405.40).

  • --output: Output file path (default: /tmp/dbsnp_output.json).

Output: {"rsids": ["12345"]}

[!TIP] HGVS strings often contain characters that shells interpret (colons, greater-than signs). Always wrap them in single quotes to prevent shell expansion.

Find all rsIDs within a bounded chromosomal region.

uv run scripts/dbsnp_cli.py search-region 7 117100000 117300000 \
  --output /tmp/region.json

Arguments:

  • chrom (positional): Chromosome (e.g. 7). Use 23 for chromosome X and 24 for chromosome Y.

  • start (positional): Start position.

  • end (positional): End position.

  • --retmax: Maximum rsIDs to return (default: 500, ceiling: 5 000).

  • --output: Output file path (default: /tmp/dbsnp_output.json).

Output:

{
  "rsids": ["12345", "67890", "..."],
  "returned": 500,
  "total_available": 1423,
  "truncated": true,
  "note": "Only 500 of 1423 variants returned.  Increase --retmax ..."
}

When total_available exceeds the returned count, the output includes a truncated flag and a note. Increase --retmax to retrieve more (up to 5 000).

Typical Workflows

Identify a known variant from coordinates
# Step 1: Map VCF coordinates to rsID
uv run scripts/dbsnp_cli.py resolve-variant 19 44908684 T C \
  --output /tmp/step1.json

# Step 2: Get the full details for the resolved rsID
uv run scripts/dbsnp_cli.py get-variant <rsid_from_step1> \
  --output /tmp/step2.json
Survey variants in a gene region
# Step 1: Find all variants in a region spanning the CFTR gene
uv run scripts/dbsnp_cli.py search-region 7 117100000 117300000 \
  --retmax 1000 --output /tmp/region.json

# Step 2: Retrieve details on individual rsIDs of interest
uv run scripts/dbsnp_cli.py get-variant <rsid> --output /tmp/detail.json
Translate HGVS notation to genomic coordinates
# Step 1: Get the rsID for an HGVS expression
uv run scripts/dbsnp_cli.py resolve-hgvs 'NC_000019.10:g.44908684T>C' \
  --output /tmp/hgvs.json

# Step 2: Resolve that rsID to VCF-style coordinates
uv run scripts/dbsnp_cli.py resolve-rsid <rsid> --output /tmp/coords.json

Assembly Defaults and Automatic Fallback

The Variation Services endpoints (used by get-variant, resolve-variant, resolve-rsid, resolve-hgvs) expect a RefSeq assembly accession. The RefSeq accession for GRCh38 is GCF_000001405.40, and for GRCh37 it is GCF_000001405.25.

The search-region subcommand always searches GRCh38 positions.

[!IMPORTANT] Automatic assembly fallback: The resolve-variant and resolve-hgvs commands automatically try GRCh38 first. If no rsIDs are found, they retry with GRCh37 before reporting failure. When a fallback occurs the output JSON includes a "note" field explaining which assembly succeeded. You do NOT need to manually retry with a different assembly — the script handles this transparently.

You only need to override --assembly when you specifically want to restrict the lookup to one assembly (e.g. because the user's coordinates are known to be GRCh37).

NCBI API Key and Rate Limiting

Without an API key the script is limited to 3 requests per second. With a key this increases to 10 requests per second.

You can register for a key for free at https://www.ncbi.nlm.nih.gov/account/settings/. You MUST use the safe credentials protocol in the credentials skill to check for and request this key if this skill looks relevant to the user's request.

Troubleshooting HTTP 500 Errors

Reference Allele Mismatch

If you receive an HTTP 500 error with a message detailing that the asserted reference allele is not equal to the reference sequence:

What it means: The coordinate position is likely valid, but the reference allele (ref) you provided does not match the base at that position in the requested assembly.

Action: 1. DO NOT RETRY the exact same query mechanically. 2. Check the assembly: Coordinates are assembly-specific. 3. Switch assembly: If you were querying GRCh37, try GRCh38 (using --assembly GCF_000001405.40), or if querying GRCh38, try GRCh37 (using --assembly GCF_000001405.25).

Common Mistakes

  • Mistake: Forgetting to quote HGVS strings Fix: Wrap in single quotes: 'NC_000008.11:g.19962213del'

  • Mistake: Passing a chromosome name to resolve-variant instead of a sequence accession Fix: Use the numeric chromosome ID (e.g. 8) or a RefSeq accession like NC_000008.11

  • Mistake: Using --full on get-variant without needing it Fix: The abbreviated output covers most use cases; --full returns 50–500 KB+ of JSON

  • Mistake: Expecting search-region to return all results by default Fix: The default --retmax is 500; check total_available in the output to see if results were truncated

  • Mistake: Using GRCh37 coordinates with search-region Fix: search-region always uses GRCh38 positions; lift over coordinates first if starting from GRCh37

  • Mistake: Manually retrying resolve-variant or resolve-hgvs with a different --assembly when the first call fails Fix: The script automatically tries GRCh38 then GRCh37; a single call is sufficient

  • Mistake: Passing X or Y as the chromosome value Fix: Use the numeric equivalents: 23 for chromosome X and 24 for chromosome Y. The CLI treats chromosomes numerically by default.

Files

LICENSE


                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an API key, Needs Python

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google DeepMind
Publisher
Google DeepMind (Official)
Source
google-deepmind/science-skills · skills/dbsnp_database · commit 4de6786
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google DeepMind.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download dbsnp-database.zip