A simple R script to compute mutational spectra starting from a MAF file. The MAF file must have the following fields:
Variant_Type: values SNP, DNP, INS, DEL used in this repoReference_Allele,Tumor_Seq_Allele2: all values used in this reporef_context: 10bp 5' and 10bp 3' of germline reference variant, including the reference allele. this field is 21bp long for SNP, 20 for INS, and 20+ for DELs.
Usage:
maf="CTF001_BMPCs_170_validated_hg38.merged.maf.txt"
Rscript --vanilla src/spectrum.R \
--maf "${maf}" \
--home src/ \
--mutation_type sbs,dbs,id \
--save all \
--sample test_id
Options:
maf: see above. direct from getzlab pipelinehome: path to spectrum/utils libraries are (in this repo,src)- mutation_type: comma-separated value list among sbs (single base substitution, understood in a 96- trinucleotidic context), dbs (double base substitution, 78-context), id (small insertions and deletions, 83-context).
- save: comma-separated value list of among pdf (figures in a pdf format, 1 page per
mutation_type), and tsv (1 line per maf file, 1 column per context) - sample: convenient field to add a sample_name as a prefix to exported files and inside the tsv in the
samplecolumn