Skip to content
Snippets Groups Projects
Commit 5b4a4053 authored by Ewan Birney's avatar Ewan Birney
Browse files

updates to Mapper. Now looks more sensible wrt API. Works for alignment mapping at least

parent 8740f32d
No related branches found
No related tags found
No related merge requests found
......@@ -194,6 +194,7 @@ sub fetch_by_dbID {
return $gene;
}
=head2 fetch_by_stable_id
Title : fetch_by_stable_id
......@@ -244,12 +245,13 @@ sub fetch_by_contig_list{
$str =~ s/\,$//g;
$str = "($str)";
#
# this is non-optimised, because we are going to make multiple
# trips to the database. should fix here
#
my $sth = $self->prepare("select distinct(t.gene_id) from transcript t,exon_transcript et,exon e,contig c where c.id in $str and c.internal_id = e.contig and et.exon_id = e.exon_id and et.transcript_id = t.transcript_id");
my $sth = $self->prepare("select distinct(t.gene_id) from transcript t,exon_transcript et,exon e,contig c where c.id in $str and c.internal_id = e.contig_id and et.exon_id = e.exon_id and et.transcript_id = t.transcript_id");
$sth->execute;
my @out;
......
......@@ -67,11 +67,15 @@ use Bio::EnsEMBL::Mapper::Gap;
sub new {
my($class,@args) = @_;
my $to = shift @args;
my $from = shift @args;
my $to = shift @args;
my $self = {};
bless $self,$class;
if( !defined $to ) {
$self->throw("Must supply from and to tags");
}
$self->{'_pair_hash_to'} = {};
$self->{'_pair_hash_from'} = {};
......@@ -239,6 +243,10 @@ sub map_coordinates{
sub add_map_coordinates{
my ($self,$contig_start,$contig_end,$contig_id,$chr_start,$chr_end,$chr_name,$contig_ori) = @_;
if( !defined $contig_ori ) {
$self->throw("Need 7 arguments!");
}
if( $contig_start !~ /\d+/ || $chr_start !~ /\d+/ ) {
$self->throw("Not doable - $contig_start as start or $chr_start as start?");
}
......
......@@ -35,7 +35,7 @@ use Bio::EnsEMBL::Mapper;
# testing the Bio::EnsEMBL::Mapper module
$mapper = Bio::EnsEMBL::Mapper->new( "virtualcontig", "rawcontig" );
$mapper = Bio::EnsEMBL::Mapper->new( "rawcontig", "virtualcontig" );
load_sgp_dump( $mapper );
$mapper->_freeze;
......
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