Skip to content

Commit fd642a6

Browse files
committed
fix tests
1 parent ad390d1 commit fd642a6

6 files changed

Lines changed: 38 additions & 21 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ Purity values are in the range 0.0 to 1.0.
9999
The purity values are used to adjust the expected VAF which is then used to calculate the power to detect a
100100
somatic mutation and the probability of an undetected somatic mutation.
101101

102-
| Patient name | Sample name:tumor purity |
103-
|--------------------|-------------------------------------|
104-
| patient_1 | primary_tumor:0.4 |
105-
| patient_1 | metastasis_tumor:0.5 |
106-
| patient_2 | primary_tumor:0.6 |
107-
| patient_2 | metastasis_tumor:0.7 |
102+
| Patient name | Sample name:purity |
103+
|--------------------|----------------------|
104+
| patient_1 | primary_tumor:0.4 |
105+
| patient_1 | metastasis_tumor:0.5 |
106+
| patient_2 | primary_tumor:0.6 |
107+
| patient_2 | metastasis_tumor:0.7 |
108108

109109
Each patient can have any number of samples. Any sample can have any number of BAM files, annotations from the
110110
different BAM files of the same sample will be provided with suffixes _1, _2, etc.

tests/run_test_10.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33

44
source tests/assert.sh
55
output_folder=output/test10
6+
67
echo -e "tumor_normal\tprimary:"`pwd`"/test_data/TESTX_S1_L001.bam" > test_data/test_bams.txt
78
echo -e "tumor_normal\tnormal:"`pwd`"/test_data/TESTX_S1_L002.bam" >> test_data/test_bams.txt
89
echo -e "single_sample\ttumor:"`pwd`"/test_data/TESTX_S1_L001.bam" >> test_data/test_bams.txt
910
echo -e "single_sample\ttumor:"`pwd`"/test_data/TESTX_S1_L002.bam" >> test_data/test_bams.txt
1011
echo -e "single_sample\tnormal:"`pwd`"/test_data/TESTX_S1_L001.bam" >> test_data/test_bams.txt
1112
echo -e "single_sample\tnormal:"`pwd`"/test_data/TESTX_S1_L002.bam" >> test_data/test_bams.txt
13+
1214
nextflow main.nf -profile test,conda --output $output_folder --input_bams test_data/test_bams.txt --skip_normalization
15+
1316
test -s $output_folder/single_sample/single_sample.filtered_multiallelics.vcf || { echo "Missing test 10 output file!"; exit 1; }
1417
test -s $output_folder/tumor_normal/tumor_normal.filtered_multiallelics.vcf || { echo "Missing test 10 output file!"; exit 1; }
1518
test -s $output_folder/single_sample/single_sample.vaf.vcf || { echo "Missing test 10 output file!"; exit 1; }

tests/run_test_6.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,31 @@
33

