Skip to content

Commit

Permalink
Update latest cosmic database to v3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ShixiangWang committed Nov 14, 2023
1 parent 35d12c6 commit 3eb636c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ inst/extdata/mouse_mm9_gene_info.rds
/doc/
/Meta/
inst/extdata/COSMIC_v3.3_CN_GRCh37.rds
inst/extdata/COSMIC_v3.4_CN_GRCh37.rds
inst/extdata/COSMIC_v3.4_DBS_GRCh37.rds
inst/extdata/COSMIC_v3.4_RNA-SBS_GRCh37.rds
inst/extdata/COSMIC_v3.4_SBS_GRCh37.rds
inst/extdata/COSMIC_v3.4_SV_GRCh38.rds
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# sigminer 2.3.0

- Updated COSMIC database to v3.4. SV and RNA-SBS signatures are included.

```r
get_sig_db("latest_RNA-SBS_GRCh37")
get_sig_db("latest_SV_GRCh38")
```

# sigminer 2.2.2

- Updated pkg doc following the new CRAN feature (thanks to K from the CRAN team).
Expand Down
30 changes: 16 additions & 14 deletions R/get_sig_db.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,25 @@ get_sig_db <- function(sig_db = "legacy") {
package = "sigminer", mustWork = TRUE
)
} else if (startsWith(sig_db, "latest_")) {
latest_version <- "v3.3"
latest_version <- "v3.4"
# v3.2_SBS_GRCh37.txt
sig_db2 <- sub("latest_", "", sig_db)

file_dir <- switch(sig_db,
latest_SBS_GRCh37 = "1908",
latest_DBS_GRCh37 = "1902",
latest_ID_GRCh37 = "1907",
latest_SBS_GRCh38 = "1909",
latest_DBS_GRCh38 = "1903",
latest_SBS_mm9 = "1910",
latest_DBS_mm9 = "1904",
latest_SBS_mm10 = "1911",
latest_DBS_mm10 = "1905",
latest_SBS_rn6 = "1912",
latest_DBS_rn6 = "1906",
latest_CN_GRCh37 = "2044",
latest_SBS_GRCh37 = "2123",
latest_DBS_GRCh37 = "2116",
latest_ID_GRCh37 = "2121",
latest_SBS_GRCh38 = "2124",
latest_DBS_GRCh38 = "2117",
latest_SBS_mm9 = "2125",
latest_DBS_mm9 = "2118",
latest_SBS_mm10 = "2126",
latest_DBS_mm10 = "2119",
latest_SBS_rn6 = "2127",
latest_DBS_rn6 = "2120",
latest_CN_GRCh37 = "2115",
`latest_RNA-SBS_GRCh37` = "2122",
latest_SV_GRCh38 = "2128",
stop("Bad input!")
)

Expand All @@ -153,7 +155,7 @@ get_sig_db <- function(sig_db = "legacy") {
message("The data is not available in local, obtain it from COSMIC: https://cancer.sanger.ac.uk/signatures/downloads/")
data <- tryCatch(
data.table::fread(data_url, data.table = FALSE) %>%
tibble::column_to_rownames("Type") %>%
tibble::column_to_rownames(if (sig_db == "latest_RNA-SBS_GRCh37") "V1" else "Type") %>%
as.matrix(),
error = function(e) {
message(e$message)
Expand Down
2 changes: 1 addition & 1 deletion R/get_sig_similarity.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ get_sig_similarity <- function(Signature, Ref = NULL,
"latest_SBS_mm9", "latest_DBS_mm9",
"latest_SBS_mm10", "latest_DBS_mm10",
"latest_SBS_rn6", "latest_DBS_rn6",
"latest_CN_GRCh37"
"latest_CN_GRCh37", "latest_RNA-SBS_GRCh37", "latest_SV_GRCh38"
),
db_type = c("", "human-exome", "human-genome"),
method = "cosine",
Expand Down
2 changes: 1 addition & 1 deletion R/sig_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ sig_fit <- function(catalogue_matrix,
"latest_SBS_mm9", "latest_DBS_mm9",
"latest_SBS_mm10", "latest_DBS_mm10",
"latest_SBS_rn6", "latest_DBS_rn6",
"latest_CN_GRCh37"
"latest_CN_GRCh37", "latest_RNA-SBS_GRCh37", "latest_SV_GRCh38"
),
db_type = c("", "human-exome", "human-genome"),
show_index = TRUE,
Expand Down

0 comments on commit 3eb636c

Please sign in to comment.