#!/bin/bash #SBATCH --account=ACCOUNT #SBATCH --cpus-per-task=4 #SBATCH --mem=8G #SBATCH --ntasks=32 #SBATCH --time="3-00:00:00" # DEPENDENCIES: # fastq-to-taxonomy.sh # manipulatefeaturetable.R # fetchmetadata.R # Modules to load module load swset module load gcc module load miniconda3 module load metaxa2 module load r # Generate Level-7 taxonomy summaries for all samples using paired-end # read FASTQ files in Metaxa2 # This step can be executed in parallel for all the files, but since # Metaxa2 uses 4 cpus, we need to make sure that each instance has # enough cpus to run echo "--^-- X: Reading FASTQ sequences..." find . -maxdepth 1 -print0 -name "*R1_001.fastq.gz" | \ xargs -0 -L1 -P"$SLURM_NTASKS" srun -n1 -N1 --exclusive ./fastq-to-taxonomy.sh echo "--^-- X: Reading FASTQ sequences...Done!" # Compile those pesky individual taxonomic tables into a single # OTU feature table echo "--^-- X: Compiling feature table..." metaxa2_dc -i ./*.level_7.txt -o metaxa-feature-table.tsv echo "--^-- X: Compiling feature table...Done!" # Rearrange the feature table to something QIIME likes a little bit better echo "--^-- X: Rearranging feature table..." Rscript ./manipulatefeaturetable.R echo "--^-- X: Rearranging feature table...Done!" # Pull the column names from the metadata table echo "--^-- X: Finding metadata columns..." Rscript ./fetchmetadata.R echo "--^-- X: Finding metadata columns...Done!" # Our minimum taxa count is 11123 - this will be needed for rarefaction MINRAREFACTION=$(