-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodule1.alignment.sh
executable file
·43 lines (37 loc) · 1.79 KB
/
module1.alignment.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
fqlist=/share/home/lsy_liusiyang/NIPT-human-genetics/example/data/fq.list
#Resources
ref=/share/home/lsy_liusiyang/20220708_Alignment/hg38/Homo_sapiens_assembly38.fasta
ref_index_prefix=/share/home/lsy_liusiyang/20220708_Alignment/hg38/Homo_sapiens_assembly38.fasta
gatk_bundle_dir=/share/home/lsy_liusiyang/20220708_Alignment/hg38
#Pipelines, softwares and tools
workflow=../../../NIPT-human-genetics/bwa_alignment/alignment_workflow.sh
bwa=/share/home/lsy_liusiyang/software/bwa-0.7.17/bwa
samtools=/share/home/lsy_liusiyang/software/samtools-1.15.1/samtools
gatk=/share/home/lsy_liusiyang/software/GenomeAnalysisTK-3.8-0-ge9d806836/GenomeAnalysisTK.jar
java=/usr/bin/java
bedtools=/share/home/lsy_liusiyang/software/bedtools2/bin/bedtools
bgzip=/share/home/lsy_liusiyang/software/tabix-0.2.6/bgzip
tabix=/share/home/lsy_liusiyang/software/tabix-0.2.6/tabix
### Output Because the process is conducted in batches and in parallel, a temporary output directory has been set up
tmpoutdir=/share/home/lsy_liusiyang/NIPT-human-genetics/example/outdir/1tmp_files
finaloutdir=/share/home/lsy_liusiyang/NIPT-human-genetics/example/outdir/batch1_final_files
cat $fqlist|while read -r line
do
fq=`echo $line|awk '{print $1}'`
cid=`echo $line|awk '{print $2}'`
lid=`echo $line|awk '{print $3}'`
samid=`echo $line|awk '{print $4}'`
echo "#!/bin/sh
#SBATCH -J NIPT-human-genetics_test
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --time=00-05:05:30
#SBATCH --mem=18432
#SBATCH --partition=cpu
$workflow -f $fq -c $cid -l $lid -s $samid -a $bwa -t $samtools -g $gatk -j $java -e $bedtools -z $bgzip -x $tabix -r $ref -i $ref_index_prefix -b $gatk_bundle_dir -o $tmpoutdir -u $finaloutdir" >$samid.tmp.sh
done