cmmr / rbiom

Interact with Biological Observation Matrix files.
https://cmmr.github.io/rbiom/
Other
11 stars 0 forks source link

Biom file with unequal rows and columns #11

Closed shwetha141 closed 8 months ago

shwetha141 commented 9 months ago

I have a biom file when imported gives me the same error with rbiom's read_biom and phyloseq's import_biom. I was wondering if you could give me a possible workaround

"Error in if (ncol(object) > length(object$columns)) { : missing value where TRUE/FALSE needed"

R version 4.3.1 (2023-06-16 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 11 x64 (build 22621)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

time zone: America/Chicago tzcode source: internal

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

other attached packages: [1] rbiom_1.0.3 biomformat_1.28.0 dplyr_1.1.4 microbiome_1.22.0 ggplot2_3.4.4
[6] phyloseq_1.44.0 qiimer_0.9.4

loaded via a namespace (and not attached): [1] bitops_1.0-7 remotes_2.4.2.1 permute_0.9-7
[4] rlang_1.1.2 magrittr_2.0.3 ade4_1.7-22
[7] compiler_4.3.1 mgcv_1.8-42 callr_3.7.3
[10] vctrs_0.6.5 reshape2_1.4.4 stringr_1.5.1
[13] profvis_0.3.8 pkgconfig_2.0.3 crayon_1.5.2
[16] fastmap_1.1.1 XVector_0.42.0 ellipsis_0.3.2
[19] utf8_1.2.4 promises_1.2.1 sessioninfo_1.2.2
[22] ps_1.7.5 purrr_1.0.2 xfun_0.41
[25] zlibbioc_1.48.0 cachem_1.0.8 GenomeInfoDb_1.38.1
[28] jsonlite_1.8.8 highr_0.10 later_1.3.2
[31] rhdf5filters_1.12.1 Rhdf5lib_1.22.1 parallel_4.3.1
[34] cluster_2.1.4 R6_2.5.1 stringi_1.8.2
[37] RColorBrewer_1.1-3 pkgload_1.3.3 knitr_1.45
[40] Rcpp_1.0.11 iterators_1.0.14 usethis_2.2.2
[43] IRanges_2.36.0 httpuv_1.6.13 Matrix_1.6-4
[46] splines_4.3.1 igraph_1.6.0 tidyselect_1.2.0
[49] rstudioapi_0.15.0 vegan_2.6-4 codetools_0.2-19
[52] miniUI_0.1.1.1 curl_5.1.0 processx_3.8.3
[55] pkgbuild_1.4.3 lattice_0.21-8 tibble_3.2.1
[58] plyr_1.8.9 Biobase_2.62.0 shiny_1.8.0
[61] withr_2.5.2 evaluate_0.23 Rtsne_0.17
[64] r4np_0.6.1.2.2 desc_1.4.3 survival_3.5-5
[67] RcppParallel_5.1.7 urlchecker_1.0.1 Biostrings_2.70.1
[70] pillar_1.9.0 BiocManager_1.30.22 foreach_1.5.2
[73] stats4_4.3.1 generics_0.1.3 RCurl_1.98-1.13
[76] S4Vectors_0.40.2 munsell_0.5.0 scales_1.3.0
[79] xtable_1.8-4 slam_0.1-50 glue_1.6.2
[82] pheatmap_1.0.12 tools_4.3.1 data.table_1.14.10
[85] fs_1.6.3 rhdf5_2.44.0 grid_4.3.1
[88] tidyr_1.3.0 ape_5.7-1 devtools_2.4.5
[91] colorspace_2.1-0 nlme_3.1-162 GenomeInfoDbData_1.2.11 [94] cli_3.6.1 fansi_1.0.6 gtable_0.3.4
[97] digest_0.6.33 BiocGenerics_0.48.1 htmlwidgets_1.6.4
[100] memoise_2.0.1 htmltools_0.5.7 multtest_2.56.0
[103] lifecycle_1.0.4 mime_0.12 MASS_7.3-60

dansmith01 commented 9 months ago

If both packages are having trouble importing it, then there's a good chance that the biom file itself isn't formatted correctly. You can try the command line tools qiime and biom-format to see if they have any better luck parsing it. You could also open it in a text editor to see how it compares to the biom spec at biom-format.org

shwetha141 commented 9 months ago

Hello, thank you. I parsed the file and since it was in JSON format, I was able to slice the components. Not sure if it is the right way.:)