44
source tests/assert.sh
55
output_folder=output/test6
6+
7+
68
echo -e "tumor_normal\tprimary:"`pwd`"/test_data/TESTX_S1_L001.bam" > test_data/test_bams.txt
79
echo -e "tumor_normal\tnormal:"`pwd`"/test_data/TESTX_S1_L002.bam" >> test_data/test_bams.txt
810
echo -e "single_sample\ttumor:"`pwd`"/test_data/TESTX_S1_L001.bam" >> test_data/test_bams.txt
911
echo -e "single_sample\ttumor:"`pwd`"/test_data/TESTX_S1_L002.bam" >> test_data/test_bams.txt
1012
echo -e "single_sample\tnormal:"`pwd`"/test_data/TESTX_S1_L001.bam" >> test_data/test_bams.txt
1113
echo -e "single_sample\tnormal:"`pwd`"/test_data/TESTX_S1_L002.bam" >> test_data/test_bams.txt
14+
15+
# run
1216
nextflow main.nf -profile test,conda --output $output_folder --input_bams test_data/test_bams.txt
17+
18+
# check results
1319
test -s $output_folder/single_sample/single_sample.normalized.vcf || { echo "Missing test 6 output file!"; exit 1; }
1420
test -s $output_folder/tumor_normal/tumor_normal.normalized.vcf || { echo "Missing test 6 output file!"; exit 1; }
1521
test -s $output_folder/single_sample/single_sample.vaf.vcf || { echo "Missing test 6 output file!"; exit 1; }
1622
test -s $output_folder/tumor_normal/tumor_normal.vaf.vcf || { echo "Missing test 6 output file!"; exit 1; }
1723
test -s $output_folder/single_sample/single_sample.filtered_multiallelics.vcf || { echo "Missing test 6 output file!"; exit 1; }
1824
test -s $output_folder/tumor_normal/tumor_normal.filtered_multiallelics.vcf || { echo "Missing test 6 output file!"; exit 1; }
19-
assert_eq `wc -l $output_folder/single_sample/single_sample.normalized.vcf | cut -d' ' -f 1` 53 "Wrong number of variants"
20-
assert_eq `wc -l $output_folder/tumor_normal/tumor_normal.normalized.vcf | cut -d' ' -f 1` 53 "Wrong number of variants"
21-
assert_eq `wc -l $output_folder/single_sample/single_sample.normalized.vaf.vcf | cut -d' ' -f 1` 72 "Wrong number of variants"
25+
26+
assert_eq `grep -v '#' $output_folder/single_sample/single_sample.normalized.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
27+
assert_eq `grep -v '#' $output_folder/tumor_normal/tumor_normal.normalized.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
28+
assert_eq `grep -v '#' $output_folder/single_sample/single_sample.vaf.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
2229
assert_eq `grep tumor_af $output_folder/single_sample/single_sample.vaf.vcf | wc -l | cut -d' ' -f 1` 35 "Wrong number of variants"
2330
assert_eq `grep normal_af $output_folder/single_sample/single_sample.vaf.vcf | wc -l | cut -d' ' -f 1` 35 "Wrong number of variants"
24-
assert_eq `wc -l $output_folder/tumor_normal/tumor_normal.vaf.vcf | cut -d' ' -f 1` 60 "Wrong number of variants"
25-
assert_eq `wc -l $output_folder/tumor_normal/tumor_normal.filtered_multiallelics.vcf | cut -d' ' -f 1` 53 "Wrong number of variants"
31+
assert_eq `grep -v '#' $output_folder/tumor_normal/tumor_normal.vaf.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
32+
assert_eq `grep -v '#' $output_folder/tumor_normal/tumor_normal.filtered_multiallelics.vcf | wc -l | cut -d' ' -f 1` 23 "Wrong number of variants"
2633
assert_eq `grep primary_af $output_folder/tumor_normal/tumor_normal.filtered_multiallelics.vcf | wc -l | cut -d' ' -f 1` 24 "Wrong number of variants"

