Open weiGu-88 opened 1 week ago
Could you please explain the reason behind the error 'Error in aldex.clr.function(reads, conds, mc.samples, denom, verbose, : rownames(reads) cannot be empty' and suggest how to modify the code to resolve it?
Hi @weiGu-88,
Thank you for reporting this issue. The error Error in aldex.clr.function(reads, conds, mc.samples, denom, verbose): rownames(reads) cannot be empty
typically occurs due to a few common reasons:
# Check your data structure first
print(head(kegg_abundance))
print(dim(kegg_abundance))
print(head(rownames(kegg_abundance)))
if (is.null(rownames(kegg_abundance))) {
kegg_abundance <- kegg_abundance %>% column_to_rownames("pathway") # or whatever your pathway ID column is named }
2. **Data Transformation Fix**
```R
# Make sure your abundance data is properly formatted
kegg_abundance <- as.data.frame(kegg_abundance)
# Remove any rows with all zeros
kegg_abundance <- kegg_abundance[rowSums(kegg_abundance) > 0, ]
# Ensure numeric values
kegg_abundance <- mutate_all(kegg_abundance, as.numeric)
library(tidyverse)
library(ggpicrust2)
kegg_abundance <- ko2kegg_abundance("your_file.tsv")
stopifnot(!is.null(rownames(kegg_abundance))) stopifnot(nrow(kegg_abundance) > 0)
daa_results_df <- pathway_daa( abundance = kegg_abundance, metadata = metadata, group = "group", daa_method = "ALDEx2", select = NULL, reference = NULL )
**Additional Troubleshooting Tips:**
1. Make sure your abundance data contains no negative values
2. Verify that your metadata group column matches exactly with your sample names
3. Consider using `print(str(kegg_abundance))` to inspect the data structure
If you could share a small sample of your data (first few rows/columns), I can provide more specific guidance.
Best regards,
Chen Yang
Hi, First of all, thanks for creating this tool.I encountered the same issue as #106.Could you please provide a code modification strategy? Thank you for your response.