# Incorrect name/value in output

**URL:** <https://forum.biobakery.org/t/incorrect-name-value-in-output/4697>\
**Category:** MaAsLin\
**Created:** [January 23, 2023, 8:46pm UTC](https://forum.biobakery.org/t/incorrect-name-value-in-output/4697 "2023-01-23T20:46:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hharder](https://avatars.discourse-cdn.com/v4/letter/h/e5b9ba/32.png) [@hharder](https://forum.biobakery.org/u/hharder)\
**Post date:** [January 23, 2023, 8:46pm UTC](https://forum.biobakery.org/t/incorrect-name-value-in-output/4697/1 "2023-01-23T20:46:40Z")

</div>

My metadata contains levels of a variable called “Txt\_Dose” that are “VEH\_10”, “VEH\_12”, “VEH\_14”, “VEH\_16”, and “MOR\_10”, “MOR\_12”, “MOR\_14”, “MOR\_16”. When running the following analysis, my name and value outputs come out as Txt\_Dose2, Txt\_Dose3, etc… Why is it not using the levels of my factor?

fit\_dam4\_10 = Maaslin2(  
input\_data = taxonomy\_4\_dams,  
input\_metadata = metadata\_mom\_2,  
min\_prevalence = 0.1,  
min\_abundance = 0.0001,  
max\_significance = 0.05,  
normalization = “TSS”,  
output = “v4dams\_output\_10”,  
fixed\_effects = c(“Txt\_Dose”),  
reference = c(“Txt\_Dose,VEH\_10”)  
)

---

<div class="post-metadata">

**Author:** ![Kelsey\_Thompson](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/kelsey_thompson/32/65_2.png) [@Kelsey\_Thompson](https://forum.biobakery.org/u/Kelsey_Thompson)\
**Post date:** [January 24, 2023, 2:21pm UTC](https://forum.biobakery.org/t/incorrect-name-value-in-output/4697/2 "2023-01-24T14:21:39Z")

</div>

Hi @hharder,

I have never seen this type of issue before out of MaAsLin. Do you mind sending some additional information to help us troubleshoot this behavior?

1. R version
2. MaAsLin 2 version
3. Minimally reproducible data (either your data attached here or emailed to me or dummy data that reproduces this behavior)

Best,  
Kelsey

---

<div class="post-metadata">

**Author:** ![hharder](https://avatars.discourse-cdn.com/v4/letter/h/e5b9ba/32.png) [@hharder](https://forum.biobakery.org/u/hharder)\
**Post date:** [January 24, 2023, 2:41pm UTC](https://forum.biobakery.org/t/incorrect-name-value-in-output/4697/3 "2023-01-24T14:41:02Z")

</div>

I’m running R 4.2.1 and Maaslin2 1.10.0.  
[taxonomy\_4\_dams.csv](https://forum.biobakery.org/uploads/short-url/kjenQQJ9kD2FgCY3US0S9J2FEwP.csv) (198.5 KB)  
[metadata\_4\_dam.csv](https://forum.biobakery.org/uploads/short-url/aiqsTCs1i7XTrxYmVSL6uOebO7k.csv) (3.0 KB)

I’ve attached my data, and below is the full code.

```auto
fit_dam4_10 = Maaslin2(
  input_data = taxonomy_4_dams,
  input_metadata = metadata_mom_2,
  min_prevalence = 0.1,
  min_abundance = 0.0001,
  max_significance = 0.05,
  normalization = "TSS", 
  output = "v4dams_output_10",
  fixed_effects = c("Txt_Dose"),
  reference = c("Txt_Dose,VEH_10")
)

```

```auto
fit_dam4_12 = Maaslin2(
  input_data = taxonomy_4_dams,
  input_metadata = metadata_4_dam,
  min_prevalence = 0.1,
  min_abundance = 0.0001,
  max_significance = 0.05,
  normalization = "TSS", 
  output = "v4dams_output_12",
  fixed_effects = c("Txt_Dose"),
  reference = c("Txt_Dose,VEH_12")
)

```

```auto
fit_dam4_14 = Maaslin2(
  input_data = taxonomy_4_dams,
  input_metadata = metadata_4_dam,
  min_prevalence = 0.1,
  min_abundance = 0.0001,
  max_significance = 0.05,
  normalization = "TSS", 
  output = "v4dams_output_14",
  fixed_effects = c("Txt_Dose"),
  reference = c("Txt_Dose,VEH_14")
)

```

```auto
fit_dam4_16 = Maaslin2(
  input_data = taxonomy_4_dams,
  input_metadata = metadata_4_dam,
  min_prevalence = 0.1,
  min_abundance = 0.0001,
  max_significance = 0.05,
  normalization = "TSS", 
  output = "v4dams_output_16",
  fixed_effects = c("Txt_Dose"),
  reference = c("Txt_Dose,VEH_16")
)

```

```auto
dam4_10_results <- fit_dam4_10$results
dam4_12_results <- fit_dam4_12$results
dam4_14_results <- fit_dam4_14$results
dam4_16_results <- fit_dam4_16$results

```

```auto
dam4_10_results$ref <- c(rep("VEH_10", times = 2051))
dam4_12_results$ref <- c(rep("VEH_12", times = 2051))
dam4_14_results$ref <- c(rep("VEH_14", times = 2051))
dam4_16_results$ref <- c(rep("VEH_16", times = 2051))
dam4_results_combined <- rbind(dam4_10_results, dam4_12_results, dam4_14_results, dam4_16_results)

```

```auto
dam4_results_combined <- dam4_results_combined %>%
  dplyr::select(feature, ref, value, coef, stderr, pval)

```

```auto
dam4_results_combined$qval <- p.adjust(dam4_results_combined$pval, method = "BH")

```

```auto
write.table(dam4_results_combined, file = "C:\\Users\\hharder1\\Documents\\dam4_results_combined.csv", sep=",", row.names = FALSE)

```

Here is a screenshot of the problem:

 ![Screenshot 2023-01-24 093902](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/1/1f4438744bc5d4720deb4fcd16330ff5dedf7818.png)

The value column should list the levels of Txt\_Dose from the metadata file, but instead just returns 2-7. If I was 100% which level was represented by each value, that would work, but I’m not sure.

---

<div class="post-metadata">

**Author:** ![hharder](https://avatars.discourse-cdn.com/v4/letter/h/e5b9ba/32.png) [@hharder](https://forum.biobakery.org/u/hharder)\
**Post date:** [January 25, 2023, 5:14pm UTC](https://forum.biobakery.org/t/incorrect-name-value-in-output/4697/4 "2023-01-25T17:14:10Z")

</div>

I have done some more testing on this problem, and still have been unable to solve it. It seems to be something about the data itself, as when I rerun the analysis using only “Txt” as a fixed effect rather than “Txt\_Dose”, I get the same problem - output returns values of 1 instead of “MOR”. I’m not getting any errors or any strange responses in the log file.

---

<div class="post-metadata">

**Author:** ![hharder](https://avatars.discourse-cdn.com/v4/letter/h/e5b9ba/32.png) [@hharder](https://forum.biobakery.org/u/hharder)\
**Post date:** [January 25, 2023, 5:26pm UTC](https://forum.biobakery.org/t/incorrect-name-value-in-output/4697/5 "2023-01-25T17:26:23Z")

</div>

I’ve just managed to fix it - apparently it was the hyphen in the column name “Txt\_Dose” that was messing it up. By converting it to “TxtDose”, it started working. Maaslin doesn’t seem to mind that the levels have hyphens in them though.

---

<div class="post-metadata">

**Author:** ![Kelsey\_Thompson](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/kelsey_thompson/32/65_2.png) [@Kelsey\_Thompson](https://forum.biobakery.org/u/Kelsey_Thompson)\
**Post date:** [January 25, 2023, 5:49pm UTC](https://forum.biobakery.org/t/incorrect-name-value-in-output/4697/6 "2023-01-25T17:49:09Z")

</div>

Hi @hharder,

@andrewGhazi from our group did a test on the data you uploaded and did not replicate this issue. I misread your original post, this is something we have seen before. It has to do with an R bug in the way that we were handling the reference in older code versions (which is unfortunately still the bioconductor version - we are working on pushing the newer code now). He ran MaAsLin with the github version instead of the older Bioconductor release.

If you re-install MaAsLin from github\* it should solve this bug. Apologies for the confusion!  
Code:

```plaintext
install.packages("devtools")
library("devtools")
install_github("biobakery/Maaslin2")

```

\*We do not normally recommend installing MaAsLin in this fashion.

Best,  
Kelsey
