Skip to content

Instantly share code, notes, and snippets.

@nievergeltlab
Last active July 25, 2017 18:42
Show Gist options
  • Save nievergeltlab/8055460163dfb7fed3770003bb069c72 to your computer and use it in GitHub Desktop.
Save nievergeltlab/8055460163dfb7fed3770003bb069c72 to your computer and use it in GitHub Desktop.
Get ambiguous alleles
#Assumes data is a table delimited .bim file
bimfile=bim_name_here
grep -P "A\tT" $bimfile > ambiguous_snps.txt
grep -P "T\tA" $bimfile >> ambiguous_snps.txt
grep -P "C\tG" $bimfile >> ambiguous_snps.txt
grep -P "G\tC" $bimfile >> ambiguous_snps.txt
#for metal
bimfile=LOOMeur_1_.results
grep -P "\ta\tt\t" $bimfile > ambiguous_snps.txt
grep -P "\tt\ta\t" $bimfile >> ambiguous_snps.txt
grep -P "\tc\tg\t" $bimfile >> ambiguous_snps.txt
grep -P "\tg\tc\t" $bimfile >> ambiguous_snps.txt
awk '{print $1}' ambiguous_snps.txt > ambiguous_snps2.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment