Skip to content

Instantly share code, notes, and snippets.

@explodecomputer
Created August 17, 2015 09:14
Show Gist options
  • Save explodecomputer/03647e4b309e14f47561 to your computer and use it in GitHub Desktop.
Save explodecomputer/03647e4b309e14f47561 to your computer and use it in GitHub Desktop.
match positions to rsids
#!/bin/bash
cd /panfs/panasas01/shared/alspac/studies/latest/alspac/genetic/variants/arrays/gwas/imputed/1000genomes/released/2015-06-25/data/quality
rm -f ~/out.txt
for i in {1..23}
do
echo ${i}
awk -v chr=$i '{if($1 == chr) print $2}' 1000GP_16-06-14_flipped_SNPs.txt > ~/temp
ii=`printf %02d $i`
zfgrep -wf ~/temp data_chr${ii}.txt.gz | awk '{ print $2 }' >> ~/out.txt
done
less ~/out.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment