Beta group significance analysis

Hello all,
I'm trying to run the beta group significance analysis but I have the following error:
[Errno 2] No such file or directory: '/tmp/qiime2-temp-4ukh4694/50/100-boxplots.png'

First I filtered the samples in the feature-table:
qiime feature-table filter-samples
--i-table table_NoMitClo_Melipona11-2.qza
--m-metadata-file sample-metadata_Melipona11_control.tsv
--p-where "[SAMPLES] IN ('50/100', '50/1000') AND [TIME] IN ('24h') AND [CONTROL] IN ('CONTROL SAMPLE', 'TRUE SAMPLE')"
--o-filtered-table table_Melipona11-2_Dif100-1000_rep.qza

Then, I ran the core metrics phylogenetic analysis:
iime diversity core-metrics-phylogenetic
--i-table table_Melipona11-2_Dif100-1000_rep.qza
--i-phylogeny sepptree_Melipona11-2.qza
--p-sampling-depth 1000
--m-metadata-file sample-metadata_Melipona11_control.tsv
--o-rarefied-table rarefied_table.qza
--o-faith-pd-vector faith_pd_vector.qza
--output-dir CMP_Dif100_100024h_rep

And now I'm trying to do the beta diversity analysis:
qiime diversity beta-group-significance
--i-distance-matrix CMP_Dif100_100024h_rep/unweighted_unifrac_distance_matrix.qza
--m-metadata-file sample-metadata_Melipona11_control.tsv
--m-metadata-column SAMPLES
--o-visualization CMP_Dif100_100024h_rep/unweighted-unifrac-BGS.qzv

Can anyone help me?
Thank you!

Hello @Patricia_Azevedo
This happens when there are metadata values that have "/". It seems like you have a couple of values that have the "/" in them.

Basically the boxplot image is named '50/100-boxplots.png' but when its being read that looks like a png called 100-boxplots.png in the directory 50.

Easiest solution is to replace the "/" with another symbol and then you will be golden :sun_with_face:

Hope that helps!

Hi Cherman, thank you so much.
My metadata doesn't have this symbol. I just used that to filter the samples in the table. Do you think that it happen just because I filtered the table with these commands?

Hi @Patricia_Azevedo,

In this command you are filtering your data based on metadata categories and values.

Here you are filtering based on a metadata column named "SAMPLES" and asking for only the values of '50/100', '50/1000'.

This implies that these values in your metadata.

Also like I pointed out in the error, it is implying that the value that is causing this issue is 50/100

If you intended to filter those values out of your data you need to --p-exclude-ids flag because currently its filtering down to those values.

Hope that helps!

1 Like

Thank you for your help again!
I have never used the command --p-exclude-ids. I search for it but I didn't understand very well what the flag will do. Can you say me what this flag will do? Will it just remove the ids from my feature table?

Hello @Patricia_Azevedo,

I think the q2-filtering tutorial will be helpful for you to understand how filtering works in QIIME 2. Also here is doc for all the filter-samples command and it contains all the possible flags that could be used with this command. filter-samples: Filter samples from table — QIIME 2 2023.2.0 documentation

In short, --p-exclude-ids is a parameter that you pass to qiime feature-table filter-samples. If you include it in your command, it will remove any samples that fits your --p-where statement .

For example:

qiime feature-table filter-samples \
  --i-table table.qza \
  --m-metadata-file sample-metadata.tsv \
  --p-where "[subject]='subject-1'" \
  --o-filtered-table subject-1-filtered-table.qza

Filters the feature table so that it only contains samples that are from subject 1. So there will be no other subjects will be included.

qiime feature-table filter-samples \
  --i-table table.qza \
  --m-metadata-file sample-metadata.tsv \
  --p-where "[subject]='subject-1'" \
  --p-excluded-ids \
  --o-filtered-table subject-1-filtered-table.qza

Filters out any samples that come from subject on out of the feature table. So subject 1 will no longer be in the feature table.

1 Like

Hi Cherman,
I tried everything and what worked was changing the sample's name in the metadata file. I don't know why in some cases it runs and in some not.
Thank you for your help. Your tip about the problem with the name was crucial. :smiling_face:

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