Sampling depth error in core-metrics-phylogenetic function

Hi, all!

I tried ‘qiime diversity core-metrics-phylogenetic’ function and this error was come up.

Traceback (most recent call last):
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2cli/commands.py”, line 274, in call
results = action(**arguments)
File “”, line 2, in core_metrics_phylogenetic
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 232, in bound_callable
output_types, provenance)
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 460, in callable_executor
outputs = self._callable(scope.ctx, **view_args)
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2_diversity/_core_metrics.py”, line 51, in core_metrics_phylogenetic
metadata=metadata, n_jobs=n_jobs)
File “”, line 2, in core_metrics
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 232, in bound_callable
output_types, provenance)
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 460, in callable_executor
outputs = self._callable(scope.ctx, **view_args)
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2_diversity/_core_metrics.py”, line 18, in core_metrics
rarefied_table, = rarefy(table=table, sampling_depth=sampling_depth)
File “”, line 2, in rarefy
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 232, in bound_callable
output_types, provenance)
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 367, in callable_executor
output_views = self._callable(**view_args)
File “/home/microbiome/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2_feature_table/_normalize.py”, line 16, in rarefy
raise ValueError('The rarefied table contains no samples or features. ’
ValueError: The rarefied table contains no samples or features. Verify your table is valid and that you provided a shallow enough sampling depth.

And this is my code:
qiime diversity core-metrics-phylogenetic --i-phylogeny …/phylogeny/rooted-tree.qza --i-table table-dada2.qza --p-sampling-depth 6000 --m-metadata-file …/metadata.tsv --output-dir core-metrics-results

These are my Per-sample sequence counts.

sample-1 : 20237 sample-2 : 11372 sample-3 : 10039 sample-4 : 9269 sample-5 : 8563 sample-6 : 6431 sample-7 : 4939 sample-8 : 4095 sample-9 : 3105

I tried 3100 for sampling depth at first but the error was come up so I raised it to 6000, 9000, and 18000 at last but same error was come up every time! Is this a matter with the metadata? And which value I choose for this function? As I understand, the sampling depth means the amount of subsample in each sample, so if I input 4000 for sampling depth, qiime picks 5000 subsample for doing diversity analysis, so qiime picks all samples in sample 7, 8, and 9 while it picks only 5000 out of each total samples. Which means in case of sample 1, they are subsampled only a quarter of them, which could be slightly precise for it.

Is how I understand the sampling depth and subsampling right??

Thank you!

Hello @1115,

Subsampling is basically selecting the same amount of sequences for all samples and any sample that is below that number will be removed.

Thus, for your example:
sample-1 : 20237 sample-2 : 11372 sample-3 : 10039 sample-4 : 9269 sample-5 : 8563 sample-6 : 6431 sample-7 : 4939 sample-8 : 4095 sample-9 : 3105
if you select 10000, you’ll discard any sample below that number and keep everything above:
sample-1 : 10000 sample-2 : 10000 sample-3 : 10000

Now, this means that the command should have worked for your selections (obviously, the higher your even sampling, the less samples you will retain) but to check what’s going on, we will need access to your files, at least to the table-dada2.qza file.

Best,

1 Like

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