Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl-io
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl-io
Commits
8a2eae3f
Commit
8a2eae3f
authored
5 years ago
by
Tiago Grego
Browse files
Options
Downloads
Patches
Plain Diff
test for query
parent
58c48150
No related branches found
No related tags found
1 merge request
!97
[ENSCORESW-3106] BCF parser
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/t/bcf.t
+4
-8
4 additions, 8 deletions
modules/t/bcf.t
with
4 additions
and
8 deletions
modules/t/bcf.t
+
4
−
8
View file @
8a2eae3f
...
@@ -18,17 +18,16 @@ use warnings;
...
@@ -18,17 +18,16 @@ use warnings;
use
Test::
More
;
use
Test::
More
;
use
Bio::EnsEMBL::IO::Parser::
BCF
;
use
Bio::EnsEMBL::IO::Parser::
BCF
;
use
FindBin
;
use
FindBin
qw( $Bin )
;
my
$test_file
=
$
FindBin::
Bin
.
'
/input/test.bcf
';
my
$test_file
=
$Bin
.
'
/input/test.bcf
';
# Test standard functions on a BCF file
# Test standard functions on a BCF file
ok
(
my
$parser
=
Bio::EnsEMBL::IO::Parser::
BCF
->
open
(
$test_file
),
"
BCF file open
");
ok
(
my
$parser
=
Bio::EnsEMBL::IO::Parser::
BCF
->
open
(
$test_file
),
"
BCF file open
");
is
(
$parser
->
num_variants
(),
9
,
'
correct number of variants identified in file
');
is
(
$parser
->
num_variants
(),
9
,
'
correct number of variants identified in file
');
ok
(
my
$h
=
$parser
->
header
(),
"
Got header
");
ok
(
my
$h
=
$parser
->
header
(),
"
Got header
");
my
$header_str
=
<<
"
HEADER
"
;
my
$header_str
=
<<HEADER;
##fileformat=VCFv4.0
##fileformat=VCFv4.0
##FILTER=<ID=PASS,Description="All filters passed">
##FILTER=<ID=PASS,Description="All filters passed">
##fileDate=20090805
##fileDate=20090805
...
@@ -174,11 +173,8 @@ is_deeply ($info_result, {
...
@@ -174,11 +173,8 @@ is_deeply ($info_result, {
},
'
info read correctly
');
},
'
info read correctly
');
# Query tests
# Query tests
# FIXME
# ok ($row = $parser->seek(20,1000000,1231000), "can query a region");
ok
(
$row
=
$parser
->
next
(),
"
can get first value
");
ok
(
$row
=
$parser
->
next
(),
"
can get first value
");
do
{
$row
=
$parser
->
next
()
}
until
(
$row
->
chromosome
(
$h
)
==
20
&&
$row
->
position
==
1110696
);
ok
(
$row
=
$parser
->
seek
(
20
,
1000000
,
1231000
),
"
can query a region
"
);
# # 20 1110696 rs6040355 A G,T 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:GQ:DP:HQ 1|2:21:6:23,27 2|1:2:0:18,2 2/2:35:4:.,.
# # 20 1110696 rs6040355 A G,T 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:GQ:DP:HQ 1|2:21:6:23,27 2|1:2:0:18,2 2/2:35:4:.,.
is
(
$row
->
chromosome
(
$h
),
20
,
'
chr
');
is
(
$row
->
chromosome
(
$h
),
20
,
'
chr
');
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment