OTU_decontam.R - juanravm/MicroSeqProfiler GitHub Wiki

OTU decontamination by negative control normalization (OTU_decontam.R)

Previous to the diversity analysis, this script performs a decontamination of samples by negative controls normalization with decontam R package. This package performs a statistical analysis to identify and remove counts from microorganisms whose abundance is not significantly higher in samples compared to negative controls, returning the decontaminated table with OTU counts in QIIME2 artifact and .tsv format.

You must deactivate qiime2 conda enviroment prior to running this script:

conda deactivate

You can run this script as shown below:

Rscript /file_path/OTU_decontam.R \
--OTU_filtered_table file_path/OTU_filtered_table.tsv \
--neg Neg \
--output_dir /output/directory_path \
--metadata_fp /file_path/metadata.tsv 

In this code you must specify the next input variables:

  • --OTU_filtered_table - OTU_filtered_table.tsv file generated by OTU_classifier.sh script
  • --neg - Character string common in all negative samples names to differentiate between negative controls and samples
  • --output_dir - Output directory path
  • --metadata_fp - Metadata file path

This script returns:

  • decontam_OTU_table.csv - A file with chimera-filtered and decontaminated OTU counts in .csv format
  • LEfSe - A directory for posterior LEfSe analysis with lefse.R script