# How to remove certain species in sample through command/ pipeline

**URL:** <https://forum.qiime2.org/t/how-to-remove-certain-species-in-sample-through-command-pipeline/3997>\
**Category:** User Support\
**Tags:** taxonomy\
**Created:** [May 1, 2018, 2:19pm UTC](https://forum.qiime2.org/t/how-to-remove-certain-species-in-sample-through-command-pipeline/3997 "2018-05-01T14:19:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jms](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@jms](https://forum.qiime2.org/u/jms)\
**Post date:** [May 1, 2018, 2:19pm UTC](https://forum.qiime2.org/t/how-to-remove-certain-species-in-sample-through-command-pipeline/3997/1 "2018-05-01T14:19:19Z")

</div>

Hi guys. I have just recently learned how to use a QIIME2’s pipeline to do a part of my research study. The pipeline I used was found in the “Moving Pictures” tutorial. In my study, I have 14 samples which were analysed using that pipeline. 4 of the sample ID starting with E7, F7, G7, H7 were negative controls, so they were supposed to have no bacteria found in them. But when I got the taxa-bar-plots.qzv from Taxonomic analsysis, 3 of the control samples showed contamination with some bacteria. From the same graph, I found that the type of bacteria that had been contaminated with in each sample was:

E7-S505-N706 | k\_\_Bacteria;p\_\_Actinobacteria;c\_\_Acidimicrobiia;o\_\_Acidimicrobiales;f\_\_SC3-41;g\_\_;s\_\_ | 100.000%

F7-S506-N706 | k\_\_Bacteria;p\_\_Cyanobacteria;c\_\_Chloroplast;o\_\_Stramenopiles;f\_\_;g\_\_;s\_\_ | 100.000%

G7-S507-N706 | k\_\_Bacteria;p\_\_Proteobacteria;c\_\_Alphaproteobacteria;o\_\_Sphingomonadales;f\_\_Sphingomonadaceae;g\_\_Novosphingobium;\_\_ | 100.000%

 ![47%20PM](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/6/61b2d538be7c0719ff5fe13c757805e73182ae62.png)

**My question is that, if there is a command or a pipeline where I can remove those three bacteria in all of the 14 samples, or if such a process is possible.** I have tried to look around on the site but I couldn’t really find any. My reason is that the 3 contaminating species would likely also be found in the other samples where they shouldn’t be found if the samples were not contaminated. So I need to remove the 3 species in all my samples, then run through the pipeline again now with samples in the de-contaminated state. The end result I would like is in the new taxa-bar-plots.qzv graph, I should have an empty value in all the 4 controls.

Thank you for your contribution!  
James

* * *

I have also included FeatureID (that I found in the "Moving Pictures" tutorial of the 3 contaminating bacteria, though am not sure about its relevance for this process.

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/b/b81334c657aff100f8a1b5fe9028b3f0d7e7fc6d.jpg)

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/4/4004e3e88a90322ba25931c7d7cdd71c63044b31.jpg)

![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/4/4749a3903820078749a6894be8a012756359d887.jpg)

---

<div class="post-metadata">

**Author:** ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)\
**Post date:** [May 1, 2018, 6:58pm UTC](https://forum.qiime2.org/t/how-to-remove-certain-species-in-sample-through-command-pipeline/3997/2 "2018-05-01T18:58:39Z")

</div>

Hi @jms,  
Though technically qiime2 does have the capabilities of removing specific features (see [here](https://docs.qiime2.org/2018.4/tutorials/filtering/#filtering-sequences) for tutorial) the idea of subtracting negative control features from your samples is not advisable.  
This topic has come up on the forum quite a bit and unfortunately there doesn't seem to be a great way to deal with it as of yet. See this [thread](https://forum.qiime2.org/t/filter-controls-or-not-to-filter-controls/1832) for a great discussion on the topic. Hopefully that can help.

---

<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 2, 2018, 12:58am UTC](https://forum.qiime2.org/t/how-to-remove-certain-species-in-sample-through-command-pipeline/3997/3 "2018-06-02T00:58:39Z")

</div>

Closed on June 2, 2018, 12:58am UTC

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