@@ -13,8 +13,8 @@ rtol <- c(1e-1 ^ (1:3), 1e-1 ^ (1:3), 1e-1 ^ (1:3))
1313atol <- rtol * 1e-2
1414
1515res.df <- data.frame (matrix (ncol = 6 , nrow = Tot_iter ,
16- dimnames = list (NULL , c(" method" ," rtol" ," atol" ,
17- " mean_time" ," sd_time" ," subjects_negC" ))))
16+ dimnames = list (NULL , c(" method" ," rtol" ," atol" ,
17+ " mean_time" ," sd_time" ," subjects_negC" ))))
1818
1919res.df $ method <- solvName [solv [1 : Tot_iter ]]
2020res.df $ rtol <- rtol
@@ -29,12 +29,12 @@ SetWorkspace("V23_B305_minPBPK_ADAM_CLiv.wksz") # 10 x 10 workspace
2929db_file <- array ( dim = Tot_iter )
3030
3131for ( iter in 1 : Tot_iter ){
32- db_file [iter ] <- paste0(" sim_" ,sprintf(" %004d" ,iter )," .db" )
33-
34- # Simcyp::SetSolver( solv[iter],
35- # rtol = rtol[iter], atol = atol[iter], maxsteps = 1e+07 )
36- #
37- # Simulate( database = db_file[iter] )
32+ db_file [iter ] <- paste0(" sim_" ,sprintf(" %004d" ,iter )," .db" )
33+
34+ # Simcyp::SetSolver( solv[iter],
35+ # rtol = rtol[iter], atol = atol[iter], maxsteps = 1e+07 )
36+ #
37+ # Simulate( database = db_file[iter] )
3838}
3939
4040Simcyp :: Uninitialise()
@@ -44,25 +44,26 @@ Simcyp::Uninitialise()
4444Simcyp :: Initialise(species = SpeciesID $ Human , verbose = FALSE )
4545
4646for ( iter in 1 : Tot_iter ){
47- conn <- RSQLite :: dbConnect( SQLite(), db_file [iter ] )
48-
49- # SIMULATION DURATIONS
50- PopResults <- dbGetQuery( conn , " SELECT * FROM PopResults10" )
51- sim_duration <- PopResults $ SimulationDuration
52-
53- res.df $ mean_time [iter ] <- mean( sim_duration )
54- res.df $ sd_time [ iter ] <- sd( sim_duration )
55-
56- # NO. OF SUBJECTS WITH A NEGATIVE CONC
57- negC <- vector()
58- for (k in 1 : 100 ){
59- Csys <- GetProfile_DB(ProfileID $ Csys , compound = CompoundID $ Substrate , individual = k , conn , inhibition = FALSE )
60- negC [k ] <- as.numeric( 0 < sum( ( Csys < 0 ) ) ) # there is a neg conc or not
61- }
62-
63- res.df $ subjects_negC [iter ] <- sum( negC )
64-
65- RSQLite :: dbDisconnect( conn )
47+ conn <- RSQLite :: dbConnect( SQLite(), db_file [iter ] )
48+
49+ # SIMULATION DURATIONS
50+ PopResults <- dbGetQuery( conn , " SELECT * FROM PopResults10" )
51+ sim_duration <- PopResults $ SimulationDuration
52+
53+ res.df $ mean_time [iter ] <- mean( sim_duration )
54+ res.df $ sd_time [ iter ] <- sd( sim_duration )
55+
56+ # NO. OF SUBJECTS WITH A NEGATIVE CONC
57+ negC <- vector()
58+ for (k in 1 : 100 ){
59+ Csys <- GetProfile_DB(ProfileID $ Csys , compound = CompoundID $ Substrate , individual = k , conn , inhibition = FALSE )
60+ negC [k ] <- as.numeric( 0 < sum( ( Csys < 0 ) ) ) # there is a neg conc or not
61+ }
62+
63+ res.df $ subjects_negC [iter ] <- sum( negC )
64+
65+ RSQLite :: dbDisconnect( conn )
6666}
6767
68- Simcyp :: Uninitialise()
68+ Simcyp :: Uninitialise()
69+
0 commit comments