dieterich-lab / CircTest

CircRNA testing and ploting R package
9 stars 8 forks source link

Possible convergence problem #11

Closed EricSHo closed 3 years ago

EricSHo commented 4 years ago

Hi,

I have installed the CircTest (0.1.1) package with aod (1.3.1) today. I followed all the filtering steps with no apparent problems. Here's the Circ.filter parameters used:

Circ_filtered <- Circ.filter(circ = CircRNACount, linear = LinearCount, Nreplicates = 3, filter.sample = 3, filter.count = 5, percentage = 0.1 )

Got the LinearCount_filtered as said in the documentation.

I wanted to compare two conditions, each with three replicates. Then I used Circ.test(...) as below: test <- Circ.test(Circ_filtered, Linear_filtered, group=c(rep(1,3),rep(2,3)))

The CircTest gave me a hard time. There were a ton of "Possible convergence problem" messages.

Loading required package: aod

Possible convergence problem. Optimization process code: 10 (see ?optim).

Possible convergence problem. Optimization process code: 10 (see ?optim). ...

What might went wrong?

Any help is appreciated.

Eric.

EricSHo commented 4 years ago

Forgot to mention.

The output of Circ.test() was an empty table with 1+6 columns.

EricSHo commented 4 years ago

More information:

The error message displayed at the end: 547 candidates processed in total 0 candidates passed the specified thresholds There were 50 or more warnings (use warnings() to see the first 50)

Warning messages:

Warning messages: 1: In betabin(cbind(circ, tot - circ) ~ group, ~1, data = testdat) : Possible convergence problem. Optimization process code: 10 (see ?optim).

2: In betabin(cbind(circ, tot - circ) ~ group, ~1, data = testdat) : Possible convergence problem. Optimization process code: 10 (see ?optim).

...

tjakobi commented 4 years ago

This is most probably related to https://github.com/dieterich-lab/CircTest/issues/2.

The warning is caused by the aod package, probably because the optimization has reached the default maximum number of iterations before convergence.

There might be additional parameter for aod to increase the number of iterations, but that would require code changes in circtest. I have to say, I very, very rarely saw the warning and ignored it since I still got reasonable results. In this case unfortunately, you don't seem to get any significant circRNA candidates.

If I have to time I will look into possible code changes, but that might be some time.

EricSHo commented 4 years ago

I have made some changes to my data but still have a problem!

test <- Circ.test(Circ_filtered, Linear_filtered, group=c(rep(1,3),rep(2,3)), circle_description=c(1:3)) Error: Assigned data mean(...) must be compatible with existing data. ℹ Error occurred for column group_1_ratio_mean. ✖ Can't convert from to due to loss of precision.

  • Locations: 1. Run rlang::last_error() to see where the error occurred. rlang::last_error() <error/tibble_error_assign_incompatible_type> Assigned data mean(...) must be compatible with existing data. ℹ Error occurred for column group_1_ratio_mean. ✖ Can't convert from to due to loss of precision.
  • Locations: 1. Backtrace:
    1. CircTest::Circ.test(...)
    2. tibble:::[<-.tbl_df(...)
    3. tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
    4. tibble:::tbl_subassign_row(xj, i, value, value_arg)
    5. base::tryCatch(...)
    6. base:::tryCatchList(expr, classes, parentenv, handlers)
    7. base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
    8. value[3L] Run rlang::last_trace() to see the full context.

dim(Circ_filtered) [1] 547 9 dim(Linear_filtered) [1] 547 9

aod_1.3.1 CircTest_0.1.1

Any insight? Is it the ratio of circRNA to (circRNA+Linear) too small? I filtered by percentage=0.1).

Help appreciated.

tjakobi commented 4 years ago

Thank you for following up.

I'll look into it, maybe I am using another version of aod that behaves differently.

EricSHo commented 4 years ago

Okay. I solved the last problem "Can't convert from to due to loss of precision".

It is because I used dplyr tibble to store Circ and Linear. If they are stored in data.frames, the issue disappeared but it became the original optimization issue, unfortunately!