R Under development (unstable) (2026-01-22 r89323 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # test.ISOpureS2.model_optimize.theta_functions.R ################################################# > # Testing script for functions needed in the optimilzation of mm in Step 2 > # Test theta separately since it takes a while... > # > # The functions are of the form ISOpureS2.model_optimize.--- > # (theta) > # theta_loglikelihood > # theta_deriv_loglikelihood > > # LOAD DATA ####################################################################################### > # load library > library(ISOpureR); > > # load the data from that path > data.path <- paste0(file.path(system.file(package = "ISOpureR"), 'extdata', 'Beer')); > load(file.path(data.path , 'beer.tumordata.250.transcripts.30.patients.RData')); > load(file.path(data.path, 'beer.ISOpureS2model.250.transcripts.30.patients.RData')); > > # the normaldata and tumourdata should be matrices > beer.tumordata <- as.matrix(beer.tumordata); > > # TEST THETA FUNCTIONS ############################################################################ > > # inputs needed for theta functions > # initial value of theta (this is testing just patient 1) > ww <- t(ISOpureS2model$theta_weights[1, ,drop=F]) > > # test theta functions (just for patient 1, that's the third entry) > ISOpureS2.model_optimize.theta.theta_loglikelihood(ww, beer.tumordata, 1, ISOpureS2model); [1] 1499714 > ISOpureS2.model_optimize.theta.theta_deriv_loglikelihood(ww, beer.tumordata, 1, ISOpureS2model); [,1] [1,] 0.000000e+00 [2,] 2.926387e-05 [3,] 1.753981e-04 [4,] -1.280010e-04 [5,] 2.499281e-05 [6,] 1.827424e-04 [7,] -9.476450e-05 [8,] -1.622017e-04 [9,] 3.293253e-05 [10,] 3.286415e-05 > > # remove parameters used in the test > rm(K, ww); Warning message: In rm(K, ww) : object 'K' not found > > proc.time() user system elapsed 0.23 0.04 0.28