Diff of /test/docker_test.sh [000000] .. [0a8e41]

Switch to unified view

a b/test/docker_test.sh
1
#!/bin/bash
2
set -e
3
4
test_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
5
cd ${test_dir}
6
mkdir -p example
7
cd example
8
9
if [ ! -f Homo_sapiens.GRCh37.75.dna.chromosome.22.fa ]
10
then
11
    if [ ! -f Homo_sapiens.GRCh37.75.dna.chromosome.22.fa.gz ]
12
    then
13
        docker run -v ${test_dir}:/mnt -u $UID --memory 30G  msahraeian/neusomatic:0.2.1 /bin/bash -c \
14
        "cd /mnt/example/ && wget ftp://ftp.ensembl.org/pub/release-75//fasta/homo_sapiens/dna/Homo_sapiens.GRCh37.75.dna.chromosome.22.fa.gz"
15
    fi
16
    docker run -v ${test_dir}:/mnt -u $UID --memory 30G  msahraeian/neusomatic:0.2.1 /bin/bash -c \
17
    "cd /mnt/example/ && gunzip -f Homo_sapiens.GRCh37.75.dna.chromosome.22.fa.gz"
18
    
19
fi
20
if [ ! -f Homo_sapiens.GRCh37.75.dna.chromosome.22.fa.fai ]
21
then
22
    docker run -v ${test_dir}:/mnt -u $UID --memory 30G  msahraeian/neusomatic:0.2.1 /bin/bash -c \
23
    "samtools faidx /mnt/example/Homo_sapiens.GRCh37.75.dna.chromosome.22.fa"
24
fi
25
rm -rf work_standalone
26
27
28
29
#Stand-alone NeuSomatic test 
30
docker run -v ${test_dir}:/mnt -u $UID --memory 30G  msahraeian/neusomatic:0.2.1 /bin/bash -c \
31
"python /opt/neusomatic/neusomatic/python/preprocess.py \
32
    --mode call \
33
    --reference /mnt/example/Homo_sapiens.GRCh37.75.dna.chromosome.22.fa \
34
    --region_bed /mnt/region.bed \
35
    --tumor_bam /mnt/tumor.bam \
36
    --normal_bam /mnt/normal.bam \
37
    --work /mnt/example/work_standalone \
38
    --scan_maf 0.05 \
39
    --min_mapq 10 \
40
    --snp_min_af 0.05 \
41
    --snp_min_bq 20 \
42
    --snp_min_ao 10 \
43
    --ins_min_af 0.05 \
44
    --del_min_af 0.05 \
45
    --num_threads 1 \
46
    --scan_alignments_binary /opt/neusomatic/neusomatic/bin/scan_alignments"
