uqrmaie1 / admixtools

https://uqrmaie1.github.io/admixtools
71 stars 14 forks source link

Error in if (gimp > 0 && gimp%%plusminus_generations == 0) { : missing value where TRUE/FALSE needed #63

Open diegovelizo opened 5 months ago

diegovelizo commented 5 months ago

Hi,

I'm trying to run find_graphs() in a SGE cluster but I keep getting this error:

Error in if (gimp > 0 && gimp%%plusminus_generations == 0) { : 
  missing value where TRUE/FALSE needed
Calls: find_graphs
Execution halted

The jobs do run for a while, and I can see that the optimization seems to be working, but at some point all jobs (100 replicates) error out. This is an example log file I get before the jobs are halted:

✔ 1: score 37745.311    best score 37745.311    none    tot 1
✔ 2: score 37507.097    best score 37507.097    numadmix 0  mutate_n    tot 20
✔ 3: score 36316.838    best score 36316.838    numadmix 0  spr_leaves  tot 39
✔ 4: score 35495.21 best score 35495.21 numadmix 0  rearrange_negdrift  tot 59
✔ 5: score 35470.034    best score 35470.034    numadmix 0  rearrange_negdrift  tot 76
✔ 6: score 34983.445    best score 34983.445    numadmix 0  spr_leaves  tot 94
✔ 7: score 34925.946    best score 34925.946    numadmix 0  mutate_n    tot 112
✔ 8: score 34421.404    best score 34421.404    numadmix 0  rearrange_negdrift  tot 128
✔ 9: score 33316.611    best score 33316.611    numadmix 0  swap_negdrift   tot 144
✔ 10: score 31760.565   best score 31760.565    numadmix 0  rearrange_negdrift  tot 161
✔ 11: score 31516.545   best score 31516.545    numadmix 0  rearrange_negdrift  tot 177
✔ 12: score 31516.534   best score 31516.534    numadmix 0  rearrange_negdrift  tot 192
✔ 13: score 30952.596   best score 30952.596    numadmix 0  rearrange_negdrift  tot 207
✔ 14: score 30821.769   best score 30821.769    numadmix 0  rearrange_negdrift  tot 220
✔ 15: score 30818.249   best score 30818.249    numadmix 0  rearrange_negdrift  tot 234
✔ 16: score 30735.768   best score 30735.768    numadmix 0  rearrange_negdrift  tot 247
✔ 17: score 30038.832   best score 30038.832    numadmix 0  rearrange_negdrift  tot 262
✔ 18: score 29460.74    best score 29460.74 numadmix 0  rearrange_negdrift  tot 276
✔ 19: score 29079.491   best score 29079.491    numadmix 0  swap_negdrift   tot 289
✔ 20: score 28623.11    best score 28623.11 numadmix 0  rearrange_negdrift  tot 305
✔ 21: score 28148.402   best score 28148.402    numadmix 0  rearrange_negdrift  tot 320
✔ 22: score 28068.099   best score 28068.099    numadmix 0  rearrange_negdrift  tot 332
✔ 23: score 27892.473   best score 27892.473    numadmix 0  rearrange_negdrift  tot 343
✔ 24: score 27892.47    best score 27892.47 numadmix 0  rearrange_negdrift  tot 353
✔ 25: score 27863.882   best score 27863.882    numadmix 0  rearrange_negdrift  tot 360
✔ 26: score 19965.123   best score 19965.123    numadmix 0  rearrange_negdrift  tot 372
✔ 27: score 19945.74    best score 19945.74 numadmix 0  rearrange_negdrift  tot 383
✔ 28: score 19740.792   best score 19740.792    numadmix 0  rearrange_negdrift  tot 396
✔ 29: score 19400.029   best score 19400.029    numadmix 0  mutate_n    tot 409
✔ 30: score 19249.685   best score 19249.685    numadmix 0  rearrange_negdrift  tot 419
✔ 31: score 19231.877   best score 19231.877    numadmix 0  rearrange_negdrift  tot 429
✔ 32: score 19231.871   best score 19231.871    numadmix 0  rearrange_negdrift  tot 439
✔ 33: score 16810.862   best score 16810.862    numadmix 0  rearrange_negdrift  tot 453
✔ 34: score 16764.903   best score 16764.903    numadmix 0  rearrange_negdrift  tot 465
✔ 35: score 15957.331   best score 15957.331    numadmix 0  rearrange_negdrift  tot 477
✔ 36: score 15180.806   best score 15180.806    numadmix 0  rearrange_negdrift  tot 488
✔ 37: score 15088.916   best score 15088.916    numadmix 0  rearrange_negdrift  tot 501
✔ 38: score 15084.635   best score 15084.635    numadmix 0  rearrange_negdrift  tot 512
ℹ 39: score 15205.858   best score 15084.635    numadmix 0  spr_leaves  tot 523

These are the parameters I'm using:

initgraph_path=NULL
numadmix=0
max_admix=5
stop_gen=2000
stop_gen2=15
numgraphs=20
outpop="outgroup"
plusminus_generations=5

As a side question, what does the "ℹ" sign in the log file mean?

Thank you,

Diego

diegovelizo commented 5 months ago

Hi again Robert,

I've found the problem. Embarrassingly, it was a bug in my code. This was not really an issue with the package, so please feel free to delete this issue if you deem it necessary.

Thank you, Diego

uqrmaie1 commented 5 months ago

No problem, glad you found the bug!

Admixtools 2 uses a few different logging functions that start with different symbols and show up in different colors in most environments in interactive mode. They are not exported, but can be accessed for example via admixtools:::alert_success.

When running find_graphs(), the green indicates that a new best-fitting model has been found in this generation. Otherwise, the message will be teal-colored and starts with .