Step 5 Filtering (bcftools filter) - alyrcoun/EPP622-2026-SNPCalling GitHub Wiki

Gentle vs. Stringent Filtering

Analysis Overview"

Evaluate how different quality thresholds impact variant calls by testing two separate filters (Gentle v. Stringent) from this working directory:

cd lustre/isaac24/proj/UTK0505/alyrcoun/epp_622/test2/test2_analyses/bcftools_results

Gentle Filtering - exclude variants with a QUAL less than 20 or less than 5 total read depth across all samples.

# Apply gentle exclusion filter
bcftools filter -e 'QUAL < 20 || INFO/DP < 5' \
  -O z -o filtered_gentle.vcf.gz \
  raw_calls.vcf.gz

# Index the output VCF
bcftools index filtered_gentle.vcf.gz

# Generate summary stats
bcftools stats filtered_gentle.vcf.gz > filtered_gentle.stats.txt

Stringent Filtering - exclude variants with a QUAL less than 30 or less than 10 total read depth across all samples or a site level mapping quality (root mean square) of less than 40

# Apply stringent exclusion filter
bcftools filter -e 'QUAL < 30 || INFO/DP < 10 || INFO/MQ < 40' \
  -O z -o filtered_stringent.vcf.gz \
  raw_calls.vcf.gz

# Index the output VCF
bcftools index filtered_stringent.vcf.gz

# Generate summary stats
bcftools stats filtered_stringent.vcf.gz > filtered_stringent.stats.txt

# Grab exact SNP count numbers for documentation.
grep "number of SNPs:" raw_calls.stats.txt filtered_gentle.stats.txt filtered_stringent.stats.txt

Results

bcftools stats report path and name for gentle filtering: /lustre/isaac24/proj/UTK0505/alyrcoun/epp_622/test2/test2_analyses/bcftools_results/filtered_gentle.stats.txt

bcftools stats report path and name for stringent filtering: /lustre/isaac24/proj/UTK0505/alyrcoun/epp_622/test2/test2_analyses/bcftools_results/filtered_stringent.stats.txt

VCF number of SNPs
raw 4920-
gentle 4869-
stringent 4774-