| 1 |
Given(/^the VCF header lines$/) do |string| |
| 2 |
header = VcfHeader.new |
| 3 |
header.add string |
| 4 |
@vcf = header |
| 5 |
end |
| 6 |
|
| 7 |
When(/^I parse the VCF header$/) do |
| 8 |
end |
| 9 |
|
| 10 |
Then(/^I expect vcf\.columns to be \[CHROM','POS','ID','REF','ALT','QUAL','FILTER','INFO','FORMAT','NORMAL','TUMOR'\]$/) do |
| 11 |
expect(@vcf.column_names).to eq ['CHROM','POS','ID','REF','ALT','QUAL','FILTER','INFO','FORMAT','NORMAL','TUMOR'] |
| 12 |
end |
| 13 |
|
| 14 |
Then(/^I expect vcf\.fileformat to be "(.*?)"$/) do |arg1| |
| 15 |
expect(@vcf.fileformat).to eq arg1 |
| 16 |
end |
| 17 |
|
| 18 |
Then(/^I expect vcf\.fileDate to be "(.*?)"$/) do |arg1| |
| 19 |
expect(@vcf.fileDate).to eq arg1 |
| 20 |
end |
| 21 |
|
| 22 |
Then(/^I expect vcf.field\['fileDate'\] to be "(.*?)"$/) do |arg1| |
| 23 |
expect(@vcf.field['fileDate']).to eq arg1 |
| 24 |
end |
| 25 |
|
| 26 |
Then(/^I expect vcf\.phasing to be "(.*?)"$/) do |arg1| |
| 27 |
expect(@vcf.phasing).to eq arg1 |
| 28 |
end |
| 29 |
|
| 30 |
Then(/^I expect vcf\.reference to be "(.*?)"$/) do |arg1| |
| 31 |
expect(@vcf.reference).to eq arg1 |
| 32 |
end |
| 33 |
|
| 34 |
Then(/^I expect vcf\.format\['(\w+)'\] to be (\{[^}]+\})/) do |arg1,arg2| |
| 35 |
expect(@vcf.format[arg1].to_s).to eq arg2 |
| 36 |
end |
| 37 |
|
| 38 |
Then(/^I expect vcf\.info\['(\w+)'\] to be (\{[^}]+\})/) do |arg1,arg2| |
| 39 |
expect(@vcf.info[arg1].to_s).to eq arg2 |
| 40 |
end |
| 41 |
|
| 42 |
Then(/^I expect vcf\.meta to contain all header meta information$/) do |
| 43 |
m = @vcf.meta |
| 44 |
expect(m['fileformat']).to eq "VCFv4.1" |
| 45 |
expect(m['FORMAT']['DP']['Number']).to eq "1" |
| 46 |
expect(m.size).to be 9 |
| 47 |
end |
| 48 |
|