leffj / mctoolsr

Microbial community analysis tools in R
http://leffj.github.io/mctoolsr/
20 stars 8 forks source link

removing OTUs from controls #29

Closed Jinx169 closed 6 years ago

Jinx169 commented 6 years ago

Hi, I would like to remove the OTUs within my negative control from all my data. Is there a possibility to do this in mctoolsr? And another question, can one somehow implemented normalized data from metagenomeSeq?

Best regards!

leffj commented 6 years ago

Hi - You can filter out the OTUs from your negative control by selecting just the negative control data and using the OTU IDs from those samples. Once you have that list, you can use filter_taxa_from_input() to filter those OTU IDs from your dataset. See the example below with the example dataset. Since there are no controls in that dataset, I filtered out all mushroom associated OTUs instead:

mush = filter_data(fruits_veggies, 'Sample_type', keep_vals = 'Mushrooms')
fruits_veggies.noMushTax = filter_taxa_from_input(fruits_veggies, 
                                                  taxa_IDs_to_remove = rownames(mush$data_loaded))
# check that mushrooms have no sequences left
colSums(fruits_veggies.noMushTax$data_loaded)

For the metagenomeSeq normalized data, there is currently no function to do this in mctoolsr, but you could do this on your own and import the dataset into using the mctoolsr functions as another dataset.

Jinx169 commented 6 years ago

Many thanks!!!!

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virenfrei. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

2017-12-07 15:26 GMT+01:00 Jonathan W. Leff notifications@github.com:

Hi - You can filter out the OTUs from your negative control by selecting just the negative control data and using the OTU IDs from those samples. Once you have that list, you can use filter_taxa_from_input() to filter those OTU IDs from your dataset. See the example below with the example dataset. Since there are no controls in that dataset, I filtered out all mushroom associated OTUs instead:

mush = filter_data(fruits_veggies, 'Sample_type', keep_vals = 'Mushrooms') fruits_veggies.noMushTax = filter_taxa_from_input(fruits_veggies, taxa_IDs_to_remove = rownames(mush$data_loaded))

check that mushrooms have no sequences left

colSums(fruits_veggies.noMushTax$data_loaded)```

For the metagenomeSeq normalized data, there is currently no function to do this in mctoolsr, but you could do this on your own and import the dataset into using the mctoolsr functions as another dataset.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/leffj/mctoolsr/issues/29#issuecomment-349982170, or mute the thread https://github.com/notifications/unsubscribe-auth/AeDRCAYNL7TezhO5ALLRbjaYJLiMzwZgks5s9_WcgaJpZM4Q5UqN .