Commit 136f37d8 authored by Steve Trevanion's avatar Steve Trevanion
Browse files

works with registry

parent 0a6c0daa
...@@ -18,7 +18,7 @@ BEGIN { ...@@ -18,7 +18,7 @@ BEGIN {
unshift(@INC,"$ENV{'ENSEMBL_SERVERROOT'}/bioperl-live"); unshift(@INC,"$ENV{'ENSEMBL_SERVERROOT'}/bioperl-live");
} }
use SiteDefs; #use SiteDefs;
use EnsWeb; use EnsWeb;
use EnsEMBL::DB::Core; use EnsEMBL::DB::Core;
use Getopt::Long; use Getopt::Long;
...@@ -48,27 +48,14 @@ if($help || !$species){ ...@@ -48,27 +48,14 @@ if($help || !$species){
$ENV{'ENSEMBL_SPECIES'} = $species; $ENV{'ENSEMBL_SPECIES'} = $species;
## set db user/pass to allow write access #get the adaptors needed
my $db_ref = $EnsWeb::species_defs->databases; my $slice_adaptor = Bio::EnsEMBL::Registry->get_adaptor($species,"vega","Slice") or die "can't load slice adaptor - is the species name correct?";
$db_ref->{'ENSEMBL_DB'}{'USER'} = $EnsWeb::species_defs->ENSEMBL_WRITE_USER; my $dfa = Bio::EnsEMBL::Registry->get_adaptor($species,"vega","DensityFeature") or die;
$db_ref->{'ENSEMBL_DB'}{'PASS'} = $EnsWeb::species_defs->ENSEMBL_WRITE_PASS; my $dta = Bio::EnsEMBL::Registry->get_adaptor($species,"vega","DensityType") or die;
my $aa = Bio::EnsEMBL::Registry->get_adaptor($species,"vega","Analysis") or die;
## connect to databases
my $databases = &EnsEMBL::DB::Core::get_databases(qw(core));
my $db = $databases->{'core'};
die "Problem connecting to databases: $databases->{'error'}\n"
if $databases->{'error'} ;
warn "Database error: $databases->{'non_fatal_error'}\n"
if $databases->{'non_fatal_error'};
# ## set db user/pass to allow write access
# Get the adaptors needed; $EnsWeb::species_defs->set_write_access('ENSEMBL_DB',$species);
#
my $slice_adaptor = $db->get_SliceAdaptor();
my $dfa = $db->get_DensityFeatureAdaptor();
my $dta = $db->get_DensityTypeAdaptor();
my $aa = $db->get_AnalysisAdaptor();
my $top_slices = $slice_adaptor->fetch_all( "toplevel" ); my $top_slices = $slice_adaptor->fetch_all( "toplevel" );
......
...@@ -49,27 +49,14 @@ if($help || !$species){ ...@@ -49,27 +49,14 @@ if($help || !$species){
$ENV{'ENSEMBL_SPECIES'} = $species; $ENV{'ENSEMBL_SPECIES'} = $species;
## set db user/pass to allow write access #get the adaptors needed
my $db_ref = $EnsWeb::species_defs->databases; my $slice_adaptor = Bio::EnsEMBL::Registry->get_adaptor($species,"vega","Slice") or die "can't load slice adaptor - is the species name correct?";
$db_ref->{'ENSEMBL_DB'}{'USER'} = $EnsWeb::species_defs->ENSEMBL_WRITE_USER; my $dfa = Bio::EnsEMBL::Registry->get_adaptor($species,"vega","DensityFeature") or die;
$db_ref->{'ENSEMBL_DB'}{'PASS'} = $EnsWeb::species_defs->ENSEMBL_WRITE_PASS; my $dta = Bio::EnsEMBL::Registry->get_adaptor($species,"vega","DensityType") or die;
my $aa = Bio::EnsEMBL::Registry->get_adaptor($species,"vega","Analysis") or die;
## connect to databases
my $databases = &EnsEMBL::DB::Core::get_databases(qw(core));
my $db = $databases->{'core'};
die "Problem connecting to databases: $databases->{'error'}\n"
if $databases->{'error'} ;
warn "Database error: $databases->{'non_fatal_error'}\n"
if $databases->{'non_fatal_error'};
# ## set db user/pass to allow write access
# Get the adaptors needed; $EnsWeb::species_defs->set_write_access('ENSEMBL_DB',$species);
#
my $slice_adaptor = $db->get_SliceAdaptor();
my $dfa = $db->get_DensityFeatureAdaptor();
my $dta = $db->get_DensityTypeAdaptor();
my $aa = $db->get_AnalysisAdaptor();
my $top_slices = $slice_adaptor->fetch_all( "toplevel" ); my $top_slices = $slice_adaptor->fetch_all( "toplevel" );
my $big_chr = []; my $big_chr = [];
...@@ -144,7 +131,7 @@ foreach my $object ($big_chr, $small_chr) { ...@@ -144,7 +131,7 @@ foreach my $object ($big_chr, $small_chr) {
my $this_block_size = $current_end - $current_start + 1; my $this_block_size = $current_end - $current_start + 1;
my $sub_slice = $slice->sub_Slice( $current_start, $current_end ); my $sub_slice = $slice->sub_Slice( $current_start, $current_end );
warn "start = $current_start, end = $current_end\n"; warn "start = $current_start, end = $current_end\n";
my $rr = Bio::EnsEMBL::Mapper::RangeRegistry->new(); my $rr = Bio::EnsEMBL::Mapper::RangeRegistry->new() or die;
foreach my $repeat (@{$sub_slice->get_all_RepeatFeatures()}){ foreach my $repeat (@{$sub_slice->get_all_RepeatFeatures()}){
$rr->check_and_register("1",$repeat->start,$repeat->end); $rr->check_and_register("1",$repeat->start,$repeat->end);
} }
......
Markdown is supported
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