alterlab-cosmic — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited alterlab-cosmic (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
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
# pysam is only needed if you read the VCF-format downloads
uv pip install pysamUse 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="[email protected]",
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 [email protected] --data-type mutations
# Download specific file
python scripts/download_cosmic.py [email protected] \
--filepath GRCh38/cosmic/latest/cancer_gene_census.csv
# Download for specific genome assembly
python scripts/download_cosmic.py [email protected] \
--data-type gene_census --assembly GRCh37 -o cancer_genes.csvimport 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')Every data type downloads through the same download_cosmic_file(...) call shown in Quick Start — only the filepath changes. Use the --data-type shortcut (CLI) or get_common_file_path(...) (Python) to build the path, or pass the filepath directly. See references/cosmic_data_reference.md for full field descriptions.
| Data type | Shortcut | File (GRCh38/cosmic/latest/...) |
|---|---|---|
| Coding mutations | mutations | CosmicMutantExport.tsv.gz |
| Coding mutations (VCF) | mutations_vcf | VCF/CosmicCodingMuts.vcf.gz |
| Cancer Gene Census | gene_census | cancer_gene_census.csv |
| Resistance mutations | resistance_mutations | CosmicResistanceMutations.tsv.gz |
| Structural variants | structural_variants | CosmicStructExport.tsv.gz |
| Gene fusions | fusion_genes | CosmicFusionExport.tsv.gz |
| Copy number | copy_number | CosmicCompleteCNA.tsv.gz |
| Gene expression | gene_expression | CosmicCompleteGeneExpression.tsv.gz |
| Sample metadata | sample_info | CosmicSample.tsv.gz |
| Mutational signatures | signatures | signatures/signatures.tsv |
Notes:
Role in Cancer field to split oncogenes from tumor suppressors (TSG).
Substitution (DBS), and Insertion/Deletion (ID) profiles.
signatures path is assembly-independent (no GRCh38/ prefix).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 releaserelease notes for the current version number rather than assuming it
v102) in thefilepath instead of latest, and record it alongside your results
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'The accepted data_type shortcuts are the ones in the Available Data Types table above.
latest for the most recent versionCOSMIC data integrates well with:
When using COSMIC data, cite the current database paper: Sondka Z, Dhir NB, Carvalho-Silva D, et al. COSMIC: a curated database of somatic variants and clinical data for cancer. Nucleic Acids Research. 2024;52(D1):D1210-D1217. doi:10.1093/nar/gkad986
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.