# Maaslin3 undefined columns selected

**URL:** <https://forum.biobakery.org/t/maaslin3-undefined-columns-selected/7561>\
**Category:** MaAsLin\
**Created:** [November 7, 2024, 10:40pm UTC](https://forum.biobakery.org/t/maaslin3-undefined-columns-selected/7561 "2024-11-07T22:40:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anahid\_Amani](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/anahid_amani/32/2575_2.png) [@Anahid\_Amani](https://forum.biobakery.org/u/Anahid_Amani)\
**Post date:** [November 7, 2024, 10:40pm UTC](https://forum.biobakery.org/t/maaslin3-undefined-columns-selected/7561/1 "2024-11-07T22:40:57Z")

</div>

Hi all,  
I’ve ran into an issue while running maaslin3 and haven’t been able to solve it using other people’s experience. I’d appreciate if I can get some help on this  
this is the error I’m getting:  
Error in `[.data.frame`(metadata, , i) : undefined columns selected

I have replaced any special characters in the column and row names.

here is my code:

taxa\_table ← read.table(“t\_taxa.txt”,  
header = TRUE,  
sep = “\t”,  
stringsAsFactors = FALSE)  
taxa\_table$SampleID ← gsub(“-”, “\_”, taxa\_table$SampleID)

metadata ← read.table(“howlermeta.txt”,  
header = TRUE,  
sep = “\t”,  
stringsAsFactors = FALSE)

metadata$SampleID ← gsub(“-”, “\_”, metadata$SampleID)

metadata$Individual ←   
factor(metadata$Individual, levels = c(“Dos” , “Hugo”, “Isa”, “Jupiler”, “Melanie”, “Maia”, “Uno”))  
metadata$Sex ←   
factor(metadata$Sex, levels = c(“Male”,“Female”))  
metadata$Season ←   
factor(metadata$Season, levels = c( “Dry”, “Intermediate”, “Rain” ))  
metadata$Age ←   
factor(metadata$Age)

colnames(taxa\_table) ← gsub(“\.”, “\_”, colnames(taxa\_table))

set.seed(1)  
fit\_out ← maaslin3(input\_data = taxa\_table ,  
input\_metadata = metadata,  
output = ‘hmp2\_output’,  
formula = '~ Season + Sex ',  
fixed\_effects = “Dry”,  
normalization = ‘TSS’,  
transform = ‘LOG’,  
augment = TRUE,  
standardize = TRUE,  
max\_significance = 0.1,  
median\_comparison\_abundance = TRUE,  
median\_comparison\_prevalence = FALSE,  
max\_pngs = 250,  
cores = 1)

---

<div class="post-metadata">

**Author:** ![WillNickols](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/willnickols/32/3223_2.png) [@WillNickols](https://forum.biobakery.org/u/WillNickols)\
**Post date:** [November 11, 2024, 3:04am UTC](https://forum.biobakery.org/t/maaslin3-undefined-columns-selected/7561/2 "2024-11-11T03:04:14Z")

</div>

Hi! I think the problem is that you’re including `fixed_effects = “Dry”`. Just removing it should fix the issue (and you already have `Season` which is the column name I think you care about). Also, if you’re supplying a formula, anything in the `*_effects` options will be disregarded.

---

<div class="post-metadata">

**Author:** ![Anahid\_Amani](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/anahid_amani/32/2575_2.png) [@Anahid\_Amani](https://forum.biobakery.org/u/Anahid_Amani)\
**Post date:** [November 26, 2024, 6:08pm UTC](https://forum.biobakery.org/t/maaslin3-undefined-columns-selected/7561/3 "2024-11-26T18:08:42Z")

</div>

Thank you so much  
it worked!
