-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for tsv files that are either formatted like VCF files or Bed…
… Files (#2) * Support for tsv files that are either formated like VCF files or Bed Files * Add new functional tests
- Loading branch information
1 parent
bb63780
commit 27c154a
Showing
20 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ go: | |
- 1.12.x | ||
|
||
script: | ||
- ./functional-test.sh | ||
- cd cmd/check-sort-order | ||
- go test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
|
||
test -e ssshtest || wget -q https://raw.githubusercontent.com/ryanlayer/ssshtest/master/ssshtest | ||
|
||
. ssshtest | ||
|
||
set -o nounset | ||
|
||
go build -o ./check-sort-order cmd/check-sort-order/main.go | ||
|
||
|
||
## Check vcf file | ||
run check_vcf_file ./check-sort-order --genome test_genome_files/genome_sizes.genome test_files/test_file.vcf.gz | ||
assert_exit_code 0 | ||
assert_no_stdout | ||
|
||
## check bed file | ||
run check_bed_file ./check-sort-order --genome test_genome_files/genome_sizes.genome test_files/test_file.bed.gz | ||
assert_exit_code 0 | ||
assert_no_stdout | ||
|
||
## check gtf file | ||
run check_gtf_file ./check-sort-order --genome test_genome_files/genome_sizes.genome test_files/test_file.gtf.gz | ||
assert_exit_code 0 | ||
assert_no_stdout | ||
|
||
## Check bad sorted bed | ||
run check_bad_sorted_bed_file ./check-sort-order --genome test_genome_files/genome_sizes.genome test_files/test_file.bad_sort.bed.gz | ||
assert_exit_code 1 | ||
assert_in_stderr "chromosomes not in specified sort order: 4, 1 at line 33" | ||
assert_in_stderr "use gsort (https://github.com/brentp/gsort/) to order according to the genome file" | ||
|
||
## check a vcf file with a bad header | ||
run check_bad_sorted_bed_file ./check-sort-order --genome test_genome_files/genome_sizes.genome test_files/test_file.bad_header.vcf.gz | ||
assert_exit_code 1 | ||
assert_in_stderr "VCF header line '##fileformat=VCF... not found" | ||
|
||
## Check a tsv file that is formated like a vcf file | ||
run check_bad_sorted_bed_file ./check-sort-order --genome test_genome_files/genome_sizes.genome test_files/test_bed_like.tsv.gz | ||
assert_exit_code 0 | ||
assert_no_stdout | ||
|
||
## Check a tsv file that is formated like a bed file | ||
run check_bad_sorted_bed_file ./check-sort-order --genome test_genome_files/genome_sizes.genome test_files/test_bed_like.tsv.gz | ||
assert_exit_code 0 | ||
assert_no_stdout | ||
|
||
## Check a tsv file that is not formated correctly | ||
run check_bad_sorted_bed_file ./check-sort-order --genome test_genome_files/genome_sizes.genome test_files/test_bad.vcf_like.tsv.gz | ||
assert_exit_code 1 | ||
assert_in_stderr 'strconv.Atoi: parsing "A": invalid syntax' | ||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#chrom length | ||
1 249250621 | ||
2 243199373 | ||
3 198022430 | ||
4 191154276 |