Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All my pathway results are NA #122

Open
weiGu-88 opened this issue Nov 1, 2024 · 2 comments
Open

All my pathway results are NA #122

weiGu-88 opened this issue Nov 1, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@weiGu-88
Copy link

weiGu-88 commented Nov 1, 2024

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.

@weiGu-88 weiGu-88 added the bug Something isn't working label Nov 1, 2024
@weiGu-88
Copy link
Author

weiGu-88 commented Nov 1, 2024

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?

@cafferychen777
Copy link
Owner

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:

  1. Data Format Issues
# Check your data structure first
print(head(kegg_abundance))
print(dim(kegg_abundance))
print(head(rownames(kegg_abundance)))

# Ensure proper row names
if (is.null(rownames(kegg_abundance))) {
  # If your first column contains pathway IDs
  kegg_abundance <- kegg_abundance %>%
    column_to_rownames("pathway") # or whatever your pathway ID column is named
}
  1. Data Transformation Fix
# 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)
  1. Complete Working Example
library(tidyverse)
library(ggpicrust2)

# Load and prepare data
kegg_abundance <- ko2kegg_abundance("your_file.tsv")

# Verify data structure
stopifnot(!is.null(rownames(kegg_abundance)))
stopifnot(nrow(kegg_abundance) > 0)

# Perform pathway analysis
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants