# how to remove specific feature from specific sample ?

**URL:** https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912
**Category:** User Support
**Created:** [May 12, 2020, 10:40pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912 "2020-05-12T22:40:20Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![ilhem](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ilhem/32/8039_2.png) [@ilhem](https://forum.qiime2.org/u/ilhem)
#### Post date: [May 12, 2020, 10:40pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/1 "2020-05-12T22:40:20Z")

</div>

Hi

I got some contamination in my control sample so I want to remove them without removing them from all the samples. I have tried with this command ‘ qiime feature-table filter-features’ which eliminate the feature from all of the sample not from a specific sample.

---

<div class="post-metadata">

### Author: ![ChrisKeefe](https://forum.qiime2.org/user_avatar/forum.qiime2.org/chriskeefe/32/1907_2.png) [@ChrisKeefe](https://forum.qiime2.org/u/ChrisKeefe)
#### Post date: [May 13, 2020, 5:42pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/2 "2020-05-13T17:42:50Z")

</div>

Hi @ilhem!  
This isn't something I've done before, so take my advice with a large grain of salt - there may be a cleaner way to go about it, but I haven't found it yet! 😂

You could use [filter-samples](https://docs.qiime2.org/2020.2/plugins/available/feature-table/filter-samples/) to separate your table into two new tables: a) the sample you want to modify and b) all the other samples. You could then use [filter-features](https://docs.qiime2.org/2020.2/plugins/available/feature-table/filter-features/) to remove the feature from the one sample, and [merge](https://docs.qiime2.org/2020.2/plugins/available/feature-table/merge/) to bring the two tables back together.

This is an interesting situation, and I don't spend any time doing wet lab work, so I'm curious to know more. If you're interested in sharing, how did the contamination happen? And how did you figure out the contamination event only impacted your control?

Best,  
Chris 🐈

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [May 13, 2020, 5:59pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/3 "2020-05-13T17:59:17Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [May 13, 2020, 6:01pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/4 "2020-05-13T18:01:21Z")

</div>

That is an interesting workflow, @ChrisKeefe, thanks for sharing!

@ilhem (and anyone else following along) - I just want to let you know that contaminant filtering has been discussed at length on the forum: [Search results for 'control filter' - QIIME 2 Forum](https://forum.qiime2.org/search?q=control%20filter), and there is a lot to review on the subject.

I would recommend reviewing the first page or so of those posts - there are many opinions on this matter, but I think that there is sufficient reason to at least _proceed with caution_ when attempting to filter based on control samples. I think @Nicholas_Bokulich summarized it best here ([link](https://forum.qiime2.org/t/3-negative-controls-what-is-the-best-way-to-filter-my-samples-and-not-delete-important-data-from-them/7324/2)):

> [@3 Negative Controls - What is the best way to filter my samples and not delete important data from them](https://forum.qiime2.org/t/3-negative-controls-what-is-the-best-way-to-filter-my-samples-and-not-delete-important-data-from-them/7324/2):
>
> If there is any consensus, though, it is that filtering out anything found in negative controls by default is a bad idea. See this discussion for more details:

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [May 13, 2020, 6:01pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/5 "2020-05-13T18:01:42Z")

</div>



---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [May 13, 2020, 6:21pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/6 "2020-05-13T18:21:08Z")

</div>

Hi @ilhem,

I will be honest and say if I was reviewing a paper that didn't apply consistent filtering based on some reasonable criteria, I would be really concerned. (For example, if you told me you were doing a systematic filtering by plate, Id want to know what about the plate made it appropriate, among other details, but I would be okay with it. If you told me you were filtering by kit lot, I could understand. If you tell me you're filtering _specific_ samples or metadata parameters not related to processing, I get concerned) However, filtering a specific sample will likely require careful justification and consideration. You may be better off filtering everything or excluding the sample.

Best,  
Justine

---

<div class="post-metadata">

### Author: ![ilhem](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ilhem/32/8039_2.png) [@ilhem](https://forum.qiime2.org/u/ilhem)
#### Post date: [May 14, 2020, 9:45pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/7 "2020-05-14T21:45:48Z")

</div>

thank you for sharing your opinion , in fact I want to check the influence of inoculation of soil with specific bacteria on the other community of the soil ( with other parametres…). so I have 3 sample control and 3 inoculated with bacteria. When I did the taxa bar plot as shown in the figure attached here

 ![taxa-bar-plot1](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/9/9d9313d6bf3494d070d2eb706f15a13274ab6462.png) I find one out of three of controle samples has 0.147% of this bacteria that I have used in inoculation of the other sample and the two other control don t have so I conclude it was a contamination and it will be good to eliminate this contamination and don’t throw this sample

---

<div class="post-metadata">

### Author: ![ilhem](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ilhem/32/8039_2.png) [@ilhem](https://forum.qiime2.org/u/ilhem)
#### Post date: [May 14, 2020, 10:54pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/8 "2020-05-14T22:54:14Z")

</div>

> [@ChrisKeefe](#):
>
> Hi @ilhem!  
> This isn't something I've done before, so take my advice with a large grain of salt - there may be a cleaner way to go about it, but I haven't found it yet! 😂
> 
> You could use [filter-samples](https://docs.qiime2.org/2020.2/plugins/available/feature-table/filter-samples/) to separate your table into two new tables: a) the sample you want to modify and b) all the other samples. You could then use [filter-features](https://docs.qiime2.org/2020.2/plugins/available/feature-table/filter-features/) to remove the feature from the one sample, and [merge](https://docs.qiime2.org/2020.2/plugins/available/feature-table/merge/) to bring the two tables back together.  
> Thanks for your suggestion 😄 I will try with this method .
> 
> This is an interesting situation, and I don't spend any time doing wet lab work, so I'm curious to know more. If you're interested in sharing, how did the contamination happen? And how did you figure out the contamination event only impacted your control?
> 
> Best,  
> Chris 🐈

In reality, I don’t have a specific method 😇 it all depend to my experiment in fact I want to check the influence of inoculation of soil with specific bacteria on the other community of the soil ( with other parameters…). so I have 3 sample control and 3 inoculated with bacteria. When I did the taxa bar plot as shown in the figure attached here

 ![taxa-bar-plot1](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/9/9d9313d6bf3494d070d2eb706f15a13274ab6462.png) I find one out of three of control samples has 0.147% of this bacteria that I have used in inoculation of the other sample and the two other control don t have so I conclude it was a contamination and it will be good to eliminate this contamination and don’t throw this sample.

---

<div class="post-metadata">

### Author: ![ilhem](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ilhem/32/8039_2.png) [@ilhem](https://forum.qiime2.org/u/ilhem)
#### Post date: [May 14, 2020, 10:56pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/9 "2020-05-14T22:56:19Z")

</div>

Thank you for providing those links I will check them. 🙂

---

<div class="post-metadata">

### Author: ![ChrisKeefe](https://forum.qiime2.org/user_avatar/forum.qiime2.org/chriskeefe/32/1907_2.png) [@ChrisKeefe](https://forum.qiime2.org/u/ChrisKeefe)
#### Post date: [May 15, 2020, 4:23pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/10 "2020-05-15T16:23:03Z")

</div>

@ilhem, I'm glad to hear you're looking into the resources @thermokarst shared. He and @jwdebelius are both much more experienced with this work than I am, and their advice to proceed with caution is sound.

> [@jwdebelius](#):
>
> filtering a specific sample will likely require careful justification and consideration.

As I learn every time I come back from a bike ride 🚵‍♂️ with bruises, just because you can do something, doesn't always mean you should. 🤓

Good luck with your study!  
CK 🐔

---

<div class="post-metadata">

### Author: ![ilhem](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ilhem/32/8039_2.png) [@ilhem](https://forum.qiime2.org/u/ilhem)
#### Post date: [May 15, 2020, 4:40pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/11 "2020-05-15T16:40:06Z")

</div>

As I learn every time I come back from a bike ride 🚵‍♂️ with bruises, just because you can do something, doesn’t always mean you should. 🤓  
I totally agree with you 👍 and good luck to you also!

---

<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 15, 2020, 10:40pm UTC](https://forum.qiime2.org/t/how-to-remove-specific-feature-from-specific-sample/14912/12 "2020-06-15T22:40:09Z")

</div>

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