## Possible bug in bootf2BCA [Software]

Hi All,

Detlew mentioned

For example, for the following data (mean value from sample data of bootf2BCA), according to EMA's rule, only 1 time point after 85% should be used, so the cutting point is 90 min; data of 180 min should not be used. According to US FDA's rule agreed by many, both test and reference should reach >=85% so the cutting point is 180 min. In this case, use all data point.

However, if you set

The rule, as far as I understood the code, is defined as a function between line 84 and 112 in CLI version of the program and copied below (I added some spaces and comments to make the code easier to read. Original source file contains almost no comment and is hard to read as Detlew warned in his post).

Using the table above as an example and set

Is above the correct evaluation in R? Or there's something wrong in step 3?

I changed the

So what's the purpose of variable

Is there anyone else noticed the same problem, or any other issues when using the program?

Detlew mentioned

`bootf2BCA`

for bootstrap f2 method, written by Aleksander Mendyk, the author of another tool `PhEq_bootstrap`

. I have been using both programs for some time now and I just noticed that there might be an error in the bootf2BCA when you want to use only 1 time point after >=85% release, according to EMA's rule. For example, for the following data (mean value from sample data of bootf2BCA), according to EMA's rule, only 1 time point after 85% should be used, so the cutting point is 90 min; data of 180 min should not be used. According to US FDA's rule agreed by many, both test and reference should reach >=85% so the cutting point is 180 min. In this case, use all data point.

`Time Test Ref`

30 40.3 34.9

60 67.1 59.5

90 87.0 79.3

180 97.7 95.1

However, if you set

`my85auto_rule = 1`

in the function (CLI version) or choose 1 profile in GUI version, the report file shows that all f2 were actually calculated according to US FDA's rule, same as if you set `my85auto_rule = 2`

. The rule, as far as I understood the code, is defined as a function between line 84 and 112 in CLI version of the program and copied below (I added some spaces and comments to make the code easier to read. Original source file contains almost no comment and is hard to read as Detlew warned in his post).

`#function to employ a rule that no more than one point after 85% dissolution should be taken into account when calculating f2`

prepare_profiles_cutoff_85_percent <- function(data_matrix){

res_data <- matrix()

lk_stop <- nrow(data_matrix)

is_second <- FALSE

for(i in 1:nrow(data_matrix)){

if(my85auto_rule == 1){

if((data_matrix[i, 1] >= 85) || (data_matrix[i, 2] >= 85)){

if (is_second){

lk_stop <- i

break

}else{

is_second <- TRUE

}

} # end t >= 85 || r >= 85 if condition

}else{ # for my85auto_rule not equal to 1. not relevant to discussion here

if((data_matrix[i, 1] >= 85) && (data_matrix[i, 2] >= 85)){

if (is_second){

lk_stop <- i

break

}else{

is_second <- TRUE

}

} # end t >= 85 && r >= 85 if condition

} # end for my85auto_rule !=1

} # end for loop

res_data <- data_matrix[1:lk_stop, ]

return(res_data)

}

Using the table above as an example and set

`my85auto_rule = 1`

in the function (so forget the `else `

expression where this value is not 1), my understanding to evaluate `for `

loop is as follows, though I’m not sure the purpose of the variable `is_second`

here:- Loop start,
`i=1`

, if condition (`(data_matrix[i,1]>=85)||(data_matrix[i,2]>=85)`

) is false, so expression within {} is skipped.

- Loop over,
`i=2`

, the same.

- Loop over,
`i=3`

, if condition(`(data_matrix[i,1]>=85)||(data_matrix[i,2]>=85)`

) is true because test release 87% at 90 min, evaluate expression within {}.

- if condition is false because variable
`is_second`

is false by default

- expression in
`else`

is evaluated so this variable became true (by`is_second <- TRUE`

).

- if condition is false because variable
- Looping over,
`i=4`

, if condition (`(data_matrix[i,1]>=85)||(data_matrix[i,2]>=85)`

) is true and if condition (`is_second`

) is also true, so variable`1k_stop`

gets value 4 from`i`

. loop`break`

.

- Therefore, after
`for`

loop, the`res_data`

is data_matrix[1:4, ], including 180 min data point, which might explain what happened.

Is above the correct evaluation in R? Or there's something wrong in step 3?

I changed the

`for `

loop code to the following and it seems it works.```
prepare_profiles_cutoff_85_percent <- function(data_matrix){
```

res_data <- matrix()

lk_stop <- nrow(data_matrix)

is_second <- FALSE

for(i in 1:nrow(data_matrix)){

if(my85auto_rule == 1){

if((data_matrix[i, 1] >= 85)||(data_matrix[i, 2] >= 85)){

lk_stop <- i

break

}

}else{

... i didn't change the rest since I only need to use EMA's rule at the moment.

}

So what's the purpose of variable

`is_second`

? Is there anyone else noticed the same problem, or any other issues when using the program?

—

All the best,

Shuanghe

All the best,

Shuanghe

### Complete thread:

- Possible bug in bootf2BCAShuanghe 2019-04-03 17:41 [Software]
- Bug in bootf2BCA - Open source rulez! d_labes 2019-04-03 19:42
- newer version of bootf2BCA Shuanghe 2019-05-06 09:39

- Bug in bootf2BCA - Open source rulez! d_labes 2019-04-03 19:42