-
Simon Potter authored31dc6a38
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
mapper.t 7.82 KiB
## Bioperl Test Harness Script for Modules
##
# CVS Version
# $Id$
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.t'
#-----------------------------------------------------------------------
## perl test harness expects the following output syntax only!
## 1..3
## ok 1 [not ok 1 (if test fails)]
## 2..3
## ok 2 [not ok 2 (if test fails)]
## 3..3
## ok 3 [not ok 3 (if test fails)]
##
## etc. etc. etc. (continue on for each tested function in the .t file)
#-----------------------------------------------------------------------
# This test script heavily edited by ihh@fruitfly.org
## We start with some black magic to print on failure.
BEGIN { $| = 1; print "1..5\n"; # 5 tests total
use vars qw($loaded); }
END { print "not ok 1\n" unless $loaded; }
use lib 't';
$loaded = 1;
# $n_test = 0;
printok();
use Bio::EnsEMBL::Mapper;
# testing the Bio::EnsEMBL::Mapper module
$mapper = Bio::EnsEMBL::Mapper->new( "rawcontig", "virtualcontig" );
load_sgp_dump( $mapper, undef );
# loading done successfully
printok();
# transform a segment entirely within the first rawcontig
test_transform ($mapper,
[627012, 2, 5, -1, "rawcontig"],
["chr1", 2, 5, -1]);
# now a split coord
test_transform ($mapper,
["chr1", 383700, 444000, +1, "virtualcontig"],
[314696, 31917, 31937, -1],
[341, 126, 59773, -1],
[315843, 5332, 5963, +1]);
# now a simple gap
test_transform ($mapper,
["chr1", 273701, 273781, +1, "virtualcontig"],
[627011, 7447, 7507, +1],
["chr1", 273762, 273781, 0]);
# the following subroutine tests that a given source co-ordinate range
# transforms into a given set of destination co-ordinates
#
# args: $src = [$srcid, $srcstart, $srcend, $srcstrand, $srctype]
# @dest = ([$id1, $start1, $end1, $strand1],