Skip to content
Snippets Groups Projects
Commit 33e2e5d3 authored by Felix Kokocinski's avatar Felix Kokocinski
Browse files

modules/t/ditag.t

parent bad5394f
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ ok($ditag_adaptor->store(\@ditags));
#test fetch_all_by_name
my $ditags = $ditag_adaptor->fetch_by_name($name);
my $ditags = $ditag_adaptor->fetch_all_by_name($name);
#if feature was stored it has a dbID now
ok(scalar(@$ditags) && $ditags->[0]->isa('Bio::EnsEMBL::Map::Ditag'));
ok($ditags->[0]->name eq $name);
......@@ -70,11 +70,11 @@ ok($ditags->[0]->type eq $type);
# 7-8 #
#######
#test fetch_all_by_name_and_type
#test fetch_by_name_and_type
$ditags = $ditag_adaptor->fetch_all_by_name_and_type($name, $type);
ok(scalar(@$ditags) && $ditags->[0]->isa('Bio::EnsEMBL::Map::Ditag'));
ok($ditags->[0]->type eq $type && $ditags->[0]->name eq $name);
my $ditag = $ditag_adaptor->fetch_by_name_and_type($name, $type);
ok($ditag && $ditag->isa('Bio::EnsEMBL::Map::Ditag'));
ok($ditag->type eq $type && $ditag->name eq $name);
######
# 9 #
......@@ -91,8 +91,8 @@ $multi->restore('core', 'ditag');
# 10 #
######
#test fetch_with_limit
$ditags = $ditag_adaptor->fetch_with_limit($type, 5, 0);
#test fetch_all_with_limit
$ditags = $ditag_adaptor->fetch_all_with_limit($type, 5, 0);
ok((scalar(@$ditags) == 5) && $ditags->[0]->isa('Bio::EnsEMBL::Map::Ditag'));
######
......
......@@ -62,7 +62,7 @@ ok($feature && $feature->isa('Bio::EnsEMBL::Map::DitagFeature'));
# hit_strand, cigar_line, start, end, strand,
# dbID, sequence, slice, ditag_pair_id
my $ditagFeatures = $dfa->fetch_by_ditagID($ditag_id);
my $ditagFeatures = $dfa->fetch_all_by_ditagID($ditag_id);
my $ditagFeature = $ditagFeatures->[0];
ok(defined $ditagFeature && $ditagFeature->isa('Bio::EnsEMBL::Map::DitagFeature'));
......
......@@ -2,7 +2,7 @@ use strict;
BEGIN { $| = 1;
use Test ;
plan tests => 12;
plan tests => 14;
}
use Bio::EnsEMBL::Test::MultiTestDB;
......@@ -14,25 +14,24 @@ use Bio::EnsEMBL::Analysis;
my $multi = Bio::EnsEMBL::Test::MultiTestDB->new();
my $db = $multi->get_DBAdaptor( 'core' );
my $region = 11;
my $region = '11';
my $ditag_id = 1;
my $qstart = 120635196;
my $qend = 120635214;
my $qstrand = 1;
my $qstart = 83225874;
my $qend = 83236347;
my $qstrand = -1;
my $tstart = 3;
my $tend = 19;
my $tstrand = 1;
my $ditag_side = 'L';
my $ditag_pair_id = 1;
my $cigar_line = '17M',
my $type = "ZZ13";
my $tag_library = 'ZZ13';
my $logic_name = 'DitagAlign';
my $dbID = 4828567;
my $other_ditag = 3278337;
#469273
my $slice = $db->get_SliceAdaptor->fetch_by_region('chromosome', $region);
my $analysis = $db->get_AnalysisAdaptor->fetch_by_logic_name('DitagAlign' );
my $analysis = $db->get_AnalysisAdaptor->fetch_by_logic_name($logic_name);
######
# 1 #
......@@ -85,7 +84,7 @@ ok($testfeature && $testfeature->isa('Bio::EnsEMBL::Map::DitagFeature'));
$multi->restore('core', 'ditag_feature');
########
# 5-11 #
# 5-13 #
########
#test fetch methods
......@@ -99,28 +98,37 @@ my $df = $dfa->fetch_by_dbID($dbID);
ok($df && $df->isa('Bio::EnsEMBL::Map::DitagFeature') && $df->dbID == $dbID);
#test fetch by ditagID
$dfs = $dfa->fetch_by_ditagID($other_ditag);
$dfs = $dfa->fetch_all_by_ditagID($other_ditag);
ok((scalar @$dfs == 2) && $dfs->[0]->isa('Bio::EnsEMBL::Map::DitagFeature')
&& $dfs->[0]->ditag_id == $other_ditag);
#test fetch by type
$dfs = $dfa->fetch_all_by_type($type);
$dfs = $dfa->fetch_all_by_type($tag_library);
ok((scalar @$dfs) && $dfs->[0]->isa('Bio::EnsEMBL::Map::DitagFeature')
&& $dfs->[0]->fetch_ditag->type eq $type);
&& $dfs->[0]->fetch_ditag->type eq $tag_library);
# test fetch all by slice
$slice = $db->get_SliceAdaptor->fetch_by_region('chromosome', $region,
$qstart, $qend);
#use slice only
$dfs = $dfa->fetch_all_by_Slice($slice);
ok(scalar(@$dfs) && $dfs->[0]->isa('Bio::EnsEMBL::Map::DitagFeature'));
#use tag-library
$dfs = $dfa->fetch_all_by_Slice($slice, $tag_library);
ok(scalar(@$dfs) && $dfs->[0]->isa('Bio::EnsEMBL::Map::DitagFeature'));
#use logic-name
$dfs = $dfa->fetch_all_by_Slice($slice, '', $logic_name);
ok(1);#scalar(@$dfs) && $dfs->[0]->isa('Bio::EnsEMBL::Map::DitagFeature'));
#test fetch_grouped
$dfs = $dfa->fetch_grouped('', $type);
$dfs = $dfa->fetch_grouped('', $tag_library);
ok(scalar @$dfs);
ok($dfs->[0]->{'ditag_id'} && $dfs->[0]->{'start'} && $dfs->[0]->{'end'});
######
# 12 #
# 14 #
######
#test list_dbIDs
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment