-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaild-rma.sb
33 lines (29 loc) · 917 Bytes
/
aild-rma.sb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#SBATCH --ntasks=1
#SBATCH --job-name=_rma
#SBATCH --time=8:00:00
#SBATCH --partition=long
#SBATCH --mem=128800
#SBATCH --array=1-92%2
#SBATCH --output=rma/_rma_%A_%a.out
#SBATCH --error=rma/_rma_%A_%a.err
#SBATCH --export ALL
. /etc/profile.d/modules.sh
module load default-cardio
module load slurm
module load use.own
module load gcc/5.2.0
export TMPDIR=/scratch/jhz22/tmp
export rt=/home/jhz22/INF
export prot=$(awk 'NR==ENVIRON["SLURM_ARRAY_TASK_ID"]{print $1}' work/inf1.tmp)
export p=$prot
export bed=tryggve/EURLD-no-high-LD-regions-hg19.bed
(
echo -e \#chrom "\t" Start "\t" End "\t" SNP "\t" A1 "\t" A2 "\t" freq "\t" b "\t" se "\t" p "\t" N
gunzip -c $rt/METAL/${p}-1.tbl.gz | \
awk 'NR>1 && $14>50' | \
sort -k1,1n -k2,2 | \
awk -vOFS="\t" '{print "chr" $1, $2-1, $2, $3, $4, $5, $6, $10, $11, $12, $14}'
) | \
bedtools intersect -a $bed -b - -loj | \
cut -f4,8-15 > rma/${p}.rma