Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
29364805
Commit
29364805
authored
May 28, 2003
by
Arne Stabenau
Browse files
Test file for archiveStableIds and adaptor
parent
d2a623a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
116 additions
and
0 deletions
+116
-0
modules/t/archiveStableId.t
modules/t/archiveStableId.t
+116
-0
No files found.
modules/t/archiveStableId.t
0 → 100644
View file @
29364805
use
lib
'
t
';
use
strict
;
use
warnings
;
BEGIN
{
$|
=
1
;
use
Test
;
plan
tests
=>
7
;
}
use
MultiTestDB
;
use
Bio::EnsEMBL::DBSQL::
ArchiveStableIdAdaptor
;
use
TestUtils
qw(test_getter_setter debug)
;
our
$verbose
=
0
;
#
# 1 ArchiveStableId adaptor compiles
#
ok
(
1
);
my
$multi
=
MultiTestDB
->
new
;
my
$db
=
$multi
->
get_DBAdaptor
('
core
');
my
$asia
=
$db
->
get_ArchiveStableIdAdaptor
();
my
$asi
=
$asia
->
fetch_by_stable_id
(
"
G1
"
);
_print_asi
(
$asi
);
#
# 2 retrieval of an archiveStableId
#
ok
(
$asi
);
my
$pre_asis
=
$asi
->
get_all_predecessors
();
for
my
$asi
(
@$pre_asis
)
{
debug
(
"
Pre G1
"
);
_print_asi
(
$asi
);
}
#
# 3 how many predecessors does it have
#
ok
(
scalar
(
@$pre_asis
)
==
2
);
my
$transcripts
=
$pre_asis
->
[
0
]
->
get_all_transcript_archive_ids
();
for
my
$asi
(
@$transcripts
)
{
debug
(
"
Transcripts G1
"
);
_print_asi
(
$asi
);
my
$tl
=
$asi
->
get_translation_archive_id
();
_print_asi
(
$tl
);
}
#
# 4 transcripts for a gene
#
ok
(
scalar
(
@$transcripts
)
==
1
);
$pre_asis
=
$pre_asis
->
[
0
]
->
get_all_predecessors
();
debug
(
"
Predecessors:
"
.
scalar
(
@$pre_asis
)
);
#
# 5 no predecessor case
#
ok
(
scalar
(
@$pre_asis
)
==
0
);
$asi
=
$asia
->
fetch_by_stable_id_dbname
(
"
G4
",
"
release_1
"
);
my
$succ_asis
=
$asi
->
get_all_successors
();
for
my
$asi
(
@$succ_asis
)
{
debug
(
"
Succ G4.1
"
);
_print_asi
(
$asi
);
}
#
# 6 successor case
#
ok
(
scalar
(
@$succ_asis
)
==
1
);
$succ_asis
=
$succ_asis
->
[
0
]
->
get_all_successors
();
for
my
$asi
(
@$succ_asis
)
{
debug
(
"
Succ Succ G4.1
"
);
_print_asi
(
$asi
);
}
#
# 7 no successor case
#
ok
(
scalar
(
@$succ_asis
)
==
0
);
sub
_print_asi
{
my
$asi
=
shift
;
debug
(
"
stable id:
"
.
$asi
->
stable_id
()
.
"
\n
version:
"
.
$asi
->
version
()
.
"
\n
type:
"
.
$asi
->
type
()
.
"
\n
dbname:
"
.
$asi
->
db_name
()
.
"
\n
Transcripts
"
.
(
$asi
->
get_all_transcript_archive_ids
()
||
"")
.
"
\n
Translation
"
.
(
$asi
->
get_translation_archive_id
()
||
"")
.
"
\n
Peptide
"
.
(
$asi
->
get_peptide
()
||
"")
.
"
\n
"
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment