#!/bin/bash
#SBATCH -t 4:00:00
#SBATCH --nodes=1 --ntasks-per-node=1
#SBATCH --mem=24g
#SBATCH --export=NONE
#SBATCH --mail-user=alex_labossiere@uri.edu
#SBATCH --mail-type=BEGIN,END,FAIL

module load QIIME2/2019.7

tablein=/data/mramseylab/raw_reads/AL_2022/denoise-table-1.qza
clsdir=/data/mramseylab/classifiers/
metadir=/data/mramseylab/metadata/plaque_meta_2.tsv
visdir=/data/mramseylab/visualizations/
filtdir=/data/mramseylab/proc_reads/
fil=fil-nocontrol
#I have updated the plaque meta folder, before the environmental-setting was hydroxyapitite DISC and polystyrene WELL and from syntax in meta data file, script would make directory for HA, DISC, polystyrene, WELL
#updated the metadata to have environmental settings as hydroxyapitite and polystryene
#updated metadata - 1 mM glucose, 1% mucin, 25% saliva is now glucose, mucin, saliva

#note must make directores needed BEFORE running the below command

mkdir $filtdir$fil


qiime feature-table filter-samples \
  --i-table $tablein \
  --m-metadata-file $metadir \
  --p-where "[variable-type]='Expirmental'" \
  --o-filtered-table  $filtdir$fil/table-filtered_NoControls.qza

  done
