dami82 / mutSignatures

mutSignatures R package - updated (dev) version - 2.1.4
http://www.mutsignatures.org
14 stars 0 forks source link

Question Regarding COSMIC version using getCosmicSignatures() #22

Closed profsprofs1991 closed 1 year ago

profsprofs1991 commented 1 year ago

Hi @dami82,

More than an issue is a question regarding the getCosmicSignatures() function. I noticed when it is used, it pulls the 30 COSMIC SBS signatures, however, when you download directly from Sanger Institute, there are many more (up to SBS94, and many SBS are subdivided , eg SBS7a and SBS7b).

Wanted to know if this is part of the function subsetting to the traditional 30 SBS COSMIC signatures or if there are any way of using the other SBS Signatures.

Thanks a lot again, the package has been extremely useful otherwise,

dami82 commented 1 year ago

Hello. Thanks for using mutSignatures. The getCosmicSignatures() function only supports the retrieval of "ver. 2" COSMIC signatures as defined by the Sanger Institute (legacy signatures, these are a few years old). However, you can easily import and use any set of mutational signatures of interest (e.g., newer versions released by the Sanger Institute) as shown below. The following example retrieves "ver. 3.3" SBS GRCh38 signatures.

  1. Make sure to have the latest version of mutSignatures installed (>= 2.1.5. From GitHub, NOT from CRAN).
  2. Read the data table including the mutational signatures of interest, format it so that columns are signatures and rows are mutation types, and then coerce it to a mutationSignatures object. Please, have a look at the following code.
    sbs_url <- "https://cog.sanger.ac.uk/cosmic-signatures-production/documents/COSMIC_v3.3.1_SBS_GRCh38.txt"
    sbs_df <- read.delim(sbs_url, as.is = TRUE)
    rownames(sbs_df) <- sbs_df$Type
    sbs_df <- sbs_df [, -1]
    sbs_mutSig <- mutSignatures::as.mutation.signatures(sbs_df)
  3. You now have a mutationSignatures object (sbs_mutSig) that you can use in your downstream analyses.
profsprofs1991 commented 1 year ago

Great, thank you so much.