diff --git a/DESCRIPTION b/DESCRIPTION index 8fe2607b..a29a5b4a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -82,7 +82,7 @@ Suggests: roxygen2, scales, synchronicity, - testthat, + testthat (>= 3.0.0), tibble, UCSCXenaTools LinkingTo: @@ -95,3 +95,4 @@ LazyData: true Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd", "roxytest::testthat_roclet")) RoxygenNote: 7.2.3 +Config/testthat/edition: 3 diff --git a/R/get_sig_db.R b/R/get_sig_db.R index a9b8056e..a0f4b30f 100644 --- a/R/get_sig_db.R +++ b/R/get_sig_db.R @@ -11,16 +11,17 @@ #' - SBS and RS (rearrangement) signatures from Nik lab 2020 Nature Cancer paper. #' - RS signatures from BRCA560 and USARC cohorts. #' - Copy number signatures from USARC cohort and TCGA. +#' - Copy number signatures from Liu lab 2023. It supports both PCAWG and TCGA cohort. #' @inheritParams get_sig_similarity #' #' @return a `list`. #' @export #' @seealso [get_sig_similarity], [sig_fit] and [show_cosmic_sig_profile]. #' @references -#' - Steele, Christopher D., et al. "Signatures of copy number alterations in human cancer." bioRxiv (2021). +#' - Steele, Christopher D., et al. "Signatures of copy number alterations in human cancer." Nature 606.7916 (2022): 984-991. #' - Alexandrov, Ludmil B., et al. "The repertoire of mutational signatures in human cancer." Nature 578.7793 (2020): 94-101. #' - Steele, Christopher D., et al. "Undifferentiated sarcomas develop through distinct evolutionary pathways." Cancer Cell 35.3 (2019): 441-456. -#' +#' - Ziyu Tao, et al. "The repertoire of copy number alteration signatures in human cancer." Briefings in Bioinformatics (2023): bbad053. #' @examples #' s1 <- get_sig_db() #' s2 <- get_sig_db("SBS") @@ -33,6 +34,8 @@ #' s9 <- get_sig_db("RS_Nik_lab") #' s10 <- get_sig_db("CNS_USARC") #' s11 <- get_sig_db("CNS_TCGA") +#' s12 <- get_sig_db("CNS_TCGA176") +#' s13 <- get_sig_db("CNS_PCAWG176") #' s1 #' s2 #' s3 @@ -44,6 +47,8 @@ #' s9 #' s10 #' s11 +#' s12 +#' s13 #' @testexamples #' expect_is(s1, "list") #' expect_is(s2, "list") @@ -56,6 +61,8 @@ #' expect_is(s9, "list") #' expect_is(s10, "list") #' expect_is(s11, "list") +#' expect_is(s12, "list") +#' expect_is(s13, "list") get_sig_db <- function(sig_db = "legacy") { db_file <- switch(sig_db, legacy = system.file("extdata", "legacy_signatures.RDs", @@ -88,6 +95,12 @@ get_sig_db <- function(sig_db = "legacy") { CNS_TCGA = system.file("extdata", "CNS_signatures_TCGA.rds", package = "sigminer", mustWork = TRUE ), + CNS_TCGA176 = system.file("extdata","CNS_signatures_TCGA176.rds", + package = "sigminer", mustWork = TRUE + ), + CNS_PCAWG176 = system.file("extdata", "CNS_signatures_PCAWG176.rds", + package = "sigminer", mustWork = TRUE + ), DBS = system.file("extdata", "DBS_signatures.rds", package = "sigminer", mustWork = TRUE ), diff --git a/R/get_sig_similarity.R b/R/get_sig_similarity.R index 743ba704..f6cf8f76 100644 --- a/R/get_sig_similarity.R +++ b/R/get_sig_similarity.R @@ -23,7 +23,8 @@ #' "SBS_Nik_lab", "RS_Nik_lab" to refer reference signatures from #' Degasperi, Andrea, et al. (2020) (reference #2); #' "RS_BRCA560", "RS_USARC" to reference signatures from BRCA560 and USARC cohorts; -#' "CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA. +#' "CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA; +#' "CNS_TCGA176" (176 categories) and "CNS_PCAWG176" (176 categories) to reference copy number signatures from PCAWG and TCGA separately. #' **UPDATE**, the latest version of reference version can be automatically #' downloaded and loaded from #' when a option with `latest_` prefix is specified (e.g. "latest_SBS_GRCh37"). @@ -56,7 +57,7 @@ #' #' Nik-Zainal, Serena, et al. "Landscape of somatic mutations in 560 breast cancer whole-genome sequences." Nature 534.7605 (2016): 47-54. #' -#' Steele, Christopher D., et al. "Signatures of copy number alterations in human cancer." bioRxiv (2021). +#' Steele, Christopher D., et al. "Signatures of copy number alterations in human cancer." Nature 606.7916 (2022): 984-991. #' @return a `list` containing smilarities, aetiologies if available, best match and RSS. #' @export #' @@ -102,7 +103,9 @@ get_sig_similarity <- function(Signature, Ref = NULL, sig_db = c( "SBS", "legacy", "DBS", "ID", "TSB", "SBS_Nik_lab", "RS_Nik_lab", - "RS_BRCA560", "RS_USARC", "CNS_USARC", "CNS_TCGA", + "RS_BRCA560", "RS_USARC", + "CNS_USARC", "CNS_TCGA", + "CNS_TCGA176","CNS_PCAWG176", "SBS_hg19", "SBS_hg38", "SBS_mm9", "SBS_mm10", "DBS_hg19", "DBS_hg38", "DBS_mm9", "DBS_mm10", "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", diff --git a/R/sig_fit.R b/R/sig_fit.R index 11c83044..a59b3a13 100644 --- a/R/sig_fit.R +++ b/R/sig_fit.R @@ -100,7 +100,9 @@ sig_fit <- function(catalogue_matrix, sig_db = c( "legacy", "SBS", "DBS", "ID", "TSB", "SBS_Nik_lab", "RS_Nik_lab", - "RS_BRCA560", "RS_USARC", "CNS_USARC", "CNS_TCGA", + "RS_BRCA560", "RS_USARC", + "CNS_USARC", "CNS_TCGA", + "CNS_TCGA176","CNS_PCAWG176", "SBS_hg19", "SBS_hg38", "SBS_mm9", "SBS_mm10", "DBS_hg19", "DBS_hg38", "DBS_mm9", "DBS_mm10", "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", diff --git a/data-raw/CNV_signatures.txt b/data-raw/CNV_signatures.txt deleted file mode 100644 index a94a7fcc..00000000 --- a/data-raw/CNV_signatures.txt +++ /dev/null @@ -1,49 +0,0 @@ - CN1 CN2 CN3 CN4 CN5 CN6 CN7 CN8 CN9 CN10 CN11 CN12 CN13 CN14 CN15 CN16 CN17 CN18 CN19 -0:homdel:0-100kb 0.00179505388970679 0.00223767432853288 0.0640442425617697 0.0009662800193256 0.0258224902402731 0.00349249975552502 0 0.0002162600043252 0.00818184176814676 0.0077952399220476 0.0016137400161374 0.0230933802309338 0.00854254994580625 0.0036673 0.0013666799863332 0.00110894 0.0059147200591472 4.078e-05 5.5e-07 -0:homdel:100kb-1Mb 0.00380710395071105 0.0071957876210595 0.00640384025615361 0.000219550004391 0.0249935703104507 0.00755030947147834 0 0.0007209750144195 0.0209991890730918 0.0312253196877468 0.005902700059027 0.0527247705272477 0.0182088348264993 0.00109281 0.0014312299856877 0.00303045 0.0067739800677398 0.00017845 0.00022928 -0:homdel:>1Mb 0.00243674609794896 0.00383710801179133 0.0130334305213372 6.12400012248e-05 0.0038887000742626 0.00133616990646811 0 0.0002693400053584 0.00900921906579627 0.0045588099544119 0.0031308100313081 0.006866100068661 0.0005091399972487 0.04053983 0.001453299985467 0.0007584 0.004110500041105 0.00011722 0.00135207 -1:LOH:0-100kb 0.00284044915285461 0.00282653598560028 0.0622135824885433 0.0561507711230154 0.0158291151398293 0.00595582958309193 0.00011082 0.0009504050155768 0.0185836518480638 0.0087975299120247 0.002754300027543 0.0218235402182354 0.0036724949824481 0.00142666 0.0021142699788573 0.0015556 0.0104156901041569 0.00050182 0.0002482 -1:LOH:100kb-1Mb 0.0122630566305438 0.00632391461734855 0.0126148205045928 0.247798924955978 0.0265449402928998 0.0105207592635469 0.0050408 0.0072836301456726 0.130807871527327 0.0397452296025477 0.006231700062317 0.0659770106597701 0.0145658597456583 0.00580905 0.0050720499492795 0.00141876 0.0642937506429375 0.00081924 0.0123588 -1:LOH:1Mb-10Mb 0.0191634178931632 0.00102376399756159 0.0192834607713384 0.0833693416673868 0.0013580300070385 0.000991509930594305 7.442e-05 0.0022049050440981 0.159949199370283 0.0109152498908475 0.0177507101775071 0.0042345500423455 0.0062196198756186 0.00343106 0.018688399813116 0.00028103 0.0377706203777062 0.00624116 0.05642821 -1:LOH:10Mb-40Mb 0.0472977573216536 0.000483364338306154 0.00871990034879601 0.0001009600020192 0.00057368500717215 0.000409939971304202 2e-08 0.003664150073283 0.0762293551193326 0.0029042799709572 0.0018415400184154 4.03300004033e-05 0.00183076996389635 0.00204512 0.0055029499449705 8e-08 0.0210537802105378 0.00283775 0.04607252 -1:LOH:>40Mb 0.0736459985159488 0.000124321667725803 0.00409212016368481 0.0023037800460756 8.099499986625e-05 0.000179169987458101 0 0.0060893151217863 0.0270006927812622 0.0014839799851602 5.75400005754e-05 4.6400000464e-06 0.0017032049659989 0.00064424 1.3399999866e-06 1.65e-06 0.0017409700174097 1.202e-05 0.01887089 -2:LOH:0-100kb 0.00118798435049394 0.00248891664575713 0.0013884900555396 0.014146300282926 0.0133515000616856 0.0192514486523986 0.00277607 0.0111158400903687 0.00411905725231267 0.0063572599364274 0.0014890100148901 0.0059069600590696 0.00047236499059195 0.00067984 0.0005589299944107 0.00273632 0.0056633400566334 0.00060974 0.00070358 -2:LOH:100kb-1Mb 0.00430310172437017 0.0194648691851649 0.0338351413534057 0.0400893808017876 0.255496412069659 0.177292157589549 0.0045434 0.0222829002831981 0.0137742326732473 0.0878235391217646 0.0169449601694496 0.0809364808093648 0.0130839397383372 0.01758306 0.0006226899937731 0.0065518 0.0548964405489644 0.00134094 0.06234918 -2:LOH:1Mb-10Mb 0.00443801258674155 0.0335515428050867 0.0189905807596232 0.0061800901236018 0.264575823642576 0.1163828518532 0.00457336 0.0082983201651402 0.011594392671514 0.131910498680895 0.043920200439202 0.13267104132671 0.0277145045698409 0.01162738 0.0844423291555767 0.00018517 0.117067141170671 0.01443458 0.03913487 -2:LOH:10Mb-40Mb 0.00431859046390283 0.0522911747304268 0.0026749701069988 0.0002451600049032 0.0670658914703041 0.00632480955726333 4.105e-05 0.0011593800231876 0.00494515180366946 0.0870698291293017 0.0246761402467614 0.176727891767279 0.0619040446396096 0.00291477 0.0884832791151672 0.00015695 0.0418877204188772 0.0096627 0.00129894 -2:LOH:>40Mb 0.0122156535662662 0.067374759874857 8.23700032948001e-05 0.0024150200483004 0.0196164904498135 0.000260929981734901 0 0.0001319700026289 0.00240730454449305 0.0159339498406605 0.0112114901121149 0.136224511362245 0.283071265872742 0.00170498 0.007503799924962 7.257e-05 0.0338987903389879 0.00049936 0.00195567 -3-4:LOH:0-100kb 0.00137994739478047 0.0027174020016649 0.002719100108764 0.0140256602805132 0.00548025505847605 0.00505182964637192 0.00420447 0.0095647200821776 0.00183352908533829 0.0074381199256188 0.0015820900158209 0.0093025300930253 0.0044437800727639 0.00093853 0.0026739499732605 0.00226406 0.0138826401388264 0.002561 0.00053506 -3-4:LOH:100kb-1Mb 0.00166785303474209 0.0138194450537865 0.0238112209524488 0.0114402102288042 0.0268557702561035 0.0135102790542805 0.0023279 0.004662895052984 0.00284860454086671 0.068455299315447 0.048241900482419 0.0307185203071852 0.0213815199043739 0.02159759 0.0237552697624473 0.01402709 0.0125857201258572 0.02182453 2.091e-05 -3-4:LOH:1Mb-10Mb 0.00151428434744227 0.0124713890143716 0.0343676713747069 0.000107850002157 0.0295190456009488 0.00409703971320722 0.00021573 0.0034921500698428 0.0034435099891423 0.0964666390353336 0.156264721562647 0.0400522704005227 0.00951742006832311 0.043701 0.0946273090537269 0.05963823 0.0011079300110793 0.02055562 0.00277049 -3-4:LOH:10Mb-40Mb 0.000102202609505552 0.0106312386349254 0.021891550875662 1.00000002e-07 0.0045520901203037 5.60699960751003e-05 7.9e-07 0.0021940950434204 0.00139000727285068 0.0475480895245191 0.0552741605527416 0.0260601802606018 0.0010458549855644 0.0329184 0.0518361494816385 0.07185141 0.0027804700278047 0.0022434 0.00027444 -3-4:LOH:>40Mb 0.00736760915942844 0.0174269220175299 0.0252947910117916 1.300000026e-07 0.000735890019262701 0.000328549977001502 6.74e-06 0.0033991150570444 0.00119860090544375 0.0131982798680172 0.0350921803509218 0.0165901501659015 0.00324914507931785 0.19071235 0.0022431099775689 0.05059881 0.0042111700421117 0.00094554 0.00172068 -5-8:LOH:0-100kb 0.000351297826027813 0.00168941133709186 5.30000021200001e-07 0.0255271705105434 0.0006645299943433 0.000489489965735702 0.00552275 0.0107704750869881 0.000375937273354491 0.0026039099739609 0.0050122300501223 0.0057828600578286 0.00106633997913145 0.0034784 0.0012855399871446 0.00482129 2.58700002587e-05 0.00091844 2.5e-07 -5-8:LOH:100kb-1Mb 0.000212106955336344 0.00341625302019785 0.0025695601027824 0.0016927300338546 0.00065250499777695 0.000310459978267801 0.00682636 0.0096752851115774 0.000836165453962273 0.0220780897792191 0.0421743204217432 0.0020866600208666 0.00056322001459585 0.00980644 0.0072657899273421 0.02136849 8.1400000814e-06 0.00241053 5.463e-05 -5-8:LOH:1Mb-10Mb 0.000207783479120987 0.00449530566257901 0.00554920022196801 1.900000038e-07 0.00027818500416155 0.000214349984995501 6.776e-05 0.0021558400425252 0.000661617270461018 0.0202234497977655 0.0735717907357179 0.0032283800322838 0.0015051950451401 0.01073875 0.0183600498163995 0.04681185 1.57800001578e-05 0.00524955 1.666e-05 -5-8:LOH:10Mb-40Mb 9.97152174631826e-05 0.00275604232722863 7.10000028400001e-07 1.31400002628e-05 0.00012570500237695 0.000117709991760301 0 0.0010228350189757 0.0003764863605223 0.0067966499320335 0.0153266301532663 0.0016361700163617 0.0004022700120411 0.00622641 0.0050294699497053 0.02208834 0.0006887600068876 0.00029923 3.6e-07 -5-8:LOH:>40Mb 0.000331938261447213 0.0100896243491568 0.00535955021438201 1.400000028e-07 9.87500029621001e-05 0.000304059978715801 4.933e-05 0.0014596200167842 0.000382634545020873 0.0001728899982711 0.0034732300347323 0.0011001600110016 0.0116161001679535 0.01067078 1.2899999871e-06 0.00536994 0.0001204100012041 0.00012116 3.896e-05 -9+:LOH:0-100kb 0.000133994782829626 0.00052019600288274 7.10000028400001e-07 1.05600002112e-05 0.00131259502216805 0.00493141965480062 0.00632901 0.0220433151249994 0.000759423639521455 0.0001853099981469 0.0006201300062013 0.0004868800048688 2.60950007646e-05 0.00384194 0.0001246799987532 0.00241473 0.0010716800107168 0.00014531 3.6e-07 -9+:LOH:100kb-1Mb 0.000411987828499157 0.00066864300172857 0.0021619600864784 2.800000056e-07 0.0033062500572351 0.00545953961783223 0.02139771 0.0283815152285296 0.00123437363785347 0.002996599970034 0.0116008801160088 0.0001118800011188 0.0001174099984138 0.0047163 5.30199994698e-05 0.01211638 0.0011782600117826 0.00085741 3.97e-06 -9+:LOH:1Mb-10Mb 0.00020077000108427 0.000828997325367127 0.002206600088264 2.800000056e-07 0.00064922499703415 0.000867159939298804 0.01464548 0.0080947301183245 0.000574561822044091 0.0036502199634978 0.0222486402224864 0.0001201900012019 9.96999988235e-06 2.35e-06 1.36899998631e-05 0.01534961 1.600000016e-07 0.00046208 8.476e-05 -9+:LOH:10Mb-40Mb 6.51478263912174e-06 0.000350903002866087 0.002112900084516 2.800000056e-07 1.513500045205e-05 1.26799991124001e-05 6.1e-07 2.52650005041e-05 1.01900000202091e-05 0.0004455799955442 0.0025288500252885 6.13900006139e-05 2.46500003245e-06 2.35e-06 5.29199994708e-05 0.0009794 1.600000016e-07 0.0001094 1.589e-05 -9+:LOH:>40Mb 2.75782609902174e-06 0.000712768005069613 0.000927550037102001 2.800000056e-07 1.23100003687e-05 3.39999976200002e-05 2e-08 0.0001117900022354 4.5545454236e-06 8.99999991e-08 0.0014878800148788 1.64700001647e-05 1.893500050205e-05 0.00333085 2.899999971e-07 7.7e-07 4.66200004662e-05 1.071e-05 5.384e-05 -2:het:0-100kb 0.000126855217060544 0.00107728332400217 0.02085150083406 0.0001832100036642 0.0017338699898295 0.00356139975070202 0.00021658 0.0010385000041606 0.00281376272353549 0.0021392599786074 0 0.0006844800068448 0.00263211995278935 0.00266672 0.0003860799961392 0.00029759 0.003118100031181 0.00053199 0.00030646 -2:het:100kb-1Mb 0.00239269216510174 0.00144857499351072 0.0113719804548792 0.000930600018612 0.0083596599379462 0.00180745987347781 0.00209292 0.0008892000005614 0.0574567342539272 0.0046028299539717 1.00000001e-08 0.0031313300313133 0.00068981998696485 0.00197375 0.000188799998112 3.02e-05 0.031228300312283 0.00464189 0.01868806 -2:het:1Mb-10Mb 0.017226427424718 0.000571467668128474 0.023632350945294 0.0012427100248542 0.047988819735162 0.00862874939598754 0.00016457 0.0023290350226828 0.159920320844107 0.000692899993071 0 0.0041048200410482 0.0008556549829119 0.00185384 0.0008738399912616 1.1e-07 0.016426600164266 0.00278654 0.12630567 -2:het:10Mb-40Mb 0.11204388628578 0.00040126999664122 0.0243278209731128 0.0065302101306042 0.0401899100271285 0.00893151937479364 0 0.0026749400501629 0.129543643222982 0.0007836199921638 3.9300000393e-06 0.001078200010782 0.0009373599813268 0.00136271 0.0006178899938211 3.4e-07 0.0045268700452687 0.0013967 0.20984675 -2:het:>40Mb 0.647548237436108 1.61666666477333e-06 0.0227887609115504 0.0472108209442164 6.1500001185e-07 0.00200752985947291 3.1e-07 0.0021614050432225 0.00676787108794292 5.99999994e-08 8.00000008e-08 4.300000043e-07 0.00410844991786925 7.5e-07 0 3.2e-07 4.600000046e-07 8.15e-06 0.07227018 -3-4:het:0-100kb 0.000986436966092696 0.00130161266080664 0.016759400670376 0.0283977205679544 0.00429509499173965 0.00949946933503715 0.00362014 0.0135515451422438 0.00668677815846478 0.0055708399442916 0.0004222900042229 0.0049500000495 0.0011979899760607 0.00179605 0.0001591699984083 0.00117086 0.0170104601701046 0.00077956 0.00800623 -3-4:het:100kb-1Mb 0.00362314698166206 0.015217479637129 0.0426479917059197 0.203288654065773 0.0273863248544784 0.205503725614739 0.06003456 0.0413911803006613 0.0674713176760732 0.0417762195822378 6.500000065e-06 0.0093699100936991 0.00790110002509875 0.02323495 0.0018804299811957 0.0120089 0.205701382057014 0.08651517 0.27819348 -3-4:het:1Mb-10Mb 0.00173458739980441 0.0581564298534226 0.0276206111048244 0.0556759911135198 0.0154011251298442 0.233334903666557 0.12143735 0.0261931351598558 0.0435108642709374 0.0869563591304364 0.0176333501763335 0.0181212601812126 0.0572365705589556 0.01723295 0.185038198149618 0 0.122306121223061 0.33498798 0.03014244 -3-4:het:10Mb-40Mb 0.0030095421986957 0.135200883070673 0.0185054407402176 0.003409950068199 0.0203845804898656 0.0629906555906541 0.00493032 0.0049560700931407 0.00753037545756695 0.0675799493242005 0.0076133700761337 0.100679891006799 0.0713858608493538 0.00618312 0.188270228117298 0.00227849 0.0759359507593595 0.16201175 0.0061488 -3-4:het:>40Mb 0.00537392479707207 0.390284779081082 1.800000072e-07 0.0047273100945462 0.00297415508407925 0.00240526983163111 0.00022509 0.0241685202858633 0.00287618460786981 9.9999999e-09 6.20300006203e-05 0.0009036500090365 0.352795454288886 0.00048235 0.00053599999464 0.02652536 0.0025608400256084 0.00119273 2.8e-07 -5-8:het:0-100kb 0.000741211739085522 0.00171720066215018 0.00551728022069121 0.0686062413721248 0.00336830501398355 0.00362531974622762 0.01467759 0.0326179753058171 0.00171967180297676 0.0059620799403792 2.94500002945e-05 0.0004479400044794 0.0005532899900322 0.01032126 0.0004962099950379 0.00230818 0.0018513300185133 0.015153 0.00031093 -5-8:het:100kb-1Mb 0.000116379997825296 0.0116304115709387 0.0395237415809497 0.0568657611373152 0.00720901493463165 0.00454923968155322 0.16196039 0.127337371404407 0.0013502100115523 0.0400566595994334 0.043802700438027 0.0078349700783497 0.0006576149990447 0.04438502 0.012403599875964 0.02222437 0.0278089602780896 0.14454268 0.00022234 -5-8:het:1Mb-10Mb 0.00020400217390953 0.0193355479083318 0.162603386504135 0.0113451102269022 0.00830954494086235 0.00205141985640061 0.21136197 0.0612414808255212 0.00113610546830412 0.0121090798789092 0.185368841853688 0.0015635100156351 0.0001404700042141 0.08961901 0.12902795870972 0.14409608 0.0216142602161426 0.10976846 9.72e-06 -5-8:het:10Mb-40Mb 1.93486956274217e-05 0.0256416712952565 0.122266014890641 0.0046315200926304 0.000973130008842101 0.000264269981501101 0.0048432 0.00836119516503 0.000468091818196755 0.0018386599816134 0.057285500572855 0.0013127900131279 0.00033354001000595 0.08336645 0.0551666294483337 0.18136026 0.0034469600344696 0.01800115 0.00012714 -5-8:het:>40Mb 0.000525661739173026 0.0441748070746252 0.0769365630774625 1.00000002e-08 0.0012768400382912 2.18999984670001e-05 0.00032996 0.0045285650874426 0.0004135518118722 0 0.0164953901649539 0.0006967100069671 0.00204562003152835 0.25307107 9.9999999e-09 0.09531375 2.300000023e-07 0.00182344 0.00247148 -9+:het:0-100kb 0.000105258261933196 0.000991451007936054 0.0025461801018472 5.16300010326e-05 0.00302902502894695 0.0167008988309371 0.02554054 0.0949474555689958 0.00168183001348604 0.0004710299952897 1.00000001e-08 2.48400002484e-05 1.2800000139e-06 0.00338768 5.39099994609e-05 0.0093412 0.0050395600503956 0.0035707 5.991e-05 -9+:het:100kb-1Mb 0.000318177391321617 0.00324100962706138 0.0017438300697532 2.15100004302e-05 0.00738561995063 0.043428956959973 0.16018674 0.266746762108847 0.0042520609300749 0.000251199997488 8.1300000813e-06 0.0001816600018166 8.60000023050001e-07 0.0033166 7.48599992514e-05 0.05049958 0.0048479700484797 0.00971177 0.00011614 -9+:het:1Mb-10Mb 0.000187035217402435 0.00377986464128337 7.10000028400001e-07 2.600000052e-07 0.006117539940007 0.00489713965720022 0.14906452 0.110528846327574 0.000808817272958828 9.9999999e-09 0.0527943205279432 0.0001602700016027 9.05000025900001e-07 0.00998959 0.0001389899986101 0.08409049 0.0133215801332158 0.00568101 3.6e-07 -9+:het:10Mb-40Mb 1.74304348222609e-06 0.00190840434394782 0.0019746200789848 2.400000048e-07 6.79400011268e-05 3.35799976494002e-05 0.00053612 0.0018099250361383 3.11663634345182e-05 0.0001215299987847 0.0060575200605752 0.0001319300013193 2.03150005807e-05 0.00316669 0.0001234099987659 0.01848061 1.56300001563e-05 0.00085042 0.00015659 -9+:het:>40Mb 1.17552173930391e-05 0.00209996035074306 0.0020310800812432 1.47400002948e-05 9.30000027890001e-05 2.35699983501001e-05 2.253e-05 0.0010858550217163 2.92863633713909e-05 0.0003077699969223 0.000392100003921 3.55100003551e-05 4.14100012178e-05 0.0067409 9.9999999e-09 0.00241512 2.72200002722e-05 3.526e-05 2.306e-05 diff --git a/data-raw/Cohort-CNS.R b/data-raw/Cohort-CNS.R index b7d7f500..e2528e30 100644 --- a/data-raw/Cohort-CNS.R +++ b/data-raw/Cohort-CNS.R @@ -71,7 +71,7 @@ download.file("https://raw.githubusercontent.com/AlexandrovLab/SigProfilerExtrac library(tidyverse) # Extracting from 9873 primary cancer samples -# ref: https://www.biorxiv.org/content/10.1101/2021.04.30.441940v1.full +# ref: https://www.nature.com/articles/s41586-022-04738-6 # data source: https://github.com/AlexandrovLab/SigProfilerExtractor/tree/master/SigProfilerExtractor/data cns <- read_tsv("data-raw/CNV_signatures.txt") colnames(cns)[1] <- "class" @@ -84,7 +84,7 @@ CNS_TCGA <- list( db = as.matrix(cns), aetiology = data.frame( V1 = colnames(cns), - V2 = "See https://doi.org/10.1101/2021.04.30.441940" + V2 = "See https://www.nature.com/articles/s41586-022-04738-6" ) %>% tibble::column_to_rownames("V1") %>% setNames("aetiology"), date = "2021/07/23" ) @@ -95,4 +95,38 @@ CNS_TCGA = readRDS("inst/extdata/CNS_signatures_TCGA.rds") CNS_TCGA$aetiology$aetiology = "See https://cancer.sanger.ac.uk/signatures/cn/" saveRDS(CNS_TCGA, file = "inst/extdata/CNS_signatures_TCGA.rds") +# PCAWG CNS --------------------------------------------------------------- +# Ref: https://doi.org/10.1093/bib/bbad053 +library(readxl) +pcawgcns <- read_excel("data-raw/PCAWG.CNS.xlsx") %>% + tibble::column_to_rownames(var = "class") +colnames(pcawgcns) <- gsub("CNS", "PCAWG_CNS", colnames(pcawgcns)) + +CNS_PCAWG <- list( + db = as.matrix(pcawgcns), + aetiology = data.frame( + V1 = colnames(pcawgcns), + V2 = "See https://doi.org/10.1093/bib/bbad053" + ) %>% tibble::column_to_rownames("V1") %>% setNames("aetiology"), + date = "2023/03/17" +) + +saveRDS(CNS_PCAWG, file = "inst/extdata/CNS_signatures_PCAWG176.rds") + +# TCGA CNS --------------------------------------------------------------- +# Ref: https://doi.org/10.1093/bib/bbad053 +tcgacns <- read_excel("data-raw/TCGA.CNS.xlsx") %>% + tibble::column_to_rownames(var = "class") +colnames(tcgacns) <- gsub("Sig", "TCGA_CNS", colnames(tcgacns)) + +CNS_TCGA <- list( + db = as.matrix(tcgacns), + aetiology = data.frame( + V1 = colnames(tcgacns), + V2 = "See https://doi.org/10.1093/bib/bbad053" + ) %>% tibble::column_to_rownames("V1") %>% setNames("aetiology"), + date = "2023/03/17" +) + +saveRDS(CNS_TCGA, file = "inst/extdata/CNS_signatures_TCGA176.rds") diff --git a/data-raw/PCAWG.CNS.xlsx b/data-raw/PCAWG.CNS.xlsx new file mode 100644 index 00000000..4db387d8 Binary files /dev/null and b/data-raw/PCAWG.CNS.xlsx differ diff --git a/data-raw/TCGA.CNS.xlsx b/data-raw/TCGA.CNS.xlsx new file mode 100644 index 00000000..d378c8c5 Binary files /dev/null and b/data-raw/TCGA.CNS.xlsx differ diff --git a/inst/extdata/CNS_signatures_PCAWG176.rds b/inst/extdata/CNS_signatures_PCAWG176.rds new file mode 100644 index 00000000..64f780c5 Binary files /dev/null and b/inst/extdata/CNS_signatures_PCAWG176.rds differ diff --git a/inst/extdata/CNS_signatures_TCGA176.rds b/inst/extdata/CNS_signatures_TCGA176.rds new file mode 100644 index 00000000..496ee8af Binary files /dev/null and b/inst/extdata/CNS_signatures_TCGA176.rds differ diff --git a/man/bp.Rd b/man/bp.Rd index 176fa106..3ebd3572 100644 --- a/man/bp.Rd +++ b/man/bp.Rd @@ -185,7 +185,11 @@ If it is \code{NULL} (default), all will be returned.} \item{right_color}{color for right axis.} -\item{left_shape, right_shape, shape_size}{shape setting.} +\item{left_shape}{shape setting.} + +\item{right_shape}{shape setting.} + +\item{shape_size}{shape setting.} \item{highlight}{a \code{integer} to highlight a \code{x}.} diff --git a/man/centromeres.mm9.Rd b/man/centromeres.mm9.Rd index 86828c39..aef785e4 100644 --- a/man/centromeres.mm9.Rd +++ b/man/centromeres.mm9.Rd @@ -9,9 +9,7 @@ A data.frame } \source{ Generate from \url{https://hgdownload.soe.ucsc.edu/goldenPath/mm9/database/} -with code: - -\if{html}{\out{
}}\preformatted{for i in $(seq 1 19) X Y; +with code:\if{html}{\out{
}}\preformatted{for i in $(seq 1 19) X Y; do wget https://hgdownload.soe.ucsc.edu/goldenPath/mm9/database/chr$\{i\}_gap.txt.gz done diff --git a/man/get_sig_db.Rd b/man/get_sig_db.Rd index 04bc0adb..13e0bc39 100644 --- a/man/get_sig_db.Rd +++ b/man/get_sig_db.Rd @@ -17,7 +17,8 @@ In addition, it can be one of "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "SBS_Nik_lab", "RS_Nik_lab" to refer reference signatures from Degasperi, Andrea, et al. (2020) (reference #2); "RS_BRCA560", "RS_USARC" to reference signatures from BRCA560 and USARC cohorts; -"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA. +"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA; +"CNS_TCGA176" (176 categories) and "CNS_PCAWG176" (176 categories) to reference copy number signatures from PCAWG and TCGA separately. \strong{UPDATE}, the latest version of reference version can be automatically downloaded and loaded from \url{https://cancer.sanger.ac.uk/signatures/downloads/} when a option with \code{latest_} prefix is specified (e.g. "latest_SBS_GRCh37"). @@ -42,6 +43,7 @@ mainly obtained from COSMIC database \item SBS and RS (rearrangement) signatures from Nik lab 2020 Nature Cancer paper. \item RS signatures from BRCA560 and USARC cohorts. \item Copy number signatures from USARC cohort and TCGA. +\item Copy number signatures from Liu lab 2023. It supports both PCAWG and TCGA cohort. } } \examples{ @@ -56,6 +58,8 @@ s8 <- get_sig_db("RS_USARC") s9 <- get_sig_db("RS_Nik_lab") s10 <- get_sig_db("CNS_USARC") s11 <- get_sig_db("CNS_TCGA") +s12 <- get_sig_db("CNS_TCGA176") +s13 <- get_sig_db("CNS_PCAWG176") s1 s2 s3 @@ -67,12 +71,15 @@ s8 s9 s10 s11 +s12 +s13 } \references{ \itemize{ -\item Steele, Christopher D., et al. "Signatures of copy number alterations in human cancer." bioRxiv (2021). +\item Steele, Christopher D., et al. "Signatures of copy number alterations in human cancer." Nature 606.7916 (2022): 984-991. \item Alexandrov, Ludmil B., et al. "The repertoire of mutational signatures in human cancer." Nature 578.7793 (2020): 94-101. \item Steele, Christopher D., et al. "Undifferentiated sarcomas develop through distinct evolutionary pathways." Cancer Cell 35.3 (2019): 441-456. +\item Ziyu Tao, et al. "The repertoire of copy number alteration signatures in human cancer." Briefings in Bioinformatics (2023): bbad053. } } \seealso{ diff --git a/man/get_sig_similarity.Rd b/man/get_sig_similarity.Rd index 5b8edfe1..0b6f4303 100644 --- a/man/get_sig_similarity.Rd +++ b/man/get_sig_similarity.Rd @@ -8,12 +8,12 @@ get_sig_similarity( Signature, Ref = NULL, sig_db = c("SBS", "legacy", "DBS", "ID", "TSB", "SBS_Nik_lab", "RS_Nik_lab", - "RS_BRCA560", "RS_USARC", "CNS_USARC", "CNS_TCGA", "SBS_hg19", "SBS_hg38", "SBS_mm9", - "SBS_mm10", "DBS_hg19", "DBS_hg38", "DBS_mm9", "DBS_mm10", "SBS_Nik_lab_Organ", - "RS_Nik_lab_Organ", "latest_SBS_GRCh37", "latest_DBS_GRCh37", "latest_ID_GRCh37", - "latest_SBS_GRCh38", "latest_DBS_GRCh38", "latest_SBS_mm9", "latest_DBS_mm9", - "latest_SBS_mm10", "latest_DBS_mm10", "latest_SBS_rn6", "latest_DBS_rn6", - "latest_CN_GRCh37"), + "RS_BRCA560", "RS_USARC", "CNS_USARC", "CNS_TCGA", "CNS_TCGA176", "CNS_PCAWG176", + "SBS_hg19", "SBS_hg38", "SBS_mm9", "SBS_mm10", "DBS_hg19", "DBS_hg38", "DBS_mm9", + "DBS_mm10", "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "latest_SBS_GRCh37", + "latest_DBS_GRCh37", "latest_ID_GRCh37", "latest_SBS_GRCh38", "latest_DBS_GRCh38", + "latest_SBS_mm9", "latest_DBS_mm9", "latest_SBS_mm10", "latest_DBS_mm10", + "latest_SBS_rn6", "latest_DBS_rn6", "latest_CN_GRCh37"), db_type = c("", "human-exome", "human-genome"), method = "cosine", normalize = c("row", "feature"), @@ -41,7 +41,8 @@ In addition, it can be one of "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "SBS_Nik_lab", "RS_Nik_lab" to refer reference signatures from Degasperi, Andrea, et al. (2020) (reference #2); "RS_BRCA560", "RS_USARC" to reference signatures from BRCA560 and USARC cohorts; -"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA. +"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA; +"CNS_TCGA176" (176 categories) and "CNS_PCAWG176" (176 categories) to reference copy number signatures from PCAWG and TCGA separately. \strong{UPDATE}, the latest version of reference version can be automatically downloaded and loaded from \url{https://cancer.sanger.ac.uk/signatures/downloads/} when a option with \code{latest_} prefix is specified (e.g. "latest_SBS_GRCh37"). @@ -128,7 +129,7 @@ Steele, Christopher D., et al. "Undifferentiated sarcomas develop through distin Nik-Zainal, Serena, et al. "Landscape of somatic mutations in 560 breast cancer whole-genome sequences." Nature 534.7605 (2016): 47-54. -Steele, Christopher D., et al. "Signatures of copy number alterations in human cancer." bioRxiv (2021). +Steele, Christopher D., et al. "Signatures of copy number alterations in human cancer." Nature 606.7916 (2022): 984-991. } \author{ Shixiang Wang \href{mailto:w_shixiang@163.com}{w_shixiang@163.com} diff --git a/man/output_bootstrap.Rd b/man/output_bootstrap.Rd index 5c940ed8..caf2993d 100644 --- a/man/output_bootstrap.Rd +++ b/man/output_bootstrap.Rd @@ -23,7 +23,8 @@ In addition, it can be one of "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "SBS_Nik_lab", "RS_Nik_lab" to refer reference signatures from Degasperi, Andrea, et al. (2020) (reference #2); "RS_BRCA560", "RS_USARC" to reference signatures from BRCA560 and USARC cohorts; -"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA. +"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA; +"CNS_TCGA176" (176 categories) and "CNS_PCAWG176" (176 categories) to reference copy number signatures from PCAWG and TCGA separately. \strong{UPDATE}, the latest version of reference version can be automatically downloaded and loaded from \url{https://cancer.sanger.ac.uk/signatures/downloads/} when a option with \code{latest_} prefix is specified (e.g. "latest_SBS_GRCh37"). diff --git a/man/output_fit.Rd b/man/output_fit.Rd index a1ac7158..28ff2b95 100644 --- a/man/output_fit.Rd +++ b/man/output_fit.Rd @@ -23,7 +23,8 @@ In addition, it can be one of "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "SBS_Nik_lab", "RS_Nik_lab" to refer reference signatures from Degasperi, Andrea, et al. (2020) (reference #2); "RS_BRCA560", "RS_USARC" to reference signatures from BRCA560 and USARC cohorts; -"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA. +"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA; +"CNS_TCGA176" (176 categories) and "CNS_PCAWG176" (176 categories) to reference copy number signatures from PCAWG and TCGA separately. \strong{UPDATE}, the latest version of reference version can be automatically downloaded and loaded from \url{https://cancer.sanger.ac.uk/signatures/downloads/} when a option with \code{latest_} prefix is specified (e.g. "latest_SBS_GRCh37"). diff --git a/man/output_sig.Rd b/man/output_sig.Rd index 16745e56..b6d40023 100644 --- a/man/output_sig.Rd +++ b/man/output_sig.Rd @@ -23,7 +23,8 @@ In addition, it can be one of "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "SBS_Nik_lab", "RS_Nik_lab" to refer reference signatures from Degasperi, Andrea, et al. (2020) (reference #2); "RS_BRCA560", "RS_USARC" to reference signatures from BRCA560 and USARC cohorts; -"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA. +"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA; +"CNS_TCGA176" (176 categories) and "CNS_PCAWG176" (176 categories) to reference copy number signatures from PCAWG and TCGA separately. \strong{UPDATE}, the latest version of reference version can be automatically downloaded and loaded from \url{https://cancer.sanger.ac.uk/signatures/downloads/} when a option with \code{latest_} prefix is specified (e.g. "latest_SBS_GRCh37"). diff --git a/man/read_maf.Rd b/man/read_maf.Rd index dedc68fb..72beec5f 100644 --- a/man/read_maf.Rd +++ b/man/read_maf.Rd @@ -26,9 +26,9 @@ positive strand format. } \section{Functions}{ \itemize{ -\item \code{read_maf_minimal()}: Read Maf data.frame from a minimal maf-like data - +\item \code{read_maf_minimal}: Read Maf data.frame from a minimal maf-like data }} + \examples{ laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools", mustWork = TRUE) if (!require("R.utils")) { diff --git a/man/same_size_clustering.Rd b/man/same_size_clustering.Rd index a34fa32d..5e97ae9e 100644 --- a/man/same_size_clustering.Rd +++ b/man/same_size_clustering.Rd @@ -9,7 +9,8 @@ same_size_clustering( diss = FALSE, clsize = NULL, algo = c("nnit", "hcbottom", "kmvar"), - method = c("maxd", "random", "mind", "elki", "ward.D", "average", "complete", "single") + method = c("maxd", "random", "mind", "elki", "ward.D", "average", "complete", + "single") ) } \arguments{ diff --git a/man/show_cosmic_sig_profile.Rd b/man/show_cosmic_sig_profile.Rd index b1f3133d..ce2dc583 100644 --- a/man/show_cosmic_sig_profile.Rd +++ b/man/show_cosmic_sig_profile.Rd @@ -26,7 +26,8 @@ In addition, it can be one of "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "SBS_Nik_lab", "RS_Nik_lab" to refer reference signatures from Degasperi, Andrea, et al. (2020) (reference #2); "RS_BRCA560", "RS_USARC" to reference signatures from BRCA560 and USARC cohorts; -"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA. +"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA; +"CNS_TCGA176" (176 categories) and "CNS_PCAWG176" (176 categories) to reference copy number signatures from PCAWG and TCGA separately. \strong{UPDATE}, the latest version of reference version can be automatically downloaded and loaded from \url{https://cancer.sanger.ac.uk/signatures/downloads/} when a option with \code{latest_} prefix is specified (e.g. "latest_SBS_GRCh37"). diff --git a/man/sig_fit.Rd b/man/sig_fit.Rd index af4a3293..a420367d 100644 --- a/man/sig_fit.Rd +++ b/man/sig_fit.Rd @@ -9,12 +9,12 @@ sig_fit( sig, sig_index = NULL, sig_db = c("legacy", "SBS", "DBS", "ID", "TSB", "SBS_Nik_lab", "RS_Nik_lab", - "RS_BRCA560", "RS_USARC", "CNS_USARC", "CNS_TCGA", "SBS_hg19", "SBS_hg38", "SBS_mm9", - "SBS_mm10", "DBS_hg19", "DBS_hg38", "DBS_mm9", "DBS_mm10", "SBS_Nik_lab_Organ", - "RS_Nik_lab_Organ", "latest_SBS_GRCh37", "latest_DBS_GRCh37", "latest_ID_GRCh37", - "latest_SBS_GRCh38", "latest_DBS_GRCh38", "latest_SBS_mm9", "latest_DBS_mm9", - "latest_SBS_mm10", "latest_DBS_mm10", "latest_SBS_rn6", "latest_DBS_rn6", - "latest_CN_GRCh37"), + "RS_BRCA560", "RS_USARC", "CNS_USARC", "CNS_TCGA", "CNS_TCGA176", "CNS_PCAWG176", + "SBS_hg19", "SBS_hg38", "SBS_mm9", "SBS_mm10", "DBS_hg19", "DBS_hg38", "DBS_mm9", + "DBS_mm10", "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "latest_SBS_GRCh37", + "latest_DBS_GRCh37", "latest_ID_GRCh37", "latest_SBS_GRCh38", "latest_DBS_GRCh38", + "latest_SBS_mm9", "latest_DBS_mm9", "latest_SBS_mm10", "latest_DBS_mm10", + "latest_SBS_rn6", "latest_DBS_rn6", "latest_CN_GRCh37"), db_type = c("", "human-exome", "human-genome"), show_index = TRUE, method = c("QP", "NNLS", "SA"), @@ -49,7 +49,8 @@ In addition, it can be one of "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "SBS_Nik_lab", "RS_Nik_lab" to refer reference signatures from Degasperi, Andrea, et al. (2020) (reference #2); "RS_BRCA560", "RS_USARC" to reference signatures from BRCA560 and USARC cohorts; -"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA. +"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA; +"CNS_TCGA176" (176 categories) and "CNS_PCAWG176" (176 categories) to reference copy number signatures from PCAWG and TCGA separately. \strong{UPDATE}, the latest version of reference version can be automatically downloaded and loaded from \url{https://cancer.sanger.ac.uk/signatures/downloads/} when a option with \code{latest_} prefix is specified (e.g. "latest_SBS_GRCh37"). diff --git a/man/sig_fit_bootstrap.Rd b/man/sig_fit_bootstrap.Rd index 1d3783b7..38e4df49 100644 --- a/man/sig_fit_bootstrap.Rd +++ b/man/sig_fit_bootstrap.Rd @@ -46,7 +46,8 @@ In addition, it can be one of "SBS_Nik_lab_Organ", "RS_Nik_lab_Organ", "SBS_Nik_lab", "RS_Nik_lab" to refer reference signatures from Degasperi, Andrea, et al. (2020) (reference #2); "RS_BRCA560", "RS_USARC" to reference signatures from BRCA560 and USARC cohorts; -"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA. +"CNS_USARC" (40 categories), "CNS_TCGA" (48 categories) to reference copy number signatures from USARC cohort and TCGA; +"CNS_TCGA176" (176 categories) and "CNS_PCAWG176" (176 categories) to reference copy number signatures from PCAWG and TCGA separately. \strong{UPDATE}, the latest version of reference version can be automatically downloaded and loaded from \url{https://cancer.sanger.ac.uk/signatures/downloads/} when a option with \code{latest_} prefix is specified (e.g. "latest_SBS_GRCh37"). diff --git a/man/sig_tally.Rd b/man/sig_tally.Rd index 21ac6b14..909a4d12 100644 --- a/man/sig_tally.Rd +++ b/man/sig_tally.Rd @@ -58,7 +58,7 @@ Default is \link{CN.features}. Users can also set custom input with "feature", \code{unique(CN.features$feature)}.} \item{cores}{number of computer cores to run this task. -You can use \code{\link[future:re-exports]{future::availableCores()}} function to check how +You can use \code{\link[future:availableCores]{future::availableCores()}} function to check how many cores you can use.} \item{keep_only_matrix}{if \code{TRUE}, keep only matrix for signature extraction. @@ -116,13 +116,13 @@ with \link{read_copynumber}). } \section{Methods (by class)}{ \itemize{ -\item \code{sig_tally(CopyNumber)}: Returns copy number features, components and component-by-sample matrix +\item \code{CopyNumber}: Returns copy number features, components and component-by-sample matrix -\item \code{sig_tally(RS)}: Returns genome rearrangement sample-by-component matrix - -\item \code{sig_tally(MAF)}: Returns SBS mutation sample-by-component matrix and APOBEC enrichment +\item \code{RS}: Returns genome rearrangement sample-by-component matrix +\item \code{MAF}: Returns SBS mutation sample-by-component matrix and APOBEC enrichment }} + \examples{ # Load copy number object load(system.file("extdata", "toy_copynumber.RData", diff --git a/man/transform_seg_table.Rd b/man/transform_seg_table.Rd index 45a2186d..67e838fd 100644 --- a/man/transform_seg_table.Rd +++ b/man/transform_seg_table.Rd @@ -9,9 +9,7 @@ transform_seg_table( genome_build = c("hg19", "hg38", "mm10", "mm9"), ref_type = c("cytoband", "gene"), values_fill = NA, - values_fn = function(x, ...) { - round(mean(x, ...)) - }, + values_fn = function(x, ...) { round(mean(x, ...)) }, resolution_factor = 1L ) } @@ -26,16 +24,15 @@ at least 'chromosome', 'start', 'end', 'segVal', 'sample' these columns.} \item{values_fill}{Optionally, a (scalar) value that specifies what each \code{value} should be filled in with when missing. -This can be a named list if you want to apply different fill values to -different value columns.} +This can be a named list if you want to apply different aggregations +to different value columns.} -\item{values_fn}{Optionally, a function applied to the value in each cell +\item{values_fn}{Optionally, a function applied to the \code{value} in each cell in the output. You will typically use this when the combination of -\code{id_cols} and \code{names_from} columns does not uniquely identify an -observation. +\code{id_cols} and \code{value} column does not uniquely identify an observation. This can be a named list if you want to apply different aggregations -to different \code{values_from} columns.} +to different value columns.} \item{resolution_factor}{an integer to control the resolution. When it is \code{1} (default), compute frequency in each cytoband. diff --git a/tests/testthat/test-roxytest-testexamples-get_sig_db.R b/tests/testthat/test-roxytest-testexamples-get_sig_db.R index 0273f010..0ada7ea6 100644 --- a/tests/testthat/test-roxytest-testexamples-get_sig_db.R +++ b/tests/testthat/test-roxytest-testexamples-get_sig_db.R @@ -2,7 +2,7 @@ context("File R/get_sig_db.R: @testexamples") -test_that("Function get_sig_db() @ L59", { +test_that("Function get_sig_db() @ L66", { s1 <- get_sig_db() s2 <- get_sig_db("SBS") @@ -15,6 +15,8 @@ test_that("Function get_sig_db() @ L59", { s9 <- get_sig_db("RS_Nik_lab") s10 <- get_sig_db("CNS_USARC") s11 <- get_sig_db("CNS_TCGA") + s12 <- get_sig_db("CNS_TCGA176") + s13 <- get_sig_db("CNS_PCAWG176") s1 s2 s3 @@ -26,6 +28,8 @@ test_that("Function get_sig_db() @ L59", { s9 s10 s11 + s12 + s13 expect_is(s1, "list") expect_is(s2, "list") expect_is(s3, "list") @@ -37,5 +41,7 @@ test_that("Function get_sig_db() @ L59", { expect_is(s9, "list") expect_is(s10, "list") expect_is(s11, "list") + expect_is(s12, "list") + expect_is(s13, "list") }) diff --git a/tests/testthat/test-roxytest-testexamples-get_sig_similarity.R b/tests/testthat/test-roxytest-testexamples-get_sig_similarity.R index 39f4fa83..19d1d414 100644 --- a/tests/testthat/test-roxytest-testexamples-get_sig_similarity.R +++ b/tests/testthat/test-roxytest-testexamples-get_sig_similarity.R @@ -2,7 +2,7 @@ context("File R/get_sig_similarity.R: @testexamples") -test_that("Function get_sig_similarity() @ L101", { +test_that("Function get_sig_similarity() @ L102", { # Load mutational signature load(system.file("extdata", "toy_mutational_signature.RData",