-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathparaMrBam
39 lines (32 loc) · 1.09 KB
/
paraMrBam
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
#!/usr/bin/env bash
if [[ $# -eq 0 ]] ; then
echo "usage: paraMrBam 16 input.vcf [options for MrBam, except vcf, -o and --skip] > output.vcf"
echo "if second argument ends in .txt, it will skip the first line automatically"
exit 1
fi
export PYTHONPATH=/haplox/users/wangzy/Software
TMP=$(mktemp -d)
cd $CWD
vcf=$2
for i in "$@"; do
if [ $i = "--snp" ];then
#echo "/usr/bin/python3 -m MrBam.main ${@:2} --continous -o $TMP/continous_MrBam.txt > $TMP/breaked.snp.txt"
/usr/bin/python3 -m MrBam.main ${@:2} --continous -o $TMP/continous_MrBam.txt > $TMP/breaked.snp.txt
#/data/haplox/users/wangzy/00.Tools/02.HGVS.parse/HGVS.parser.py $TMP/continous_MrBam.txt > $TMP/continous_HGVS.MrBam.txt
# rm $TMP/continous_MrBam.txt
vcf=$TMP/breaked.snp.txt
fi
done
echo $(head -n 1 $vcf)
let LINE=($(wc -l < $vcf)+ $1-1)/$1
tail $vcf -n +2 | split -l $LINE - $TMP/
for i in $TMP/*; do
if [ $i != $TMP/breaked.snp.txt ];then
if [ $i != $TMP/continous_MrBam.txt ];then
/usr/bin/python3 -m MrBam.main ${@:3} $i &
fi
fi
done
wait
cat $TMP/*_MrBam*
rm -rf $TMP