47
48
docker run -v ${test_dir}:/mnt -u $UID --memory 30G --shm-size 8G msahraeian/neusomatic:0.2.1 /bin/bash -c \
49
"CUDA_VISIBLE_DEVICES= python /opt/neusomatic/neusomatic/python/call.py \
50
        --candidates_tsv /mnt/example/work_standalone/dataset/*/candidates*.tsv \
51
        --reference /mnt/example/Homo_sapiens.GRCh37.75.dna.chromosome.22.fa \
52
        --out /mnt/example/work_standalone \
53
        --checkpoint /opt/neusomatic/neusomatic/models/NeuSomatic_v0.1.0_standalone_Dream3_70purity.pth \
54
        --num_threads 1 \
55
        --batch_size 100"
56
57
docker run -v ${test_dir}:/mnt -u $UID --memory 30G  msahraeian/neusomatic:0.2.1 /bin/bash -c \
58
"python /opt/neusomatic/neusomatic/python/postprocess.py \
59
        --reference /mnt/example/Homo_sapiens.GRCh37.75.dna.chromosome.22.fa \
60
        --tumor_bam /mnt/tumor.bam \
61
        --pred_vcf /mnt/example/work_standalone/pred.vcf \
62
        --candidates_vcf /mnt/example/work_standalone/work_tumor/filtered_candidates.vcf \
63
        --output_vcf /mnt/example/work_standalone/NeuSomatic_standalone.vcf \
64
        --work /mnt/example/work_standalone "
65
66
67
rm -rf /mnt/example/work_ensemble
68
#Ensemble NeuSomatic test 
69
docker run -v ${test_dir}:/mnt -u $UID --memory 30G  msahraeian/neusomatic:0.2.1 /bin/bash -c \
70
"python /opt/neusomatic/neusomatic/python/preprocess.py \
71
    --mode call \
72
    --reference /mnt/example/Homo_sapiens.GRCh37.75.dna.chromosome.22.fa \
73
    --region_bed /mnt/region.bed \
74
    --tumor_bam /mnt/tumor.bam \
75
    --normal_bam /mnt/normal.bam \
76
    --work /mnt/example/work_ensemble \
77
    --scan_maf 0.05 \
78
    --min_mapq 10 \
79
    --snp_min_af 0.05 \
80
    --snp_min_bq 20 \
81
    --snp_min_ao 10 \
82
    --ins_min_af 0.05 \
83
    --del_min_af 0.05 \
84
    --num_threads 1 \
85
    --ensemble_tsv /mnt/ensemble.tsv \
86
    --scan_alignments_binary /opt/neusomatic/neusomatic/bin/scan_alignments"
87
88
docker run -v ${test_dir}:/mnt -u $UID --memory 30G --shm-size 8G msahraeian/neusomatic:0.2.1 /bin/bash -c \
89
"CUDA_VISIBLE_DEVICES= python /opt/neusomatic/neusomatic/python/call.py \
90
        --candidates_tsv /mnt/example/work_ensemble/dataset/*/candidates*.tsv \
91
        --reference /mnt/example/Homo_sapiens.GRCh37.75.dna.chromosome.22.fa \
92
        --out /mnt/example/work_ensemble \
93
        --checkpoint /opt/neusomatic/neusomatic/models/NeuSomatic_v0.1.0_ensemble_Dream3_70purity.pth \
94
        --num_threads 1 \
95
        --ensemble \
96
        --batch_size 100"
97
98
docker run -v ${test_dir}:/mnt -u $UID --memory 30G  msahraeian/neusomatic:0.2.1 /bin/bash -c \
99
"python /opt/neusomatic/neusomatic/python/postprocess.py \
100
        --reference /mnt/example/Homo_sapiens.GRCh37.75.dna.chromosome.22.fa \
101
        --tumor_bam /mnt/tumor.bam \
102
        --pred_vcf /mnt/example/work_ensemble/pred.vcf \
103
        --candidates_vcf /mnt/example/work_ensemble/work_tumor/filtered_candidates.vcf \
104
        --ensemble_tsv /mnt/ensemble.tsv \
105
        --output_vcf /mnt/example/work_ensemble/NeuSomatic_ensemble.vcf \
106
        --work /mnt/example/work_ensemble" 
107
108
cd ..
109
110
file1=${test_dir}/example/work_standalone/NeuSomatic_standalone.vcf
111
file2=${test_dir}/NeuSomatic_standalone.vcf
112
113
cmp --silent $file1 $file2 && echo "### NeuSomatic stand-alone: SUCCESS! ###" \
114
|| echo "### NeuSomatic stand-alone FAILED: Files ${file1} and ${file2} Are Different! ###"
115
116
117
file1=${test_dir}/example/work_ensemble/NeuSomatic_ensemble.vcf
118
file2=${test_dir}/NeuSomatic_ensemble.vcf
119
120
cmp --silent $file1 $file2 && echo "### NeuSomatic ensemble: SUCCESS! ###" \
121
|| echo "### NeuSomatic ensemble FAILED: Files ${file1} and ${file2} Are Different! ###"