cosmic-database by davila7/claude-code-templates
npx skills add https://github.com/davila7/claude-code-templates --skill cosmic-databaseCOSMIC(癌症体细胞突变目录)是全球最大、最全面的数据库,用于探索人类癌症中的体细胞突变。通过编程方式访问 COSMIC 庞大的癌症基因组学数据集合,包括数千种癌症类型中的数百万个突变、精选基因列表、突变特征谱和临床注释。
此技能应在以下情况下使用:
COSMIC 要求身份验证才能下载数据:
uv pip install requests pandas
使用 scripts/download_cosmic.py 脚本下载 COSMIC 数据文件:
from scripts.download_cosmic import download_cosmic_file
# 下载突变数据
download_cosmic_file(
email="your_email@institution.edu",
password="your_password",
filepath="GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz",
output_filename="cosmic_mutations.tsv.gz"
)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 使用简写数据类型下载
python scripts/download_cosmic.py user@email.com --data-type mutations
# 下载特定文件
python scripts/download_cosmic.py user@email.com \
--filepath GRCh38/cosmic/latest/cancer_gene_census.csv
# 为特定基因组组装下载
python scripts/download_cosmic.py user@email.com \
--data-type gene_census --assembly GRCh37 -o cancer_genes.csv
import pandas as pd
# 读取突变数据
mutations = pd.read_csv('cosmic_mutations.tsv.gz', sep='\t', compression='gzip')
# 读取癌症基因普查
gene_census = pd.read_csv('cancer_gene_census.csv')
# 读取 VCF 格式
import pysam
vcf = pysam.VariantFile('CosmicCodingMuts.vcf.gz')
下载全面的突变数据,包括点突变、插入缺失和基因组注释。
常见数据类型:
mutations - 完整的编码区突变(TSV 格式)mutations_vcf - VCF 格式的编码区突变sample_info - 样本元数据和肿瘤信息# 下载所有编码区突变
download_cosmic_file(
email="user@email.com",
password="password",
filepath="GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz"
)
访问专家精选的约 700 多个有充分证据表明与癌症相关的基因列表。
# 下载癌症基因普查
download_cosmic_file(
email="user@email.com",
password="password",
filepath="GRCh38/cosmic/latest/cancer_gene_census.csv"
)
使用场景:
下载用于突变特征分析的特征谱。
# 下载特征定义
download_cosmic_file(
email="user@email.com",
password="password",
filepath="signatures/signatures.tsv"
)
特征类型:
访问基因融合数据和结构重排。
可用数据类型:
structural_variants - 结构断点fusion_genes - 基因融合事件# 下载基因融合
download_cosmic_file(
email="user@email.com",
password="password",
filepath="GRCh38/cosmic/latest/CosmicFusionExport.tsv.gz"
)
检索拷贝数变异和基因表达数据。
可用数据类型:
copy_number - 拷贝数增益/丢失gene_expression - 过表达/低表达数据# 下载拷贝数数据
download_cosmic_file(
email="user@email.com",
password="password",
filepath="GRCh38/cosmic/latest/CosmicCompleteCNA.tsv.gz"
)
访问带有临床注释的耐药性突变数据。
# 下载耐药性突变
download_cosmic_file(
email="user@email.com",
password="password",
filepath="GRCh38/cosmic/latest/CosmicResistanceMutations.tsv.gz"
)
COSMIC 为两个参考基因组提供数据:
在文件路径中指定组装版本:
# GRCh38(推荐)
filepath="GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz"
# GRCh37(旧版)
filepath="GRCh37/cosmic/latest/CosmicMutantExport.tsv.gz"
latest 以始终获取最新版本v102、v101 等按基因过滤突变:
import pandas as pd
mutations = pd.read_csv('cosmic_mutations.tsv.gz', sep='\t', compression='gzip')
tp53_mutations = mutations[mutations['Gene name'] == 'TP53']
按作用识别癌症基因:
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)]
按癌症类型提取突变:
mutations = pd.read_csv('cosmic_mutations.tsv.gz', sep='\t', compression='gzip')
lung_mutations = mutations[mutations['Primary site'] == 'lung']
处理 VCF 文件:
import pysam
vcf = pysam.VariantFile('CosmicCodingMuts.vcf.gz')
for record in vcf.fetch('17', 7577000, 7579000): # TP53 区域
print(record.id, record.ref, record.alts, record.info)
有关 COSMIC 数据结构、可用文件和字段描述的全面信息,请参阅 references/cosmic_data_reference.md。此参考包括:
在以下情况下使用此参考:
下载脚本包含用于常见操作的辅助函数:
from scripts.download_cosmic import get_common_file_path
# 获取突变文件的路径
path = get_common_file_path('mutations', genome_assembly='GRCh38')
# 返回:'GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz'
# 获取基因普查的路径
path = get_common_file_path('gene_census')
# 返回:'GRCh38/cosmic/latest/cancer_gene_census.csv'
可用快捷方式:
mutations - 核心编码区突变mutations_vcf - VCF 格式突变gene_census - 癌症基因普查resistance_mutations - 耐药性数据structural_variants - 结构变异gene_expression - 表达数据copy_number - 拷贝数变异fusion_genes - 基因融合signatures - 突变特征谱sample_info - 样本元数据latest 获取最新版本COSMIC 数据可与以下工具良好集成:
使用 COSMIC 数据时,请引用:Tate JG, Bamford S, Jubb HC, et al. COSMIC: the Catalogue Of Somatic Mutations In Cancer. Nucleic Acids Research. 2019;47(D1):D941-D947.
每周安装数
118
代码仓库
GitHub 星标数
22.6K
首次出现
2026年1月21日
安全审计
已安装于
claude-code100
opencode93
gemini-cli88
cursor88
antigravity82
codex78
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.
This skill should be used when:
COSMIC requires authentication for data downloads:
uv pip install requests pandas
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"
)
# 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
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')
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_cosmic_file( email="user@email.com", password="password", filepath="GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz" )
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 :
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 :
Access gene fusion data and structural rearrangements.
Available data types :
structural_variants - Structural breakpoints
fusion_genes - Gene fusion events
download_cosmic_file( email="user@email.com", password="password", filepath="GRCh38/cosmic/latest/CosmicFusionExport.tsv.gz" )
Retrieve copy number alterations and gene expression data.
Available data types :
copy_number - Copy number gains/losses
gene_expression - Over/under-expression data
download_cosmic_file( email="user@email.com", password="password", filepath="GRCh38/cosmic/latest/CosmicCompleteCNA.tsv.gz" )
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"
)
COSMIC provides data for two reference genomes:
Specify the assembly in file paths:
# GRCh38 (recommended)
filepath="GRCh38/cosmic/latest/CosmicMutantExport.tsv.gz"
# GRCh37 (legacy)
filepath="GRCh37/cosmic/latest/CosmicMutantExport.tsv.gz"
latest in file paths to always get the most recent releasev102, v101, etc.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)
For comprehensive information about COSMIC data structure, available files, and field descriptions, see references/cosmic_data_reference.md. This reference includes:
Use this reference when:
The download script includes helper functions for common operations:
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 mutationsmutations_vcf - VCF format mutationsgene_census - Cancer Gene Censusresistance_mutations - Drug resistance datastructural_variants - Structural variantsgene_expression - Expression datacopy_number - Copy number alterationsfusion_genes - Gene fusionssignatures - Mutational signaturessample_info - Sample metadatalatest for the most recent versionCOSMIC data integrates well with:
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.
Weekly Installs
118
Repository
GitHub Stars
22.6K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
claude-code100
opencode93
gemini-cli88
cursor88
antigravity82
codex78
智能OCR文字识别工具 - 支持100+语言,高精度提取图片/PDF/手写文本
1,100 周安装
AI上下文管理器 - 优化LLM内存架构与对话历史管理,提升RAG系统效率
161 周安装
Coolify Manager 技能:管理 Coolify 部署,诊断 WordPress 问题,自动化运维
160 周安装
压力测试指南:使用k6和JMeter进行系统极限与崩溃点测试
161 周安装
ASP.NET Core依赖注入模式:扩展方法组织服务注册,提升代码可维护性
159 周安装
NSFC国家自然科学基金申请书研究内容写作工具 - LaTeX自动化编排助手
160 周安装
App Store Connect 参考指南:崩溃分析、TestFlight反馈与性能指标导出
162 周安装