-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodule2.basevar.sh
executable file
·46 lines (34 loc) · 1.27 KB
/
module2.basevar.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
#!/bin/bash
###
#Users should substitute the following paths with their respective local directories.
###
#Inputfile
bamlist=../outdir/batch1_final_files/bam.list
#Pipelines, softwares and tools
basevarpip=../../basevar/scripts/create_pipeline.py
tabix=/path/to/tabix
bcftools=/path/to/bcftools
#Resources
ref=/path/to/hg38/Homo_sapiens_assembly38.fasta
ref_fai=/path/to/hg38/Homo_sapiens_assembly38.fasta.fai
#Output
outdir=../outdir/basevar_output
outprefix=NIPT_basevar_chr20
mkdir -p $outdir
echo "#!/bin/sh
#SBATCH -J NIPT-human-genetics_test
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=10
#SBATCH --time=00-05:05:30
#SBATCH --mem=18432
#SBATCH --partition=cpu" > basevar.sh
python $basevarpip -R $ref --ref_fai $ref_fai -c chr20 --delta 5000000 -t 20 -L $bamlist -o $outdir >> basevar.sh
awk '{print $33}' basevar.sh > $outdir/$outprefix.vcf.list
echo "#!/bin/sh
#SBATCH -J NIPT-human-genetics_test
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=10
#SBATCH --time=00-05:05:30
#SBATCH --mem=18432
#SBATCH --partition=cpu" > basevar.merge.sh
awk '{s=s" "$1;}END{print "time '$bcftools' concat --threads 12 -a --rm-dups all -O z -o '$outdir'/'$outprefix'.vcf.gz"s" && '$tabix' -f -p vcf '$outdir'/'$outprefix'.vcf.gz && echo \"** merge vcf done **\""}' $outprefix.vcf.list >> basevar.merge.sh