The bioBakery help forum

Error in fit_adjust_batch script in the MMUPHin package

metadata <-readr::read_tsv(“metadata_for78_SeqLib_2021.tsv”, comment = “#q2:type”)
count_tab ← ASV_35K$data %>% %>%

fit_adjust_batch ← adjust_batch(feature_abd = count_tab, batch = “SeqLib”, covariates = NULL, data = metadata, control = list(verbose = FALSE))
Error in floor(feature_abd) : :
non-numeric argument to mathematical function!
I coded in string for count_tab, str(count_tab), and the first column has class of chr, how to I stop R from reading the first column?

metadata_for78_SeqLib_2021.tsv (11.9 KB)

I also have a qza file but it work upload. If anyone can give insight.on how to upload that here.

The feature_abd argument should be a matrix, and having rownames should be alright. I think changing the command creating count_tab to the following should fix your problem:

count_tab ← ASV_35K$data %>% %>% as.matrix()

Thank you for your insight, when changing it to that, it now shows error in rownames_to _column(., “Feature.ID”): is not TRUE

I am working with @katejane. I found the solution to my error. For those working with the qiime2r package to import files for this package, I had to also add column_to_rownames(“SampleID”) to my metadata file:

metadata <-readr::read_tsv("metadata.tsv", comment = "#q2:type") %>% %>% column_to_rownames("SampleID")
count_tab <- ASV$data %>% %>% as.matrix()