ALDEx2 Error Message: "dim(X) must have a positive length" when using aldex.clr() with denom="iqlr"
0
0
Entering edit mode
cwarden45 • 0
@cwarden45-7951
Last seen 24 months ago
United States

Hi,

I am trying to test out the Inter-Quartile Log-Ratio (IQLR) normalization implemented in ALDEX2, using the parameter denom="iqlr" for aldex.clr().

However, I am receiving the following output / error message when running Rscript:

operating in serial mode

computing iqlr centering

Error in apply(reads.clr[these.rows, ], 2, function(x) { :

dim(X) must have a positive length

Calls: aldex.clr ... aldex.clr.function -> aldex.set.mode -> iqlr.features -> apply

Execution halted

The full script being used is available here. All input files are also uploaded in that GitHub repository under this subfolder, such as n29_FILTERED_Braken_genera-counts.txt and Bacteria11.bed.

However, I think the most relevant part of the script is as follows:

# "oral_table" is a data frame with samples in columns and genera in rows (with the genera names as row names)

ALDEx2_object = aldex.clr(oral_table, paste(Species,SampleSite,sep=""), denom="iqlr")
ALDEx2_MonteCarlo = getMonteCarloInstances(ALDEx2_object)

norm_table=matrix(ncol=ncol(oral_table), nrow=nrow(oral_table))
colnames(norm_table)=names(ALDEx2_MonteCarlo)
rownames(norm_table)=rownames(oral_table)
for (i in 1:ncol(norm_table)){
    temp_norm= apply(data.frame(ALDEx2_MonteCarlo[i]),1,median)
    norm_table[,i] = temp_norm[match(rownames(norm_table), names(temp_norm))]
}#end for (i in 1:ncol(norm_table))
norm_table=norm_table[,match(Samples,colnames(norm_table))]

As requested, here is the information from sessionInfo():

> sessionInfo( )
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /opt/R-3.6.3/lib/libRblas.so
LAPACK: /opt/R-3.6.3/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] ALDEx2_1.16.0

loaded via a namespace (and not attached):
 [1] matrixStats_0.58.0          lattice_0.20-38
 [3] IRanges_2.18.3              bitops_1.0-6
 [5] grid_3.6.3                  GenomeInfoDb_1.20.0
 [7] stats4_3.6.3                zlibbioc_1.30.0
 [9] XVector_0.24.0              S4Vectors_0.22.1
[11] Matrix_1.2-18               BiocParallel_1.18.1
[13] tools_3.6.3                 Biobase_2.44.0
[15] RCurl_1.95-4.12             DelayedArray_0.10.0
[17] parallel_3.6.3              compiler_3.6.3
[19] BiocGenerics_0.30.0         GenomicRanges_1.36.1
[21] SummarizedExperiment_1.14.1 GenomeInfoDbData_1.2.1

I receive a similar message if I use R v4.2.1 (still with "dim(X) must have a positive length").

If it might help, there is some additional information on the background for the test here. I could try summing the counts between the lower and upper quartiles myself, but I thought it might be good if I could use ALDEx2 (and take the median of the Monte Carlo transformations).

I was able to successfully run aldex.clr() with the default settings in this script.

Can you please help me troubleshoot this error message?

Please let me know if you have any questions and/or need any additional information.

Thank you very much!

Sincerely,

Charles

Metagenomics IQLR ALDEx2 • 757 views
ADD COMMENT

Login before adding your answer.

Traffic: 349 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6