ggloor / ALDEx2_dev

ALDEx tool to examine compositional high-throughput sequence data with Welch's t-test
GNU Affero General Public License v3.0
12 stars 6 forks source link

aldex.corr having unexpected behavior #8

Closed valscherz closed 5 years ago

valscherz commented 5 years ago

Hi,

Thanks for the development of this very interesting tool. I am trying to use it for assessing correlation between 16S rRNA microbiota composition and a numeric continuous variable and I am facing issues with the aldex.corr function.

Here are my session infos :

sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)

Running under: Ubuntu 18.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] ALDEx2_1.14.1     ggplot2_3.1.0     phyloseq_1.26.1   readr_1.3.1       tidyr_0.8.2       tibble_2.0.1     
 [7] data.table_1.12.0 dplyr_0.8.0.1     vegan_2.5-4       lattice_0.20-38   permute_0

Then following the aldex.corr description from this manual, I understand that I must first compute aldex.clr to then feed its output to aldex.corr:

# Toy values
values <- round(runif(14,1,5), 2)
data(selex)
selex <- selex[1201:1600,]

## Correlation
x <- aldex.clr(selex, values)

But here is what I obtain:

Error in validObject(.Object) : invalid class “aldex.clr” object: invalid object for slot "conds" in class "aldex.clr": got class "integer", should be or extend class "character"

Which can be fixed by

## Correlation
x <- aldex.clr(selex, as.character(values))

Yet this looks like a bad idea...

And since I am on it, the following example found in the manual is not working neither, throwing the same error:

data(selex)
#subset for efficiency
selex <- selex[1201:1600,]
x <- aldex.clr(selex, 1:14)
corr.test <- aldex.corr(x)

Error in validObject(.Object) : invalid class “aldex.clr” object: invalid object for slot "conds" in class "aldex.clr": got class "integer", should be or extend class "character"

Could you provide some guidance here? Thank you!

Valentin

ggloor commented 5 years ago

could you re-open this in the ALDEx_bioc repository? Thanks