#!/bin/bash

# Merge (assemble) paired reads
$usearch -fastq_mergepairs Mock_R1.fq -fastqout merged.fq

# Quality filter
$usearch -fastq_filter merged.fq -fastq_maxee 1.0 -relabel Filt -fastaout filtered.fa

# Find unique read sequences and abundances
$usearch -fastx_uniques filtered.fa -sizeout -relabel Uniq -fastaout uniques.fa

# Make 97% OTUs and filter chimeras
$usearch -cluster_otus uniques.fa -otus otus.fa -relabel Otu

# Denoise
$usearch -unoise3 uniques.fa -zotus zotus.fa
