diff --git a/tests/data/Aciclovir.pkml b/inst/extdata/Aciclovir.pkml similarity index 100% rename from tests/data/Aciclovir.pkml rename to inst/extdata/Aciclovir.pkml diff --git a/inst/extdata/PKAnalyses.csv b/inst/extdata/PKAnalyses.csv new file mode 100644 index 000000000..6d36cdae4 --- /dev/null +++ b/inst/extdata/PKAnalyses.csv @@ -0,0 +1,15 @@ +"IndividualId","QuantityPath","Parameter","Value","Unit" +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","C_max",50.2527198791504,µmol/l +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","C_max_norm",3066159.48677063,mg/l +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","t_max",0.183333333333333,h +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","C_tEnd",0.0325417779386044,µmol/l +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","AUC_tEnd",4064.12451171875,µmol*min/l +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","AUC_tEnd_norm",247971725463.867,µg*min/l +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","AUC_inf",4072.62866210938,µmol*min/l +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","AUC_inf_norm",248490600585.937,µg*min/l +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","MRT",3.22140401204427,h +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","Thalf",3.01898854573568,h +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","FractionAucLastToInf",0.0020881115924567, +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","CL",4.02429699897766,ml/min/kg +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","Vss",777.833223342896,ml/kg +0,"Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)","Vd",1051.66471004486,ml/kg diff --git a/inst/extdata/SAResult.csv b/inst/extdata/SAResult.csv new file mode 100644 index 000000000..b92a51cff --- /dev/null +++ b/inst/extdata/SAResult.csv @@ -0,0 +1,73 @@ +"QuantityPath","Parameter","PKParameter","Value" +"Organism|B","Volume","C_max",0 +"Organism|B","Q","C_max",0 +"Organism|B","R1-k1","C_max",0.125683048927291 +"Organism|B","Volume","t_max",0 +"Organism|B","Q","t_max",0 +"Organism|B","R1-k1","t_max",0 +"Organism|B","Volume","C_tEnd",0 +"Organism|B","Q","C_tEnd",0 +"Organism|B","R1-k1","C_tEnd",0.125683048927291 +"Organism|B","Volume","AUC_tEnd",0 +"Organism|B","Q","AUC_tEnd",0 +"Organism|B","R1-k1","AUC_tEnd",0.28611793526023 +"Organism|B","Volume","Thalf",0.00263222880524802 +"Organism|B","Q","Thalf",0.00263222880524803 +"Organism|B","R1-k1","Thalf",2.07765550328695 +"Organism|A","Volume","C_max",0 +"Organism|A","Q","C_max",0 +"Organism|A","R1-k1","C_max",0 +"Organism|A","Volume","C_tEnd",0.00190454006083498 +"Organism|A","Q","C_tEnd",0.00190454006083497 +"Organism|A","R1-k1","C_tEnd",-3.02083869539058 +"Organism|A","Volume","AUC_tEnd",-0.000128123461933747 +"Organism|A","Q","AUC_tEnd",-0.000128123461933749 +"Organism|A","R1-k1","AUC_tEnd",-0.840311133361753 +"Organism|A","Volume","AUC_inf",0.00018484046398853 +"Organism|A","Q","AUC_inf",0.000184840463988528 +"Organism|A","R1-k1","AUC_inf",-1.00100907307317 +"Organism|A","Volume","MRT",0.00118913494339526 +"Organism|A","Q","MRT",0.00118913494339525 +"Organism|A","R1-k1","MRT",-1.01555226539856 +"Organism|A","Volume","Thalf",0.00426118762408444 +"Organism|A","Q","Thalf",0.00426118762408443 +"Organism|A","R1-k1","Thalf",-1.01312030950234 +"Organism|A","Volume","FractionAucLastToInf",0.0059700442604894 +"Organism|A","Q","FractionAucLastToInf",0.00597004426048938 +"Organism|A","R1-k1","FractionAucLastToInf",-3.03173890196508 +"Organism|Liver|A","Volume","C_max",0 +"Organism|Liver|A","Q","C_max",0 +"Organism|Liver|A","R1-k1","C_max",0 +"Organism|Liver|A","Volume","C_tEnd",0.00190449529412327 +"Organism|Liver|A","Q","C_tEnd",0.00190449529412326 +"Organism|Liver|A","R1-k1","C_tEnd",-3.02083906347243 +"Organism|Liver|A","Volume","AUC_tEnd",-0.000128112779572286 +"Organism|Liver|A","Q","AUC_tEnd",-0.000128112779572288 +"Organism|Liver|A","R1-k1","AUC_tEnd",-0.840311179491087 +"Organism|Liver|A","Volume","AUC_inf",0.000184678113354372 +"Organism|Liver|A","Q","AUC_inf",0.000184678113354369 +"Organism|Liver|A","R1-k1","AUC_inf",-1.00100945868531 +"Organism|Liver|A","Volume","MRT",0.00118913494339526 +"Organism|Liver|A","Q","MRT",0.00118913494339525 +"Organism|Liver|A","R1-k1","MRT",-1.0155530878528 +"Organism|Liver|A","Volume","Thalf",0.00426148998413105 +"Organism|Liver|A","Q","Thalf",0.00426148998413104 +"Organism|Liver|A","R1-k1","Thalf",-1.01312506480125 +"Organism|Liver|A","Volume","FractionAucLastToInf",0.00597026840963047 +"Organism|Liver|A","Q","FractionAucLastToInf",0.00597026840963045 +"Organism|Liver|A","R1-k1","FractionAucLastToInf",-3.03174461776818 +"Organism|Liver|B","Volume","C_max",0 +"Organism|Liver|B","Q","C_max",0 +"Organism|Liver|B","R1-k1","C_max",0.135061724163806 +"Organism|Liver|B","Volume","t_max",0 +"Organism|Liver|B","Q","t_max",0 +"Organism|Liver|B","R1-k1","t_max",0 +"Organism|Liver|B","Volume","C_tEnd",0 +"Organism|Liver|B","Q","C_tEnd",0 +"Organism|Liver|B","R1-k1","C_tEnd",0.135061724163806 +"Organism|Liver|B","Volume","AUC_tEnd",0 +"Organism|Liver|B","Q","AUC_tEnd",0 +"Organism|Liver|B","R1-k1","AUC_tEnd",0.31419658906824 +"Organism|Liver|B","Volume","Thalf",0.00262572897175011 +"Organism|Liver|B","Q","Thalf",0.00262572897175012 +"Organism|Liver|B","R1-k1","Thalf",2.08762142290653 diff --git a/inst/extdata/SimResults.csv b/inst/extdata/SimResults.csv new file mode 100644 index 000000000..d37f2d317 --- /dev/null +++ b/inst/extdata/SimResults.csv @@ -0,0 +1,492 @@ +"IndividualId","Time [min]","Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood) [µmol/l]" +0,0,0 +0,1,3.254674 +0,2,9.100459 +0,3,15.01664 +0,4,20.72619 +0,5,26.20118 +0,6,31.42553 +0,7,36.38365 +0,8,41.06707 +0,9,45.47625 +0,10,49.6188 +0,11,50.25272 +0,12,48.05725 +0,13,45.57027 +0,14,43.08635 +0,15,40.65089 +0,18,33.9493 +0,21,28.53837 +0,24,24.43384 +0,27,21.40511 +0,30,19.19228 +0,33,17.57458 +0,36,16.3822 +0,39,15.49047 +0,42,14.8101 +0,45,14.2781 +0,48,13.85028 +0,51,13.49587 +0,54,13.19349 +0,57,12.92826 +0,60,12.68981 +0,63,12.47095 +0,66,12.26664 +0,69,12.07335 +0,72,11.88855 +0,75,11.71047 +0,78,11.53789 +0,81,11.36994 +0,84,11.20601 +0,87,11.0456 +0,90,10.88833 +0,93,10.73395 +0,96,10.58222 +0,99,10.43301 +0,102,10.28622 +0,105,10.14177 +0,108,9.99957 +0,111,9.859557 +0,114,9.721652 +0,117,9.585803 +0,120,9.451961 +0,123,9.320086 +0,126,9.190145 +0,129,9.062101 +0,132,8.935919 +0,135,8.811567 +0,138,8.689002 +0,141,8.56821 +0,144,8.449142 +0,147,8.331775 +0,150,8.216084 +0,153,8.102039 +0,156,7.989619 +0,159,7.878799 +0,162,7.769556 +0,165,7.661867 +0,168,7.555709 +0,171,7.451057 +0,174,7.347889 +0,177,7.246186 +0,180,7.145924 +0,183,7.047077 +0,186,6.949622 +0,189,6.853551 +0,192,6.758833 +0,195,6.665447 +0,198,6.573374 +0,201,6.482601 +0,204,6.393106 +0,207,6.304867 +0,210,6.21787 +0,213,6.132097 +0,216,6.047531 +0,219,5.964156 +0,222,5.881952 +0,225,5.800904 +0,228,5.720996 +0,231,5.642211 +0,234,5.564533 +0,237,5.487945 +0,240,5.412432 +0,243,5.337977 +0,246,5.264568 +0,249,5.192187 +0,252,5.12082 +0,255,5.050453 +0,258,4.981071 +0,261,4.912662 +0,264,4.845211 +0,267,4.778703 +0,270,4.713127 +0,273,4.648469 +0,276,4.584716 +0,279,4.521856 +0,282,4.459874 +0,285,4.39876 +0,288,4.338499 +0,291,4.279081 +0,294,4.220494 +0,297,4.162724 +0,300,4.105762 +0,303,4.049595 +0,306,3.994212 +0,309,3.939603 +0,312,3.885755 +0,315,3.832659 +0,318,3.780304 +0,321,3.728679 +0,324,3.677774 +0,327,3.627578 +0,330,3.578083 +0,333,3.529277 +0,336,3.481151 +0,339,3.433695 +0,342,3.386901 +0,345,3.340758 +0,348,3.295257 +0,351,3.25039 +0,354,3.206147 +0,357,3.162519 +0,360,3.119499 +0,363,3.077076 +0,366,3.035244 +0,369,2.993992 +0,372,2.953314 +0,375,2.913202 +0,378,2.873646 +0,381,2.83464 +0,384,2.796175 +0,387,2.758244 +0,390,2.72084 +0,393,2.683955 +0,396,2.647581 +0,399,2.611712 +0,402,2.57634 +0,405,2.541459 +0,408,2.507061 +0,411,2.47314 +0,414,2.439688 +0,417,2.4067 +0,420,2.374169 +0,423,2.342088 +0,426,2.310451 +0,429,2.279252 +0,432,2.248484 +0,435,2.218142 +0,438,2.188219 +0,441,2.15871 +0,444,2.129609 +0,447,2.10091 +0,450,2.072608 +0,453,2.044696 +0,456,2.01717 +0,459,1.990023 +0,462,1.963251 +0,465,1.936848 +0,468,1.910809 +0,471,1.885129 +0,474,1.859804 +0,477,1.834827 +0,480,1.810195 +0,483,1.785902 +0,486,1.761943 +0,489,1.738314 +0,492,1.71501 +0,495,1.692027 +0,498,1.669359 +0,501,1.647004 +0,504,1.624956 +0,507,1.603211 +0,510,1.581764 +0,513,1.560613 +0,516,1.539751 +0,519,1.519176 +0,522,1.498883 +0,525,1.478869 +0,528,1.459129 +0,531,1.43966 +0,534,1.420458 +0,537,1.401519 +0,540,1.382839 +0,543,1.364415 +0,546,1.346244 +0,549,1.328321 +0,552,1.310644 +0,555,1.293208 +0,558,1.276011 +0,561,1.259049 +0,564,1.242319 +0,567,1.225818 +0,570,1.209542 +0,573,1.193488 +0,576,1.177654 +0,579,1.162035 +0,582,1.14663 +0,585,1.131435 +0,588,1.116447 +0,591,1.101664 +0,594,1.087082 +0,597,1.072698 +0,600,1.058511 +0,603,1.044517 +0,606,1.030714 +0,609,1.017098 +0,612,1.003668 +0,615,0.9904197 +0,618,0.977352 +0,621,0.9644618 +0,624,0.9517468 +0,627,0.9392047 +0,630,0.9268329 +0,633,0.9146291 +0,636,0.9025909 +0,639,0.890716 +0,642,0.8790021 +0,645,0.8674471 +0,648,0.8560486 +0,651,0.8448045 +0,654,0.8337126 +0,657,0.8227711 +0,660,0.8119777 +0,663,0.8013304 +0,666,0.7908271 +0,669,0.7804658 +0,672,0.7702446 +0,675,0.7601615 +0,678,0.7502146 +0,681,0.740402 +0,684,0.7307219 +0,687,0.7211724 +0,690,0.7117518 +0,693,0.7024583 +0,696,0.6932901 +0,699,0.6842454 +0,702,0.6753227 +0,705,0.6665201 +0,708,0.657836 +0,711,0.6492687 +0,714,0.6408167 +0,717,0.6324784 +0,720,0.6242523 +0,723,0.6161367 +0,726,0.6081302 +0,729,0.6002312 +0,732,0.5924383 +0,735,0.5847501 +0,738,0.5771649 +0,741,0.5696815 +0,744,0.5622984 +0,747,0.5550143 +0,750,0.5478277 +0,753,0.5407375 +0,756,0.5337422 +0,759,0.5268406 +0,762,0.5200312 +0,765,0.513313 +0,768,0.5066845 +0,771,0.5001447 +0,774,0.4936922 +0,777,0.4873259 +0,780,0.4810445 +0,783,0.474847 +0,786,0.4687323 +0,789,0.4626991 +0,792,0.4567463 +0,795,0.4508728 +0,798,0.4450775 +0,801,0.4393595 +0,804,0.4337175 +0,807,0.4281505 +0,810,0.4226576 +0,813,0.4172378 +0,816,0.41189 +0,819,0.4066133 +0,822,0.4014066 +0,825,0.3962691 +0,828,0.3911997 +0,831,0.3861976 +0,834,0.3812618 +0,837,0.3763914 +0,840,0.3715855 +0,843,0.3668433 +0,846,0.3621638 +0,849,0.3575464 +0,852,0.35299 +0,855,0.3484939 +0,858,0.3440572 +0,861,0.3396791 +0,864,0.3353588 +0,867,0.3310956 +0,870,0.3268886 +0,873,0.3227371 +0,876,0.3186404 +0,879,0.3145977 +0,882,0.3106082 +0,885,0.3066714 +0,888,0.3027863 +0,891,0.2989524 +0,894,0.2951689 +0,897,0.2914351 +0,900,0.2877504 +0,903,0.2841142 +0,906,0.2805256 +0,909,0.2769842 +0,912,0.2734893 +0,915,0.2700402 +0,918,0.2666364 +0,921,0.2632772 +0,924,0.2599619 +0,927,0.2566901 +0,930,0.2534611 +0,933,0.2502744 +0,936,0.2471292 +0,939,0.2440253 +0,942,0.2409619 +0,945,0.2379386 +0,948,0.2349547 +0,951,0.2320097 +0,954,0.2291032 +0,957,0.2262345 +0,960,0.2234033 +0,963,0.2206089 +0,966,0.2178509 +0,969,0.2151288 +0,972,0.2124421 +0,975,0.2097904 +0,978,0.2071732 +0,981,0.20459 +0,984,0.2020403 +0,987,0.1995237 +0,990,0.1970398 +0,993,0.1945881 +0,996,0.1921681 +0,999,0.1897796 +0,1002,0.187422 +0,1005,0.1850949 +0,1008,0.1827979 +0,1011,0.1805307 +0,1014,0.1782928 +0,1017,0.1760837 +0,1020,0.1739033 +0,1023,0.171751 +0,1026,0.1696264 +0,1029,0.1675293 +0,1032,0.1654592 +0,1035,0.1634158 +0,1038,0.1613988 +0,1041,0.1594077 +0,1044,0.1574422 +0,1047,0.155502 +0,1050,0.1535868 +0,1053,0.1516962 +0,1056,0.1498299 +0,1059,0.1479875 +0,1062,0.1461688 +0,1065,0.1443735 +0,1068,0.1426011 +0,1071,0.1408515 +0,1074,0.1391243 +0,1077,0.1374193 +0,1080,0.135736 +0,1083,0.1340743 +0,1086,0.1324338 +0,1089,0.1308143 +0,1092,0.1292155 +0,1095,0.1276371 +0,1098,0.1260789 +0,1101,0.1245405 +0,1104,0.1230218 +0,1107,0.1215224 +0,1110,0.1200421 +0,1113,0.1185807 +0,1116,0.1171379 +0,1119,0.1157134 +0,1122,0.114307 +0,1125,0.1129185 +0,1128,0.1115477 +0,1131,0.1101942 +0,1134,0.108858 +0,1137,0.1075386 +0,1140,0.1062361 +0,1143,0.10495 +0,1146,0.1036802 +0,1149,0.1024264 +0,1152,0.1011886 +0,1155,0.09996636 +0,1158,0.09875961 +0,1161,0.09756811 +0,1164,0.09639165 +0,1167,0.09523004 +0,1170,0.09408309 +0,1173,0.0929506 +0,1176,0.09183238 +0,1179,0.09072825 +0,1182,0.08963801 +0,1185,0.08856149 +0,1188,0.08749852 +0,1191,0.08644892 +0,1194,0.08541249 +0,1197,0.0843891 +0,1200,0.08337855 +0,1203,0.08238067 +0,1206,0.08139531 +0,1209,0.0804223 +0,1212,0.07946148 +0,1215,0.07851268 +0,1218,0.07757576 +0,1221,0.07665056 +0,1224,0.07573693 +0,1227,0.07483472 +0,1230,0.07394378 +0,1233,0.07306395 +0,1236,0.07219511 +0,1239,0.0713371 +0,1242,0.07048978 +0,1245,0.06965301 +0,1248,0.06882666 +0,1251,0.06801059 +0,1254,0.06720468 +0,1257,0.06640879 +0,1260,0.06562279 +0,1263,0.06484655 +0,1266,0.06407994 +0,1269,0.06332285 +0,1272,0.06257514 +0,1275,0.06183669 +0,1278,0.06110739 +0,1281,0.06038712 +0,1284,0.05967576 +0,1287,0.0589732 +0,1290,0.05827933 +0,1293,0.05759403 +0,1296,0.05691719 +0,1299,0.0562487 +0,1302,0.05558846 +0,1305,0.05493636 +0,1308,0.05429228 +0,1311,0.05365614 +0,1314,0.05302783 +0,1317,0.05240726 +0,1320,0.05179431 +0,1323,0.0511889 +0,1326,0.05059092 +0,1329,0.05000028 +0,1332,0.04941689 +0,1335,0.04884065 +0,1338,0.04827147 +0,1341,0.04770927 +0,1344,0.04715394 +0,1347,0.04660542 +0,1350,0.04606361 +0,1353,0.04552841 +0,1356,0.04499976 +0,1359,0.04447756 +0,1362,0.04396173 +0,1365,0.0434522 +0,1368,0.04294887 +0,1371,0.04245168 +0,1374,0.04196053 +0,1377,0.04147537 +0,1380,0.04099612 +0,1383,0.04052269 +0,1386,0.04005501 +0,1389,0.03959301 +0,1392,0.03913662 +0,1395,0.03868577 +0,1398,0.03824038 +0,1401,0.03780039 +0,1404,0.03736572 +0,1407,0.03693632 +0,1410,0.03651212 +0,1413,0.03609305 +0,1416,0.03567903 +0,1419,0.03527002 +0,1422,0.03486595 +0,1425,0.03446676 +0,1428,0.03407238 +0,1431,0.03368274 +0,1434,0.03329781 +0,1437,0.0329175 +0,1440,0.03254178 diff --git a/man/setParameterValuesByPath.Rd b/man/setParameterValuesByPath.Rd index 39c70a8b9..d0818cc4b 100644 --- a/man/setParameterValuesByPath.Rd +++ b/man/setParameterValuesByPath.Rd @@ -4,7 +4,12 @@ \alias{setParameterValuesByPath} \title{Set the values of parameters in the simulation by path} \usage{ -setParameterValuesByPath(parameterPaths, values, simulation) +setParameterValuesByPath( + parameterPaths, + values, + simulation, + stopIfNotFound = TRUE +) } \arguments{ \item{parameterPaths}{A single or a list of parameter path} @@ -14,6 +19,9 @@ of numeric values, if the value of more than one parameter should be changed. Mu length as 'parameterPaths'} \item{simulation}{Simulation uses to retrieve parameter instances from given paths.} + +\item{stopIfNotFound}{Boolean. If \code{TRUE} (default) and no parameter exists for the given path, +an error is thrown. If \code{FALSE}, a warning is shown to the user} } \description{ Set the values of parameters in the simulation by path diff --git a/man/setQuantityValuesByPath.Rd b/man/setQuantityValuesByPath.Rd index e19dd4011..90eb326ee 100644 --- a/man/setQuantityValuesByPath.Rd +++ b/man/setQuantityValuesByPath.Rd @@ -4,7 +4,12 @@ \alias{setQuantityValuesByPath} \title{Set the values of parameters in the simulation by path} \usage{ -setQuantityValuesByPath(quantityPaths, values, simulation) +setQuantityValuesByPath( + quantityPaths, + values, + simulation, + stopIfNotFound = TRUE +) } \arguments{ \item{quantityPaths}{A single or a list of absolute quantity path} @@ -14,6 +19,9 @@ of numeric values, if the value of more than one quantity should be changed. Mus length as 'quantityPaths'} \item{simulation}{Simulation uses to retrieve quantity instances from given paths.} + +\item{stopIfNotFound}{Boolean. If \code{TRUE} (default) and no qyantuty exists for the given path, +an error is thrown. If \code{FALSE}, a warning is shown to the user} } \description{ Set the values of parameters in the simulation by path diff --git a/tests/data/aging_data.csv b/tests/data/aging_data.csv deleted file mode 100644 index 3a24aa40d..000000000 --- a/tests/data/aging_data.csv +++ /dev/null @@ -1,49 +0,0 @@ -IndividualId,ParameterPath,Time,Value -0,Organism|Hematocrit,0,0.36 -0,Organism|Hematocrit,729890.2481,0.36 -0,Organism|Hematocrit,782486.2481,0.37 -0,Organism|Hematocrit,2833730.248,0.37 -0,Organism|Hematocrit,2886326.248,0.4 -0,Organism|Hematocrit,5989490.248,0.4 -0,Organism|Hematocrit,6042086.248,0.43 -0,Organism|Hematocrit,9145250.248,0.43 -0,Organism|Hematocrit,15456770.25,0.47 -0,Organism|Hematocrit,42280730.25,0.47 -1,Organism|Hematocrit,0,0.36 -1,Organism|Hematocrit,646841.7648,0.36 -1,Organism|Hematocrit,699437.7648,0.37 -1,Organism|Hematocrit,2750681.765,0.37 -1,Organism|Hematocrit,2803277.765,0.4 -1,Organism|Hematocrit,5906441.765,0.4 -1,Organism|Hematocrit,5959037.765,0.43 -1,Organism|Hematocrit,9062201.765,0.43 -1,Organism|Hematocrit,15373721.76,0.47 -1,Organism|Hematocrit,42197681.76,0.47 -2,Organism|Hematocrit,0,0.36 -2,Organism|Hematocrit,703032.9477,0.36 -2,Organism|Hematocrit,755628.9477,0.37 -2,Organism|Hematocrit,2806872.948,0.37 -2,Organism|Hematocrit,2859468.948,0.4 -2,Organism|Hematocrit,5962632.948,0.4 -2,Organism|Hematocrit,6015228.948,0.43 -2,Organism|Hematocrit,9118392.948,0.43 -2,Organism|Hematocrit,15429912.95,0.47 -2,Organism|Hematocrit,42253872.95,0.47 -3,Organism|Hematocrit,0,0.357347382 -3,Organism|Hematocrit,46501.04628,0.36 -3,Organism|Hematocrit,835441.0463,0.36 -3,Organism|Hematocrit,888037.0463,0.37 -3,Organism|Hematocrit,2939281.046,0.37 -3,Organism|Hematocrit,2991877.046,0.4 -3,Organism|Hematocrit,6095041.046,0.4 -3,Organism|Hematocrit,6147637.046,0.41 -3,Organism|Hematocrit,42386281.05,0.41 -4,Organism|Hematocrit,0,0.359636896 -4,Organism|Hematocrit,6365.309092,0.36 -4,Organism|Hematocrit,795305.3091,0.36 -4,Organism|Hematocrit,847901.3091,0.37 -4,Organism|Hematocrit,2899145.309,0.37 -4,Organism|Hematocrit,2951741.309,0.4 -4,Organism|Hematocrit,6054905.309,0.4 -4,Organism|Hematocrit,6107501.309,0.41 -4,Organism|Hematocrit,42346145.31,0.41 \ No newline at end of file diff --git a/tests/dev/script-data-repository.R b/tests/dev/script-data-repository.R index c5e4c7e41..0f916abf2 100644 --- a/tests/dev/script-data-repository.R +++ b/tests/dev/script-data-repository.R @@ -1,7 +1,7 @@ library(ospsuite) # Load the obs data from a pkml file -obsData <- loadDataRepositoryFromPKML("tests/data/obs_data.pkml") +obsData <- loadDataRepositoryFromPKML("inst/extdata/obs_data.pkml") # get the meta data properties as a list metaData <- obsData$metaData diff --git a/tests/dev/script-population.R b/tests/dev/script-population.R index 726d0ad73..a06b02797 100644 --- a/tests/dev/script-population.R +++ b/tests/dev/script-population.R @@ -23,6 +23,6 @@ res <- runSimulation(simulation = sim, population = population) agingData_baby <- loadAgingDataFromCSV("tests/data/baby_aging.csv") -aging_data <- loadAgingDataFromCSV("tests/data/aging_data.csv") +aging_data <- loadAgingDataFromCSV("inst/extdata/aging_data.csv") res <- runSimulation(simulation = sim, population = population, agingData = aging_data) diff --git a/vignettes/create-individual.Rmd b/vignettes/create-individual.Rmd index c7533bfdf..29d70d7be 100644 --- a/vignettes/create-individual.Rmd +++ b/vignettes/create-individual.Rmd @@ -48,7 +48,8 @@ The output contains two lists of parameters - `distributedParameters` and `deriv library(ospsuite) # Load simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") +print(simFilePath) sim <- loadSimulation(simFilePath) # Apply individual parameters diff --git a/vignettes/create-run-population.Rmd b/vignettes/create-run-population.Rmd index 0042c4a2f..4fde40f93 100644 --- a/vignettes/create-run-population.Rmd +++ b/vignettes/create-run-population.Rmd @@ -24,7 +24,7 @@ The method `loadPopulation` creates an object of the `Population` class that can ```{r loadPop} library(ospsuite) # Load population information from csv -popFilePath <- file.path(getwd(), "..", "tests", "data", "pop_10.csv", fsep = .Platform$file.sep) +popFilePath <- system.file("extdata", "pop.csv", package = "ospsuite") myPopulation <- loadPopulation(csvPopulationFile = popFilePath) print(myPopulation) ``` @@ -64,7 +64,7 @@ To run a population simulation, the `Population` object created by the `createPo library(ospsuite) # Load simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) # Run population simulation @@ -77,7 +77,7 @@ The user can change the default behavior by providing custom `SimulationRunOptio ```{r simulationRunOptions} # Load simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) # Create a SimulationRunOptions object diff --git a/vignettes/load-get.Rmd b/vignettes/load-get.Rmd index 0fd19edf0..98264b879 100644 --- a/vignettes/load-get.Rmd +++ b/vignettes/load-get.Rmd @@ -21,7 +21,7 @@ In general, every workflow starts with loading a simulation by calling the `load ```{r loadSim} library(ospsuite) -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) ``` @@ -123,7 +123,7 @@ A convenient way to traverse the simulation structure is given by the method \co ```{r simTree} # Load simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) # Create simulation tree diff --git a/vignettes/pk-analysis.Rmd b/vignettes/pk-analysis.Rmd index 6db112cb2..8f76d2e4e 100644 --- a/vignettes/pk-analysis.Rmd +++ b/vignettes/pk-analysis.Rmd @@ -22,7 +22,7 @@ PK parameters such as AUC, C_max, etc., can be calculated for all outputs of a s library(ospsuite) # Load the simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) # Run the simulation @@ -65,7 +65,7 @@ Population analysis calculated in R can be exported to a *.csv file and loaded i ```{r PKAnalysesExport} # Load and run the simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) simulationResults <- runSimulation(simulation = sim) @@ -73,7 +73,7 @@ simulationResults <- runSimulation(simulation = sim) pkAnalysis <- calculatePKAnalyses(results = simulationResults) # Export to csv -csvPKAnalysisPath <- file.path(getwd(), "..", "tests", "data", "PKAnalyses.csv", fsep = .Platform$file.sep) +csvPKAnalysisPath <- system.file("extdata", "PKAnalyses.csv", package = "ospsuite") exportPKAnalysesToCSV(pkAnalyses = pkAnalysis, filePath = csvPKAnalysisPath) # Load from csv diff --git a/vignettes/run-simulation.Rmd b/vignettes/run-simulation.Rmd index 18055ffb8..ebbe9e3bf 100644 --- a/vignettes/run-simulation.Rmd +++ b/vignettes/run-simulation.Rmd @@ -22,7 +22,7 @@ Once the simulation is loaded (see [Loading a simulation and accessing entities] library(ospsuite) # Load the simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) simulationResults <- runSimulation(simulation = sim) @@ -67,12 +67,12 @@ The results can be stored in and imported from a *.csv file with the methods `ex ```{r SimResultsExport} # Load and run the simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) simulationResults <- runSimulation(simulation = sim) # Export to csv -csvResultsPath <- file.path(getwd(), "..", "tests", "data", "SimResults.csv", fsep = .Platform$file.sep) +csvResultsPath <- system.file("extdata", "SimResults.csv", package = "ospsuite") exportResultsToCSV(results = simulationResults, filePath = csvResultsPath) # Load from csv diff --git a/vignettes/sensitivity-analysis.Rmd b/vignettes/sensitivity-analysis.Rmd index 9b278483c..1e279bdb7 100644 --- a/vignettes/sensitivity-analysis.Rmd +++ b/vignettes/sensitivity-analysis.Rmd @@ -26,7 +26,7 @@ The first step of performing a sensitivity analysis is creating an object of the library(ospsuite) # Load simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "simple.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "simple.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) # Get the paths of parameters that will be considered by default. @@ -52,7 +52,7 @@ New parameters can be added to an existing `SensitivityAnalysis` by calling the library(ospsuite) # Load simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "simple.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "simple.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) # Create a `SensitivityAnalysis` with specified parameters @@ -69,7 +69,7 @@ To run the specified `SensitivityAnalysis`, call the method `runSensitivityAnaly ```{r runSA} # Load simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "simple.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "simple.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) # Create a `SensitivityAnalysis` with all constant and suitable for sensitivity calculations parameters and suitable for sensitivity calculations parameters @@ -83,7 +83,7 @@ The method `allPKParameterSensitivitiesFor` returns a list of `PKParameterSensit ```{r allPKParameterSensitivitiesFor} # Load simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) # Default value of the threshold @@ -109,7 +109,7 @@ Sensitivity analysis calculated in R can be exported to a *.csv file, which can ```{r SAExport} # Load and run the simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "simple.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "simple.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) simulationResults <- runSimulation(simulation = sim) @@ -118,7 +118,7 @@ sa <- SensitivityAnalysis$new(simulation = sim) saResult <- runSensitivityAnalysis(sa) # Export to csv -saResultPath <- file.path(getwd(), "..", "tests", "data", "SAResult.csv", fsep = .Platform$file.sep) +saResultPath <- system.file("extdata", "SAResult.csv", package = "ospsuite") exportSensitivityAnalysisResultsToCSV(results = saResult, filePath = saResultPath) # Load from csv diff --git a/vignettes/set-values.Rmd b/vignettes/set-values.Rmd index 902d57c2a..c979c5e4e 100644 --- a/vignettes/set-values.Rmd +++ b/vignettes/set-values.Rmd @@ -29,7 +29,7 @@ Every (initial) value is described either by a constant or by a formula. If the library(ospsuite) # Load simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) #Get the parameter "Age" of the Organism diff --git a/vignettes/table-parameters.Rmd b/vignettes/table-parameters.Rmd index e55fa6e9d..a68f28051 100644 --- a/vignettes/table-parameters.Rmd +++ b/vignettes/table-parameters.Rmd @@ -22,7 +22,7 @@ Parameters defined by a **table formula** have special syntax of retrieving and library(ospsuite) # Load a simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) #Get the parameter defined by a table. diff --git a/vignettes/unit-conversion.Rmd b/vignettes/unit-conversion.Rmd index 4bd53c9d7..cc381a34c 100644 --- a/vignettes/unit-conversion.Rmd +++ b/vignettes/unit-conversion.Rmd @@ -21,7 +21,7 @@ Every entity - a molecule, a parameter, or an observer - has a certain dimension ```{r dimension} library(ospsuite) # Load a simulation -simFilePath <- file.path(getwd(), "..", "tests", "data", "Aciclovir.pkml", fsep = .Platform$file.sep) +simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") sim <- loadSimulation(simFilePath) #Get the parameter volume of the liver.