tests/run_test_7.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ test -s $output_folder/single_sample/single_sample.normalized.vcf || { echo "Mis
1414
test -s $output_folder/tumor_normal/tumor_normal.normalized.vcf || { echo "Missing test 7 output file!"; exit 1; }
1515
test -s $output_folder/single_sample/single_sample.vaf.vcf || { echo "Missing test 7 output file!"; exit 1; }
1616
test -s $output_folder/tumor_normal/tumor_normal.vaf.vcf || { echo "Missing test 7 output file!"; exit 1; }
17-
assert_eq `wc -l $output_folder/single_sample/single_sample.normalized.vcf | cut -d' ' -f 1` 53 "Wrong number of variants"
18-
assert_eq `wc -l $output_folder/tumor_normal/tumor_normal.normalized.vcf | cut -d' ' -f 1` 53 "Wrong number of variants"
19-
assert_eq `wc -l $output_folder/single_sample/single_sample.vaf.vcf | cut -d' ' -f 1` 72 "Wrong number of variants"
17+
assert_eq `grep -v '#' $output_folder/single_sample/single_sample.normalized.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
18+
assert_eq `grep -v '#' $output_folder/tumor_normal/tumor_normal.normalized.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
19+
assert_eq `grep -v '#' $output_folder/single_sample/single_sample.vaf.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
2020
assert_eq `grep tumor_af $output_folder/single_sample/single_sample.vaf.vcf | wc -l | cut -d' ' -f 1` 35 "Wrong number of variants"
2121
assert_eq `grep normal_af $output_folder/single_sample/single_sample.vaf.vcf | wc -l | cut -d' ' -f 1` 35 "Wrong number of variants"
22-
assert_eq `wc -l $output_folder/tumor_normal/tumor_normal.vaf.vcf | cut -d' ' -f 1` 60 "Wrong number of variants"
22+
assert_eq `grep -v '#' $output_folder/tumor_normal/tumor_normal.vaf.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"

tests/run_test_8.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@
33

44
source tests/assert.sh
55
output_folder=output/test8
6+
67
echo -e "tumor_normal\tprimary:"`pwd`"/test_data/TESTX_S1_L001.bam" > test_data/test_bams.txt
78
echo -e "tumor_normal\tnormal:"`pwd`"/test_data/TESTX_S1_L002.bam" >> test_data/test_bams.txt
89
echo -e "single_sample\ttumor:"`pwd`"/test_data/TESTX_S1_L001.bam" >> test_data/test_bams.txt
910
echo -e "single_sample\ttumor:"`pwd`"/test_data/TESTX_S1_L002.bam" >> test_data/test_bams.txt
1011
echo -e "single_sample\tnormal:"`pwd`"/test_data/TESTX_S1_L001.bam" >> test_data/test_bams.txt
1112
echo -e "single_sample\tnormal:"`pwd`"/test_data/TESTX_S1_L002.bam" >> test_data/test_bams.txt
13+
1214
nextflow main.nf -profile test,conda --output $output_folder --input_bams test_data/test_bams.txt
15+
1316
test -s $output_folder/single_sample/single_sample.normalized.vcf || { echo "Missing test 8 output file!"; exit 1; }
1417
test -s $output_folder/tumor_normal/tumor_normal.normalized.vcf || { echo "Missing test 8 output file!"; exit 1; }
1518
test -s $output_folder/single_sample/single_sample.vaf.vcf || { echo "Missing test 8 output file!"; exit 1; }
1619
test -s $output_folder/tumor_normal/tumor_normal.vaf.vcf || { echo "Missing test 8 output file!"; exit 1; }
17-
assert_eq `wc -l $output_folder/single_sample/single_sample.normalized.vcf | cut -d' ' -f 1` 53 "Wrong number of variants"
18-
assert_eq `wc -l $output_folder/tumor_normal/tumor_normal.normalized.vcf | cut -d' ' -f 1` 53 "Wrong number of variants"
19-
assert_eq `wc -l $output_folder/single_sample/single_sample.vaf.vcf | cut -d' ' -f 1` 72 "Wrong number of variants"
20+
21+
assert_eq `grep -v '#' $output_folder/single_sample/single_sample.normalized.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
22+
assert_eq `grep -v '#' $output_folder/tumor_normal/tumor_normal.normalized.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
23+
assert_eq `grep -v '#' $output_folder/single_sample/single_sample.vaf.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
2024
assert_eq `grep tumor_af $output_folder/single_sample/single_sample.vaf.vcf | wc -l | cut -d' ' -f 1` 35 "Wrong number of variants"
2125
assert_eq `grep normal_af $output_folder/single_sample/single_sample.vaf.vcf | wc -l | cut -d' ' -f 1` 35 "Wrong number of variants"
22-
assert_eq `wc -l $output_folder/tumor_normal/tumor_normal.vaf.vcf | cut -d' ' -f 1` 60 "Wrong number of variants"
26+
assert_eq `grep -v '#' $output_folder/tumor_normal/tumor_normal.vaf.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"

tests/run_test_9.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
source tests/assert.sh
55
output_folder=output/test8
66
snpeff_datadir=/home/you/snpeff
7+
78
nextflow main.nf -profile test,conda --output $output_folder --snpeff_organism hg19 --snpeff_datadir $snpeff_datadir
9+
810
test -s $output_folder/single_sample/single_sample.normalized.vcf || { echo "Missing test 1 output file!"; exit 1; }
911
test -s $output_folder/tumor_normal/tumor_normal.normalized.vcf || { echo "Missing test 1 output file!"; exit 1; }
10-
assert_eq `wc -l $output_folder/single_sample/single_sample.normalized.vcf | cut -d' ' -f 1` 53 "Wrong number of variants"
11-
assert_eq `wc -l $output_folder/tumor_normal/tumor_normal.normalized.vcf | cut -d' ' -f 1` 53 "Wrong number of variants"
12+
13+
assert_eq `grep -v '#' $output_folder/single_sample/single_sample.normalized.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"
14+
assert_eq `grep -v '#' $output_folder/tumor_normal/tumor_normal.normalized.vcf | wc -l | cut -d' ' -f 1` 32 "Wrong number of variants"

0 commit comments

Comments
 (0)