ggloor / ALDEx_bioc

ALDEx_bioc is the working directory for updating bioconductor
27 stars 13 forks source link

aldex.effect include.sample.summary issue #41

Closed JEckenberger closed 3 years ago

JEckenberger commented 3 years ago

Hi, I found an issue with the include.sample.summary argument in the aldex.effect function. When using the argument under R 3.6.2 and the ALDEx2 version 1.16.0 all is good:

 library(ALDEx2); packageVersion("ALDEx2")    

[1] ‘1.16.0’

  data(selex)
  selex.sub <- selex[1:400,]
  conds <- c(rep("NS", 7), rep("S", 7))
  x <- aldex.clr(selex.sub, conds, mc.samples=128, denom="all", verbose=F)
  x.effect <- aldex.effect(x, CI=T, verbose=FALSE,include.sample.summary = TRUE)
  x.effect[1:6,1:6]

rab.all rab.win.NS rab.win.S rab.sample.X1_ANS rab.sample.X1_BNS rab.sample.X1_CNS A:D:A:D 1.6030007 1.5382122 2.3137897 1.4723764 1.6148116 1.6359866 A:D:A:E 1.9001917 1.7345307 4.0245559 1.7893647 2.0312430 1.8619915 A:E:A:D 3.9435508 1.6312451 10.7664531 1.9402834 1.6978629 1.5823448 A:E:A:E 3.8562343 1.8683216 13.7598065 2.0280768 1.8060024 1.7452067 A:D:C:D 0.5185451 0.6436814 -0.2388991 0.5065450 0.9057612 0.6285314 A:D:C:E 0.5207592 0.6080908 -0.3051005 0.8290245 0.6525141 0.2392668

But when I try the same under R 4.1.0 and ALDEx2 version 1.24.0 I get a warning and all the median clr values for each sample are the same for each taxon:

  library(ALDEx2); packageVersion("ALDEx2")    

[1] ‘1.24.0’

  data(selex)
  selex.sub <- selex[1:400,]
  conds <- c(rep("NS", 7), rep("S", 7))
  x <- aldex.clr(selex.sub, conds, mc.samples=128, denom="all", verbose=F)
  x.effect <- aldex.effect(x, CI=T, verbose=FALSE,include.sample.summary = TRUE)

There were 15 warnings (use warnings() to see them)

 warnings()[1]

Warning message: In [<-.data.frame(*tmp*, , nm, value = structure(list( ... : provided 400 variables to replace 1 variables

  x.effect[1:6,1:6]

rab.all rab.win.NS rab.win.S rab.sample.X1_ANS rab.sample.X1_BNS rab.sample.X1_CNS A:D:A:D 1.6030007 1.5382122 2.3137897 1.472376 1.614812 1.635987 A:D:A:E 1.9001917 1.7345307 4.0245559 1.472376 1.614812 1.635987 A:E:A:D 3.9435508 1.6312451 10.7664531 1.472376 1.614812 1.635987 A:E:A:E 3.8562343 1.8683216 13.7598065 1.472376 1.614812 1.635987 A:D:C:D 0.5185451 0.6436814 -0.2388991 1.472376 1.614812 1.635987 A:D:C:E 0.5207592 0.6080908 -0.3051005 1.472376 1.614812 1.635987

I haven't found anything online about this and was wondering if you might be able to help me with this.

ggloor commented 3 years ago

Thanks for this. This bug has been fixed and the fix will appear in the next update to bioconductor in about a week

In the meantime, you can download and install the development version