cosmic-database

0
0
Source

Access COSMIC cancer mutation database. Query somatic mutations, Cancer Gene Census, mutational signatures, gene fusions, for cancer research and precision oncology. Requires authentication.

Install

mkdir -p .claude/skills/cosmic-database && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4436" && unzip -o skill.zip -d .claude/skills/cosmic-database && rm skill.zip

Installs to .claude/skills/cosmic-database

About this skill

COSMIC Database

Overview

COSMIC (Catalogue of Somatic Mutations in Cancer) is the world's largest and most comprehensive database for exploring somatic mutations in human cancer. Access COSMIC's extensive collection of cancer genomics data, including millions of mutations across thousands of cancer types, curated gene lists, mutational signatures, and clinical annotations programmatically.

When to Use This Skill

This skill should be used when:

  • Downloading cancer mutation data from COSMIC
  • Accessing the Cancer Gene Census for curated cancer gene lists
  • Retrieving mutational signature profiles
  • Querying structural variants, copy number alterations, or gene fusions
  • Analyzing drug resistance mutations
  • Working with cancer cell line genomics data
  • Integrating cancer mutation data into bioinformatics pipelines
  • Researching specific genes or mutations in cancer contexts

Prerequisites

Account Registration

COSMIC requires authentication for data downloads:

Python Requirements

uv pip install requests pandas

Quick Start

1. Basic File Download

Use the scripts/download_cosmic.py script to download COSMIC data files:

from scripts.download_cosmic import download_cosmic_file

# Download mutation data
download_cosmic_file(
    email="your_email@institution.edu",
    password="your_password",
    filepath="GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz",
    output_filename="cosmic_mutations.tsv.gz"
)

2. Command-Line Usage

# Download using shorthand data type
python scripts/download_cosmic.py user@email.com --data-type mutations

# Download specific file
python scripts/download_cosmic.py user@email.com \
    --filepath GRCh38/cosmic/latest/cancer_gene_census.csv

# Download for specific genome assembly
python scripts/download_cosmic.py user@email.com \
    --data-type gene_census --assembly GRCh37 -o cancer_genes.csv

3. Working with Downloaded Data

import pandas as pd

# Read mutation data
mutations = pd.read_csv('cosmic_mutations.tsv.gz', sep='\t', compression='gzip')

# Read Cancer Gene Census
gene_census = pd.read_csv('cancer_gene_census.csv')

# Read VCF format
import pysam
vcf = pysam.VariantFile('CosmicCodingMuts.vcf.gz')

Available Data Types

Core Mutations

Download comprehensive mutation data including point mutations, indels, and genomic annotations.

Common data types:

  • mutations - Complete coding mutations (TSV format)
  • mutations_vcf - Coding mutations in VCF format
  • sample_info - Sample metadata and tumor information
# Download all coding mutations
download_cosmic_file(
    email="user@email.com",
    password="password",
    filepath="GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz"
)

Cancer Gene Census

Access the expert-curated list of ~700+ cancer genes with substantial evidence of cancer involvement.

# Download Cancer Gene Census
download_cosmic_file(
    email="user@email.com",
    password="password",
    filepath="GRCh38/cosmic/latest/cancer_gene_census.csv"
)

Use cases:

  • Identifying known cancer genes
  • Filtering variants by cancer relevance
  • Understanding gene roles (oncogene vs tumor suppressor)
  • Target gene selection for research

Mutational Signatures

Download signature profiles for mutational signature analysis.

# Download signature definitions
download_cosmic_file(
    email="user@email.com",
    password="password",
    filepath="signatures/signatures.tsv"
)

Signature types:

  • Single Base Substitution (SBS) signatures
  • Doublet Base Substitution (DBS) signatures
  • Insertion/Deletion (ID) signatures

Structural Variants and Fusions

Access gene fusion data and structural rearrangements.

Available data types:

  • structural_variants - Structural breakpoints
  • fusion_genes - Gene fusion events
# Download gene fusions
download_cosmic_file(
    email="user@email.com",
    password="password",
    filepath="GRCh38/cosmic/latest/CosmicFusionExport.tsv.gz"
)

Copy Number and Expression

Retrieve copy number alterations and gene expression data.

Available data types:

  • copy_number - Copy number gains/losses
  • gene_expression - Over/under-expression data
# Download copy number data
download_cosmic_file(
    email="user@email.com",
    password="password",
    filepath="GRCh38/cosmic/latest/CosmicCompleteCNA.tsv.gz"
)

Resistance Mutations

Access drug resistance mutation data with clinical annotations.

# Download resistance mutations
download_cosmic_file(
    email="user@email.com",
    password="password",
    filepath="GRCh38/cosmic/latest/CosmicResistanceMutations.tsv.gz"
)

Working with COSMIC Data

Genome Assemblies

COSMIC provides data for two reference genomes:

  • GRCh38 (recommended, current standard)
  • GRCh37 (legacy, for older pipelines)

Specify the assembly in file paths:

# GRCh38 (recommended)
filepath="GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz"

