----p-exclude-ids doesn't work

I want to filter several samples out from my demux qza file.

I run this: “qiime demux filter-samples --i-demux 1st.bacteria.demux.qza --m-metadata-file 1st-samples-to-filter.tsv --p-exclude-ids --o-filtered-demux 1st.bacteria.demux.filtered.qza”

This is the head of my metafile

sampleid
23
83
87
111
117

I don’t know it is wrong with this script. There is no errors of this script.

I visualize the 1st.bacteria.demux.filtered.qza file, but it still gives same number of samples before and after filtering?

PS, what is exactly the metadata-file format should be like?

Thanks,

1 Like

Hello John,

I think you are very close! Take a look at the docs for filter-samples. Notice how the --p-exclude-ids only works when you also pass the --p-where flag.

See this example from the Moving Pictures Tutorial:

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

Now try using these flags together and see if you can get this filter working.

Colin

2 Likes

Hey @colinbrislawn, the --p-where parameter is not a requirement for --p-exclude-ids, it is optional. What isn't optional is the --m-metadata-file --- that parameter is required. As the help text states:

If True, the samples selected by the metadata and optional where parameter will be excluded from the filtered data.


@moonlight - if those Sample IDs aren't in 1st.bacteria.demux.qza in the first place then the filtering would be a no-op, like you have described. Can you confirm the Sample IDs in 1st.bacteria.demux.qza by running demux summarize on this file and reviewing the Sample IDs there? Please send a screenshot or the QZV so that we can get a closer look.

Thanks!

:qiime2:

2 Likes

I guess I figured out. I figure by sample ID. I need to filter out the sample that I don’t want too. I have to create another tsv (metafile) for this filter process. However, there is no details description about the metafile format.

I do this before
sampleid
1
2
3
However, the header is not correct and it must be “SampleID” and it is case sensitive.

Thanks!

1 Like

Hi @moonlight!

Sound's good - I assumed that is what we were discussing above.

Not necessarily - you can include a --p-where clause if you want that describes which IDs (directly or indirectly) to remove. If you don't want to use --p-where, then yes, a new Metadata file is necessary.

I direct your attention to this document:

https://docs.qiime2.org/2019.10/tutorials/metadata/

The format and specification are discussed in detail there.

What error did you see? As you can see here, we support sampleid as an "Identifier Column" label. In fact, you can view an example of this in action here:

https://docs.qiime2.org/2019.10/tutorials/longitudinal/

Hope that helps! :qiime2:

1 Like

I know you support this -- sampleid. There is no error and the program runs smoothly. I don't remember any error (if I am correctly). Your feature table doesn't change anything, still the old one untill I use "SampleID".

My version is 2019.10 and I am not sure if this is a bug. You could give it a try. I am new to QIIME2, I might have made mistake.

Hi @moonlight - it is unclear to me what you are concerned about - please provide the following:

  1. The version of QIIME 2 used
  2. The exact command or commands run (copy and paste)
  3. The detailed error (run with --verbose), or, if no error, the offending data you are concerned about.

Please provide sample data, if possible. Thanks! :qiime2:

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