-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpileup_genes.sh
64 lines (44 loc) · 1.34 KB
/
mpileup_genes.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#$ -cwd
#$ -S /bin/bash
#$ -N mpile
#$ -o mpile_out
#$ -e mpile_err
# #$ -l mem_free=2G
#$ -V
# #$ -q !(gbs|grungall1)
#$ -q !gbs
# #$ -h
# $ -t 11-18179:1
#$ -t 1-10:1
i=$(expr $SGE_TASK_ID - 1)
#PATH=~/bin/samtools-1.1/:$PATH
# http://www.htslib.org/doc/
SAMT="/raid1/home/bpp/knausb/bin/samtools-1.3.1/samtools"
#BAM=( `cat "./bams2.txt" `)
#BED=( `cat "pitg_1based.bed" `)
BED="../pitg_1based.bed"
CHROM=( `cut -f1 $BED` )
START=( `cut -f2 $BED` )
STOP=( `cut -f3 $BED` )
PITG=( `cut -f4 $BED` )
#IFS=';' read -a arr <<< "${BAM[$i]}"
#IFS='\t' read -a arr <<< "${BED[$i]}"
REF="/home/bpp/knausb/Grunwald_Lab/home/knausb/bjk_pinf_ref/pinf_super_contigs.fa"
echo -n "Running on: "
hostname
echo "SGE job id: $JOB_ID"
echo "SGE_TASK_ID: $SGE_TASK_ID"
date
echo
echo "Path:"
echo $PATH
echo
#CMD="samtools mpileup -f $REF -b bams3.list --positions pitg_core_annotations_unique_sc10.bed | gzip > mpileup_core_sc10.txt.gz"
#CMD="samtools mpileup -f $REF -b ./bams.txt --positions ../pitg_core_annotations_unique_sc19.bed | gzip > mpileup_core_sc19.txt.gz"
#CMD="samtools mpileup -f $REF ${arr[1]} --positions pitg_core_annotations_unique_0based.bed | gzip > core_pu/${arr[0]}.mpileup.gz"
CMD="$SAMT mpileup -b bams.txt -f $REF -r ${CHROM[$i]}:${START[$i]}-${STOP[$i]} | gzip -c > pitg_pu/${PITG[$i]}.mpileup.gz"
echo $CMD
eval $CMD
date
# EOF.