# Error in metadata: taxa barplot with group-table

**URL:** <https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923>\
**Category:** Technical Support\
**Tags:** metadata\
**Created:** [January 19, 2022, 9:15pm UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923 "2022-01-19T21:15:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaomiranda](https://forum.qiime2.org/user_avatar/forum.qiime2.org/joaomiranda/32/14795_2.png) [@joaomiranda](https://forum.qiime2.org/u/joaomiranda)\
**Post date:** [January 19, 2022, 9:15pm UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/1 "2022-01-19T21:15:57Z")

</div>

Hello,

I found an error when I was trying to generate a taxa barplot from a grouped table.

```
There was an issue with loading the file Metadados_grouped_local.txt as metadata:

  There was an issue with loading the metadata file:

  Metadata IDs must be unique. The following IDs are duplicated: 'JDG', 'JDGF1', 'JU', 'JUF1', 'LAB', 'NEG', 'RPC', 'RPCF1'

```

My goal is to generate a taxa barplot from 7 groups of my `"local"` variable ('RPC', 'JDG', 'JU','RPCF1','JDGF1','JUF1','LAB').

I know the way I can run my command involves modifying my metadata. I've looked at several discussions on the forum, but I'm having problems manually modifying my metadata, maybe it's something simple but I can't find where I'm going wrong.

I replaced my entire sample-id column with the group names found in the `"local"` variable.

Here is my original metadata: [Metadados.tsv](https://forum.qiime2.org/uploads/short-url/4Kn6zOhdJV6UP3DEa3eziUSC3c0.tsv) (3.0 KB)  
And here is the modified metadata that I'm trying to make correctly:[Metadados\_grouped\_local.tsv](https://forum.qiime2.org/uploads/short-url/8FKi9id20N6qCyXVZxPuxw5m8al.tsv) (2.7 KB)

---

<div class="post-metadata">

**Author:** ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)\
**Post date:** [January 20, 2022, 5:23am UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/2 "2022-01-20T05:23:07Z")

</div>

Hi!  
Plugin is complaining, that your ids are not unique. Since you already replaced your initial ids by group names, the next step would be to remove all replicates for each new ID (there should be only one row for each group name).

---

<div class="post-metadata">

**Author:** ![joaomiranda](https://forum.qiime2.org/user_avatar/forum.qiime2.org/joaomiranda/32/14795_2.png) [@joaomiranda](https://forum.qiime2.org/u/joaomiranda)\
**Post date:** [January 20, 2022, 12:59pm UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/3 "2022-01-20T12:59:12Z")

</div>

Hi @timanix,

Thank you for the prompt response!

This is a little bit confusing for me, because I have 96 individuals, so removing the replicates in my metadata will leave just 7 rows with the group names, and the others 89 rows will be empty. Is this right?

---

<div class="post-metadata">

**Author:** ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)\
**Post date:** [January 20, 2022, 1:37pm UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/4 "2022-01-20T13:37:12Z")

</div>

That's right but I guess that you need this grouped table and grouped metadata only for taxabarplot to show groups rather individuals. For stat analysis and other plugins you can use original metadata and tables.

---

<div class="post-metadata">

**Author:** ![joaomiranda](https://forum.qiime2.org/user_avatar/forum.qiime2.org/joaomiranda/32/14795_2.png) [@joaomiranda](https://forum.qiime2.org/u/joaomiranda)\
**Post date:** [January 20, 2022, 1:58pm UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/5 "2022-01-20T13:58:17Z")

</div>

I made the corrections in my metadata, but now I have a new error.

Firstly I runned the code to generate a grouped table, with my original metadata

```
 qiime feature-table group \
  --i-table filtered-table-with-phyla-min10.qza \
  --p-axis sample \
  --m-metadata-file Metadados.txt \
  --m-metadata-column "local" \
  --p-mode sum \
  --o-grouped-table grouped_local_table.qza

```

Now I have the error while I was running the second code with the modified metadata, with the 7 rows containing my group names in `sample-id`

```
 qiime taxa barplot \
   --i-table grouped_local_table.qza \
   --i-taxonomy taxonomy-gg.qza \
   --m-metadata-file Metadados_grouped_local.txt \
   --o-visualization taxa-bar-plots-grouped-local.qzv

     There was an issue with loading the file Metadados_grouped_local.txt as metadata:

      [Errno 13] Permission denied: 'Metadados_grouped_local.txt'

```

---

<div class="post-metadata">

**Author:** ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)\
**Post date:** [January 20, 2022, 2:38pm UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/6 "2022-01-20T14:38:18Z")

</div>

Did you modified metadata on other machine?  
Do you have root access? Could you try to cahnge permissions with or without sudo:

```
sudo chmod 777 Metadados_grouped_local.txt
chmod 777 Metadados_grouped_local.txt

```

---

<div class="post-metadata">

**Author:** ![joaomiranda](https://forum.qiime2.org/user_avatar/forum.qiime2.org/joaomiranda/32/14795_2.png) [@joaomiranda](https://forum.qiime2.org/u/joaomiranda)\
**Post date:** [January 20, 2022, 2:58pm UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/7 "2022-01-20T14:58:31Z")

</div>

Thanks, It worked!

But my empty rows in the modified metadata give me the error that I was suspecting, please if you can check my modified metadata: [Metadados\_grouped\_local.tsv](https://forum.qiime2.org/uploads/short-url/nZoPBJ3mQIJLacDsZM8eTEksMJ3.tsv) (2.4 KB)

The new error:

```
There was an issue with loading the file Metadados_grouped_local.txt as metadata:

  There was an issue with loading the metadata file:

  Detected empty metadata ID. IDs must consist of at least one character.

```

---

<div class="post-metadata">

**Author:** ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)\
**Post date:** [January 20, 2022, 3:19pm UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/8 "2022-01-20T15:19:30Z")

</div>

You need to delete completely rows without IDs in modified metadata - you don't need them to create grouped taxabarplot.

---

<div class="post-metadata">

**Author:** ![joaomiranda](https://forum.qiime2.org/user_avatar/forum.qiime2.org/joaomiranda/32/14795_2.png) [@joaomiranda](https://forum.qiime2.org/u/joaomiranda)\
**Post date:** [January 20, 2022, 9:15pm UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/9 "2022-01-20T21:15:49Z")

</div>

Thanks, now it worked well!

I'm uploading my modified metadata, for other users that have the same doubts could visualize.

[Metadados\_grouped\_local.tsv](https://forum.qiime2.org/uploads/short-url/wc2PFdCjnZQxrWzY62rflNjylKl.tsv) (291 Bytes)

---

<div class="post-metadata">

**Author:** ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)\
**Post date:** [February 21, 2022, 3:15am UTC](https://forum.qiime2.org/t/error-in-metadata-taxa-barplot-with-group-table/21923/10 "2022-02-21T03:15:56Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
