Cosmic database

From aipoch/medical-research-skills · View interactive version

Cosmic database is an AI agent skill from the GitHub repository aipoch/medical-research-skills. Access COSMIC to download mutation datasets, query Cancer Gene Census, and retrieve mutational signatures when your genomic analysis requires curated somatic mutation resources.

How to use this skill

Skill file

Source: https://github.com/aipoch/medical-research-skills

COSMIC Database Skill

When to Use

Key Features

Dependencies

Example Usage

cd "20260316/scientific-skills/Evidence Insight/cosmic-database"
python -m py_compile scripts/download_cosmic.py
python scripts/download_cosmic.py --help

Example run plan:

  1. Confirm the user input, output path, and any required config values.
  2. Edit the in-file CONFIG block or documented parameters if the script uses fixed settings.
  3. Run python scripts/download_cosmic.py with the validated inputs.
  4. Review the generated output and return the final artifact with any assumptions called out.

Implementation Details

1. When to Use

Use this skill when you need COSMIC data for tasks such as:

2. Key Features

3. Dependencies

External requirements:

4. Example Usage

The following example downloads a COSMIC file and loads it into a pandas DataFrame.

from scripts.download_cosmic import download_cosmic_file
import pandas as pd

# 1) Download a COSMIC dataset (example path; adjust to your target release/build)
download_cosmic_file(
    email="user@email.com",
    password="pwd",
    filepath="GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz"
)

# 2) Load the downloaded GZIP-compressed TSV
df = pd.read_csv(
    "CosmicMutantExport.tsv.gz",
    sep="\t",
    compression="gzip"
)

# 3) Example analysis: filter by gene symbol (column name depends on the dataset)

# df_gene = df[df["Gene name"] == "TP53"]

For dataset field definitions and COSMIC file specifics, see: references/cosmic_data_reference.md.

5. Implementation Details

1. Download the desired COSMIC export.

2. Load into a DataFrame (or parse VCF with an appropriate library if needed).

3. Filter/aggregate by gene, tumor type, sample, or signature depending on the analysis goal.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.