| 1 |
@sfilter |
| 2 |
Feature: Sample filters |
| 3 |
|
| 4 |
Bio-vcf supports sample filters, where every sample is evaluated |
| 5 |
independently, though they have the rec information (chrom, pos, info) |
| 6 |
available. |
| 7 |
|
| 8 |
Scenario: Example of a sample |
| 9 |
|
| 10 |
Given the VCF line |
| 11 |
""" |
| 12 |
1 10723 . C G 73.85 . AC=4;AF=0.667;AN=6;BaseQRankSum=1.300;DP=18;Dels=0.00;FS=3.680;HaplotypeScore=0.0000;MLEAC=4;MLEAF=0.667;MQ=20.49;MQ0=11;MQRankSum=1.754;QD=8.21;ReadPosRankSum=0.000 GT:AD:DP:GQ:PL |
| 13 |
""" |
| 14 |
When I evaluate '0/0:6,0:6:3:0,3,33' |
| 15 |
Then I expect s.empty? to be false |
| 16 |
Then I expect s.dp? to be true |
| 17 |
Then I expect s.dp to be 6 |
| 18 |
And sfilter 's.dp>4' to be true |
| 19 |
|
| 20 |
# Scenario: Sample with missing data |
| 21 |
When I evaluate missing '0/0:6,0:.:3:0,3,33' |
| 22 |
Then I expect s.empty? to be false |
| 23 |
Then I expect s.dp? to be false |
| 24 |
Then I expect s.dp to be nil |
| 25 |
And sfilter 's.dp>4' to throw an error |
| 26 |
|
| 27 |
# Scenario: Sample with missing data with ignore missing set |
| 28 |
When I evaluate missing '0/0:6,0:.:3:0,3,33' with ignore missing |
| 29 |
Then I expect s.empty? to be false |
| 30 |
Then I expect s.dp? to be false |
| 31 |
Then I expect s.dp to be nil |
| 32 |
And sfilter 's.dp>4' to be false |
| 33 |
|
| 34 |
# Scenario: Missing sample |
| 35 |
When I evaluate empty './.' |
| 36 |
Then I expect s.empty? to be true |
| 37 |
Then I expect s.dp? to be false |
| 38 |
Then I expect s.dp to be nil |
| 39 |
And sfilter 's.dp>4' to throw an error |
| 40 |
|
| 41 |
# Scenario: Missing sample with ignore missing set |
| 42 |
When I evaluate empty './.' with ignore missing |
| 43 |
Then I expect s.empty? to be true |
| 44 |
Then I expect s.dp? to be false |
| 45 |
Then I expect s.dp to be nil |
| 46 |
And sfilter 's.dp>4' to be false |
| 47 |
|
| 48 |
# Scenario: Wrong field name in sample |
| 49 |
When I evaluate '0/0:6,0:6:3:0,3,33' |
| 50 |
Then I expect s.empty? to be false |
| 51 |
Then I expect s.dp? to be true |
| 52 |
Then I expect s.what? to throw an error |
| 53 |
And I expect s.what to throw an error |
| 54 |
|
| 55 |
# Scenario: Get other information for a sample |
| 56 |
When I evaluate '0/0:6,0:6:3:0,3,33' |
| 57 |
Then I expect r.chrom to be "1" |
| 58 |
And I expect r.alt to be ["G"] |
| 59 |
And I expect r.info.af to be 0.667 |
| 60 |
|