# Host genes removal from a SampleData artifact

**URL:** <https://forum.qiime2.org/t/host-genes-removal-from-a-sampledata-artifact/30094>\
**Category:** User Support\
**Tags:** taxonomy, quality-control\
**Created:** [May 2, 2024, 2:00pm UTC](https://forum.qiime2.org/t/host-genes-removal-from-a-sampledata-artifact/30094 "2024-05-02T14:00:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KpatelBio](https://forum.qiime2.org/user_avatar/forum.qiime2.org/kpatelbio/32/18513_2.png) [@KpatelBio](https://forum.qiime2.org/u/KpatelBio)\
**Post date:** [May 2, 2024, 2:00pm UTC](https://forum.qiime2.org/t/host-genes-removal-from-a-sampledata-artifact/30094/1 "2024-05-02T14:00:03Z")

</div>

Dear Qiimers,

I am new to using this amazing tool. My current goal with this tool is to remove host genes (as shown here [Evaluating and controlling data quality with q2-quality-control — QIIME 2 2024.2.0 documentation](https://docs.qiime2.org/2024.2/tutorials/quality-control/)) from my data. My main issue (..or rather my misconception) is that the `quality-control exclude-seqs` function requires the `--i-query-sequences` parameter to be a `FeatureData[Sequence]`. I am confused as to how I created this specific type of artifact based on my workflow. I understand from this post [https://forum.qiime2.org/t/create-featuredata-sequence/4913](https://forum.qiime2.org/t/create-featuredata-sequence/4913), the dionise step can achieve this, but I feel it makes more sense to remove host genes, prior to this.... let me know if this is an incorrect assessment please.

Here is my current working code and I would appreciate if any expert qiimers could identify where I am going wrong.

```auto
#set dir 
script_directory = "/Home/"
os.chdir(script_directory)

#import (my import data is paired so my columns are sample-id, forward-full-filepath, reverse-full-filepath)
!qiime tools import \
  --type 'SampleData[PairedEndSequencesWithQuality]' \
  --input-path qiime_input/manifest2.txt \
  --output-path qiime_input/paired_end_demux.qza \
  --input-format PairedEndFastqManifestPhred33V2

#perform initial QC
!qiime demux summarize \
  --i-data qiime_input/paired_end_demux.qza \
  --o-visualization qiime_input/paired_end_demux.qzv

#use join-pairs to merge paired ends
!qiime vsearch merge-pairs \
    --i-demultiplexed-seqs qiime_input/pe_demux.qza \
    --o-merged-sequences qiime_input/merged_pe_demux.qza \
    --o-unmerged-sequences qiime_input/unmerged_pe_demux.qza 

#create host gene sequence file
!qiime tools import \
    --input-path qiime_input/Gallus_gallus.bGalGal1.mat.broiler.GRCg7b.dna.toplevel.fa \
    --output-path qiime_input/ref_sequences.qza \
    --type 'FeatureData[Sequence]'

#remove host genes from qiime seqs
!qiime quality-control exclude-seqs \
    --i-query-sequences qiime_input/merged_pe_demux.qza \
    --i-reference-sequences qiime_input/ref_sequences.qza \
    --p-method blast \
    --p-perc-identity 0.97 \
    --p-perc-query-aligned 0.97 \
    --o-sequence-hits qiime_input/hits97.qza \
    --o-sequence-misses qiime_input/misses97.qza

```

I am consistently getting this error - which makes me think I am getting something very wrong in this pre-processing pipeline. How can I get to the FeatureData[Sequence] which is required for host removal using qiime2.

```
                There was a problem with the command:                     

```

(1/1) Invalid value for '--i-query-sequences': Expected an artifact of at  
least type FeatureData[Sequence]. An artifact of type  
SampleData[PairedEndSequencesWithQuality] was provided.

Many Thanks for any help,  
Krutik

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [May 2, 2024, 6:59pm UTC](https://forum.qiime2.org/t/host-genes-removal-from-a-sampledata-artifact/30094/2 "2024-05-02T18:59:17Z")

</div>

Hi @KpatelBio ,

You are importing your data as `SampleData[PairedEndSequencesWithQuality]`, so you are using the wrong action for filtering, as the error message is indicating.

To filter a `SampleData[PairedEndSequencesWithQuality]` use this action:  
[https://docs.qiime2.org/2024.2/plugins/available/quality-control/filter-reads/](https://docs.qiime2.org/2024.2/plugins/available/quality-control/filter-reads/)

Note that you will first need to make a bowtie2 index of your host reference sequences using this action:  
[https://docs.qiime2.org/2024.2/plugins/available/quality-control/bowtie2-build/](https://docs.qiime2.org/2024.2/plugins/available/quality-control/bowtie2-build/)

Unfortunately we do not have a tutorial yet describing these steps, but you can read the documentation to see the expected inputs and outputs.

I have edited the title of this topic to better reflect what you are trying to accomplish.

Good luck!

---

<div class="post-metadata">

**Author:** ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)\
**Post date:** [June 3, 2024, 1:00am UTC](https://forum.qiime2.org/t/host-genes-removal-from-a-sampledata-artifact/30094/3 "2024-06-03T01:00:10Z")

</div>

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