Skip to content

Instantly share code, notes, and snippets.

@milescsmith
Last active May 6, 2022 20:17
Show Gist options
  • Save milescsmith/5ba7578ad380169dc7141c8fb3b215e1 to your computer and use it in GitHub Desktop.
Save milescsmith/5ba7578ad380169dc7141c8fb3b215e1 to your computer and use it in GitHub Desktop.
search directory for variant files and find particular snps
#! /usr/bin/bash
find . \
-type f \
\( -name "*.vcf" -o -name "*.vcf.gz" -o -name "*.bcf" \) \
-printf "%f\n" \
-exec \
sh \
-c
"bcftools view \
-H \
--include [email protected] {} \
| cut -f 1-4" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment