-
Notifications
You must be signed in to change notification settings - Fork 0
/
exome_do_cnvkit_v1_female
73 lines (62 loc) · 3.17 KB
/
exome_do_cnvkit_v1_female
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
65
66
67
68
69
70
71
#!/bin/bash
BIN=$1
if ! test -e exome_v1_female_$BIN ; then
mkdir exome_v1_female_$BIN
fi
if ! test -e exome_v1_female_$BIN/targets.bed ; then
qrun "R=2 C=1 P=2 G=cnvkit" cnvkit.py target /mnt/Data2/exome_sequencing/resources/v1/variantcall.bed --split -o exome_v1_female_$BIN/targets.bed
fi
if ! test -e exome_v1_female_$BIN/access.bed ; then
qrun "R=2 C=1 P=2 G=cnvkit" cnvkit.py access /mnt/Data1/resources/human_g1k_v37.fasta -o exome_v1_female_$BIN/access.bed
fi
if ! test -e exome_v1_female_$BIN/antitargets.bed ; then
qrun "R=2 C=1 P=2 G=cnvkit" cnvkit.py antitarget exome_v1_female_$BIN/targets.bed -g exome_v1_female_$BIN/access.bed -a $BIN -o exome_v1_female_$BIN/antitargets.bed
fi
if ! test -e exome_v1_female_$BIN/targets ; then
mkdir exome_v1_female_$BIN/targets
mkdir exome_v1_female_$BIN/antitargets
for BAM in /mnt/Data6/mw501/papers/2017_1_off_target_reads/exomes/v1/female/*.bam ; do
OUT=`echo $BAM | sed -e "s/^.*\///;s/\.bam$//"`
qrun "R=2 C=2 P=2 G=cnvkit" cnvkit.py coverage $BAM exome_v1_female_$BIN/targets.bed -o exome_v1_female_$BIN/targets/${OUT}.cnn &
done
wait
for BAM in /mnt/Data6/mw501/papers/2017_1_off_target_reads/exomes/v1/female/*.bam ; do
OUT=`echo $BAM | sed -e "s/^.*\///;s/\.bam$//"`
qrun "R=2 C=2 P=2 G=cnvkit" cnvkit.py coverage $BAM exome_v1_female_$BIN/antitargets.bed -o exome_v1_female_$BIN/antitargets/${OUT}.cnn &
done
wait
fi
if ! test -e exome_v1_female_$BIN/reference.cnn ; then
qrun "R=2 C=2 P=2 G=cnvkit" cnvkit.py reference -g female exome_v1_female_$BIN/targets/*.cnn exome_v1_female_$BIN/antitargets/*.cnn -f /mnt/Data1/resources/human_g1k_v37.fasta -o exome_v1_female_$BIN/reference.cnn
fi
if ! test -e exome_v1_female_$BIN/fix ; then
mkdir exome_v1_female_$BIN/fix
for BAM in /mnt/Data6/mw501/papers/2017_1_off_target_reads/exomes/v1/female/*.bam ; do
OUT=`echo $BAM | sed -e "s/^.*\///;s/\.bam$//"`
qrun "R=2 C=2 P=2 G=cnvkit" cnvkit.py fix exome_v1_female_$BIN/targets/${OUT}.cnn exome_v1_female_$BIN/antitargets/${OUT}.cnn exome_v1_female_$BIN/reference.cnn -o exome_v1_female_$BIN/fix/${OUT}.fix.cnr &
done
wait
fi
if ! test -e exome_v1_female_$BIN/segment ; then
mkdir exome_v1_female_$BIN/segment
for BAM in /mnt/Data6/mw501/papers/2017_1_off_target_reads/exomes/v1/female/*.bam ; do
OUT=`echo $BAM | sed -e "s/^.*\///;s/\.bam$//"`
qrun "R=2 C=2 P=2 G=cnvkit" cnvkit.py segment -m haar exome_v1_female_$BIN/fix/${OUT}.fix.cnr -o exome_v1_female_$BIN/segment/${OUT}.cns &
done
wait
fi
if ! test -e exome_v1_female_$BIN/call ; then
mkdir exome_v1_female_$BIN/call
for BAM in /mnt/Data6/mw501/papers/2017_1_off_target_reads/exomes/v1/female/*.bam ; do
OUT=`echo $BAM | sed -e "s/^.*\///;s/\.bam$//"`
qrun "R=2 C=1 P=2 G=cnvkit" cnvkit.py call -g female exome_v1_female_$BIN/segment/${OUT}.cns -o exome_v1_female_$BIN/call/${OUT}.cns &
done
wait
fi
if ! test -e exome_v1_female_$BIN/results ; then
mkdir exome_v1_female_$BIN/results
for BAM in /mnt/Data6/mw501/papers/2017_1_off_target_reads/exomes/v1/female/*.bam ; do
OUT=`echo $BAM | sed -e "s/^.*\///;s/\.bam$//"`
grep "^chromosome\|^[1-9X].* [^2] [0-9.]* [0-9]* [0-9.]*$" <exome_v1_female_$BIN/call/${OUT}.cns >exome_v1_female_$BIN/results/${OUT}.results
done
fi