I want to look for differentially abundant functions across metagenomes. I got counts from Salmon where I mapped reads to a non-redundant set of annotated bacterial genes and I summed the counts by functional category (here, pfam as a starting point). This count data does not have any zeros.
So my input matrix has the counts for 89 samples and 7771 pfams. MaAsLin3 fails at the linear model step. The error message I get is “Error in l[[1L]] : subscript out of bounds”. Looking at the full log output, I see two things happening: all the features (pfams) are being removed: “Total features filtered by non-zero variance filtering: 7771”. I also see that the normalized data (data_norm.tsv) has the same value repeated for every sample down the columns for each pfam - so the normalization step is causing the issue.
Here is the command I used:
fit_out ← maaslin3(input_data = pfam,
input_metadata = metadata,
output = ‘DA_pfam_SCTLDbeforeoratsampling’,
formula = ‘~ SCTLD_before_or_at_sampling’,
zero_threshold = 0,
min_variance = 0,
normalization = ‘TSS’,
transform = ‘LOG’,
standardize = TRUE,
max_significance = 0.1,
median_comparison_abundance = TRUE,
median_comparison_prevalence = TRUE)
What would be the appropriate normalization and transformation steps for functional (metagenomic) counts where there are no zeros in the original count data?