Filter table by Sequences

Hi friends,

There is 100% a chance that I'm missing something I should have found. I want keep sequences that were clustered in my original ASV table. So, I'm clustering my data closed reference, and then using the discard sequences as a negative filter for my data

# Clusters the sequences closed reference at a low percent identity
qiime vsearch cluster-features-closed-reference \
 --i-sequences $seqs_in_fp \
 --i-table $table_in_fp \
 --i-reference-sequences $ref_seq_fp \
 --p-perc-identity 0.85 \
 --output-dir $cluster_out_dir

# Filters the table against the discarded sequences
qiime feature-table filter-features \
 --i-table $table_in_fp \
 --m-metadata-file $seq_discard_fp \
 --p-exclude-ids \
 --o-filtered-table $table_dir_fp

I get an error message:

Saved FeatureData[Sequence] to: data/output/mock/3.split_orientation/closed-ref-clustering-fwd/unmatched_sequences.qza
There was an issue with loading the file data/output/mock/3.split_orientation/closed-ref-clustering-fwd/unmatched-sequences.qza as metadata:

  Metadata file path doesn't exist, or the path points to something other than a file. Please check that the path exists, has read permissions, and points to a regular file (not a directory): data/output/mock/3.split_orientation/closed-ref-clustering-fwd/unmatched-sequences.qza

  There may be more errors present in the metadata file. To get a full report, sample/feature metadata files can be validated with Keemei: https://keemei.qiime2.org

  Find details on QIIME 2 metadata requirements here: https://docs.qiime2.org/2021.8/tutorials/metadata/

So, clearly, I can't transform my sequences into a metadata semantic type.

So, I guess, am I missing something that's hiding in plain sight, or is this one of things that I should open an issue to fix?

Best,
Justine

Hi, I think, here it is :wink:

unmatched_sequences.qza
unmatched-sequences.qza

It works now:

seqs_in_fp  = 'Data/Bacteria_rep-seqs.qza'
table_in_fp = 'Data/Tables/Bacteria_table.qza'
ref_seq_fp  = '../Classifiers/silva138_1-99-seqs-V1V2.qza'
cluster_out_dir = 'Test/'
seq_discard_fp = 'Test/unmatched_sequences.qza'
table_dir_fp = 'Test/filtered_table.qza'

# Clusters the sequences closed reference at a low percent identity
!qiime vsearch cluster-features-closed-reference \
 --i-sequences $seqs_in_fp \
 --i-table $table_in_fp \
 --i-reference-sequences $ref_seq_fp \
 --p-perc-identity 0.85 \
 --output-dir $cluster_out_dir

# Filters the table against the discarded sequences
!qiime feature-table filter-features \
 --i-table $table_in_fp \
 --m-metadata-file $seq_discard_fp \
 --p-exclude-ids \
 --o-filtered-table $table_dir_fp

Saved FeatureTable[Frequency] to: Test/filtered_table.qza

4 Likes

Thanks @timanix. As usual, error between :chair: and :keyboard:. Thank you for finding my mistake :blush:

4 Likes

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