# GRCh37 (legacy)
filepath="GRCh37/cosmic/latest/CosmicMutantExport.tsv.gz"

Versioning

  • Use latest in file paths to always get the most recent release
  • COSMIC is updated quarterly (current version: v102, May 2025)
  • Specific versions can be used for reproducibility: v102, v101, etc.

File Formats

  • TSV/CSV: Tab/comma-separated, gzip compressed, read with pandas
  • VCF: Standard variant format, use with pysam, bcftools, or GATK
  • All files include headers describing column contents

Common Analysis Patterns

Filter mutations by gene:

import pandas as pd

mutations = pd.read_csv('cosmic_mutations.tsv.gz', sep='\t', compression='gzip')
tp53_mutations = mutations[mutations['Gene name'] == 'TP53']

Identify cancer genes by role:

gene_census = pd.read_csv('cancer_gene_census.csv')
oncogenes = gene_census[gene_census['Role in Cancer'].str.contains('oncogene', na=False)]
tumor_suppressors = gene_census[gene_census['Role in Cancer'].str.contains('TSG', na=False)]

Extract mutations by cancer type:

mutations = pd.read_csv('cosmic_mutations.tsv.gz', sep='\t', compression='gzip')
lung_mutations = mutations[mutations['Primary site'] == 'lung']

Work with VCF files:

import pysam

vcf = pysam.VariantFile('CosmicCodingMuts.vcf.gz')
for record in vcf.fetch('17', 7577000, 7579000):  # TP53 region
    print(record.id, record.ref, record.alts, record.info)

Data Reference

For comprehensive information about COSMIC data structure, available files, and field descriptions, see references/cosmic_data_reference.md. This reference includes:

  • Complete list of available data types and files
  • Detailed field descriptions for each file type
  • File format specifications
  • Common file paths and naming conventions
  • Data update schedule and versioning
  • Citation information

Use this reference when:

  • Exploring what data is available in COSMIC
  • Understanding specific field meanings
  • Determining the correct file path for a data type
  • Planning analysis workflows with COSMIC data

Helper Functions

The download script includes helper functions for common operations:

Get Common File Paths

from scripts.download_cosmic import get_common_file_path

# Get path for mutations file
path = get_common_file_path('mutations', genome_assembly='GRCh38')
# Returns: 'GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz'

# Get path for gene census
path = get_common_file_path('gene_census')
# Returns: 'GRCh38/cosmic/latest/cancer_gene_census.csv'

Available shortcuts:

  • mutations - Core coding mutations
  • mutations_vcf - VCF format mutations
  • gene_census - Cancer Gene Census
  • resistance_mutations - Drug resistance data
  • structural_variants - Structural variants
  • gene_expression - Expression data
  • copy_number - Copy number alterations
  • fusion_genes - Gene fusions
  • signatures - Mutational signatures
  • sample_info - Sample metadata

Troubleshooting

Authentication Errors

  • Verify email and password are correct
  • Ensure account is registered at cancer.sanger.ac.uk/cosmic
  • Check if commercial license is required for your use case

File Not Found

  • Verify the filepath is correct
  • Check that the requested version exists
  • Use latest for the most recent version
  • Confirm genome assembly (GRCh37 vs GRCh38) is correct

Large File Downloads

  • COSMIC files can be several GB in size
  • Ensure sufficient disk space
  • Download may take several minutes depending on connection
  • The script shows download progress for large files

Commercial Use

Integration with Other Tools

COSMIC data integrates well with:

  • Variant annotation: VEP, ANNOVAR, SnpEff
  • Signature analysis: SigProfiler, deconstructSigs, MuSiCa
  • Cancer genomics: cBioPortal, OncoKB, CIViC
  • Bioinformatics: Bioconductor, TCGA analysis tools
  • Data science: pandas, scikit-learn, PyTorch

Additional Resources

Citation

When using COSMIC data, cite: Tate JG, Bamford S, Jubb HC, et al. COSMIC: the Catalogue Of Somatic Mutations In Cancer. Nucleic Acids Research. 2019;47(D1):D941-D947.

scroll-experience

davila7

Expert in building immersive scroll-driven experiences - parallax storytelling, scroll animations, interactive narratives, and cinematic web experiences. Like NY Times interactives, Apple product pages, and award-winning web experiences. Makes websites feel like experiences, not just pages. Use when: scroll animation, parallax, scroll storytelling, interactive story, cinematic website.

6230

software-architecture

davila7

Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.

8125

senior-fullstack

davila7

Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.

8122

senior-security

davila7

Comprehensive security engineering skill for application security, penetration testing, security architecture, and compliance auditing. Includes security assessment tools, threat modeling, crypto implementation, and security automation. Use when designing security architecture, conducting penetration tests, implementing cryptography, or performing security audits.

6819

game-development

davila7

Game development orchestrator. Routes to platform-specific skills based on project needs.

5414

2d-games

davila7

2D game development principles. Sprites, tilemaps, physics, camera.

4812

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

643969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

591705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318398

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

451339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.