Hi! I have been trying to use the qiime feature-table group command to group my data but cannot seem to get it to work how I need to. I am trying to group the data by the separate sample types within the sample_type column of my metadata. The goal is to end up with only one featureID per sample_type. I originally have 812 sampleIDs but want to end up with five or six that represent the culmination of all of the samples of each type. Here is the code I have been trying to use,
When I do this though I end up with a table to shows all 812 of the sampleIDs with a single culumn next to them that shows what the sample type is. How can i get this code to group the samlpe together into one representation of each sample-type?
The following is what I would have expected to have happened given you command, correct me where I'm wrong.
This is what your metadata file looks like:
sample-id
sample-type
1
A
2
A
3
A
4
B
5
B
...
...
812
C
This is what your pre-grouping feature table looks like:
sample-id-1
sample-id-2
sample-id-3
sample-id-4
...
feature-1
5
4
0
8
...
feature-2
7
19
82
40
...
feature-3
0
4
3
17
...
...
...
...
...
...
...
This is what your post-grouping feature table looks like:
sample-type-A
sample-type-B
sample-type-C
feature-1
8
12
0
feature-2
0
1
31
feature-3
4
44
6
...
...
...
...
You grouped along the sample (top) axis, getting the median-ceiling of each set of samples that belongs to a sample-type group.
When I do this though I end up with a table to shows all 812 of the sampleIDs with a single culumn next to them that shows what the sample type is.
Are you sure you're not confusing features and samples? Features are listed along the vertical axis in a feature table. Do you really have 812 samples? It seems more likely that you have 812 features.
The goal is to end up with only one featureID per sample_type.
This doesn't make sense to me. What is this feature supposed to represent for each sample?
Thanks for replying! I might not have been as clear as I thought when asking this question. I most definitely have 812 features in the vertical axis as you pointed out, not samples. I guess a more accurate way to describe my goal is that we want to combine together all the features that have the same sample_type which would leave us with five features, one for each sample_type.
Okay, it sounds like you want to average feature abundances together according to what sample_type they belong to. To do this you need the necessary information in your metadata and you need to group along the feature axis, not the sample axis: --p-axis feature.
when I use --p-axis feature instead of --p-axis sample I get a very long string of red text that looks to me like a list of the feature IDs and an error message that says "Debug info has been saved to /tmp/qiime2-q2cli-err-bhehoafj.log". Is there maybe something wrong with my metadata file? or maybe something wrong with my --table artifact?
Debug info has been saved to /tmp/qiime2-q2cli-err-osq58za9.log
and when i call head on the tmp/qiime2.log message I get
Traceback (most recent call last):
File "/home/miniconda3/envs/qiime2/lib/python3.6/site-packages/q2cli/commands.py", line 329, in call
results = action(**arguments)
File "", line 2, in group
File "/home/miniconda3/envs/qiime2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
output_types, provenance)
File "/home/miniconda3/envs/qiime2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 390, in callable_executor
output_views = self._callable(**view_args)
File "/home/miniconda3/envs/qiime2/lib/python3.6/site-packages/q2_feature_table/_group.py", line 51, in group
axis)