Skip to content

Commit

Permalink
fix: Handle zero-sum samples in generate_taxa_trend_test_long
Browse files Browse the repository at this point in the history
- Add check for samples with zero total counts after filtering
- Remove zero-sum samples before running linda analysis
- Prevent NA values during TSS normalization
- Related to Issue #69
  • Loading branch information
cafferychen777 committed Nov 8, 2024
1 parent b0afb6c commit 0ccb605
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/generate_taxa_trend_test_long.R
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ generate_taxa_trend_test_long <-
feature.dat.type = "proportion"
}

# Add this check before linda analysis
if (any(colSums(otu_tax_agg_filter) == 0)) {
keep_samples <- colSums(otu_tax_agg_filter) > 0
otu_tax_agg_filter <- otu_tax_agg_filter[, keep_samples]
meta_tab <- meta_tab[keep_samples, ]
}

# Perform LinDA (Linear models for Differential Abundance) analysis
linda.obj <- linda(
feature.dat = otu_tax_agg_filter,
Expand Down

0 comments on commit 0ccb605

Please sign in to comment.