Commit faa6a31e authored by Steve Trevanion's avatar Steve Trevanion
Browse files

merge from branch-68

parent 9011d3bb
...@@ -344,7 +344,7 @@ sub confirm_params { ...@@ -344,7 +344,7 @@ sub confirm_params {
print "Running script with these parameters:\n\n"; print "Running script with these parameters:\n\n";
print $self->list_all_params; print $self->list_all_params;
if ($self->param('host') eq 'ensdb-1-10') { if ($self->param('host') eq 'ensdb-web-10') {
# ask user if he wants to proceed # ask user if he wants to proceed
exit unless $self->user_proceed("**************\n\n You're working on ensdb-1-10! Is that correct and you want to continue ?\n\n**************"); exit unless $self->user_proceed("**************\n\n You're working on ensdb-1-10! Is that correct and you want to continue ?\n\n**************");
} }
...@@ -367,9 +367,9 @@ sub confirm_params { ...@@ -367,9 +367,9 @@ sub confirm_params {
sub list_all_params { sub list_all_params {
my $self = shift; my $self = shift;
my $txt = sprintf " %-21s%-40s\n", qw(PARAMETER VALUE); my $txt = sprintf " %-21s%-90s\n", qw(PARAMETER VALUE);
$txt .= " " . "-"x71 . "\n"; $txt .= " " . "-"x121 . "\n";
$Text::Wrap::colums = 72; $Text::Wrap::colums = 130;
my @params = $self->allowed_params; my @params = $self->allowed_params;
foreach my $key (@params) { foreach my $key (@params) {
my @vals = $self->param($key); my @vals = $self->param($key);
...@@ -994,18 +994,19 @@ sub get_taxonomy_id { ...@@ -994,18 +994,19 @@ sub get_taxonomy_id {
sub get_species_scientific_name { sub get_species_scientific_name {
my ($self, $dba) = @_; my ($self, $dba) = @_;
$dba ||= $self->dba; $dba ||= $self->dba;
my $sql_tmp = "SELECT meta_value FROM meta WHERE meta_key = \'species.classification\' ORDER BY meta_id"; my $sql = "SELECT meta_value FROM meta WHERE meta_key = \'species.scientific_name\'";
my $sql = $dba->dbc->add_limit_clause($sql_tmp,2);
my $sth = $dba->dbc->db_handle->prepare($sql); my $sth = $dba->dbc->db_handle->prepare($sql);
$sth->execute; $sth->execute;
my @sp; my @sp;
while (my @row = $sth->fetchrow_array) { while (my @row = $sth->fetchrow_array) {
push @sp, $row[0]; push @sp, $row[0];
} }
if (! @sp || @sp > 1) {
$self->throw("Could not retrieve a single species scientific name from database.");
}
$sth->finish; $sth->finish;
my $species = join(" ", reverse @sp); my $species = $sp[0];
$self->throw("Could not determine species scientific name from database.") $species =~ s/ /_/g;
unless $species;
return $species; return $species;
} }
...@@ -1142,6 +1143,9 @@ sub split_chromosomes_by_size { ...@@ -1142,6 +1143,9 @@ sub split_chromosomes_by_size {
$top_slices = $slice_adaptor->fetch_all('chromosome',$cs_version,$include_non_reference,$dup); $top_slices = $slice_adaptor->fetch_all('chromosome',$cs_version,$include_non_reference,$dup);
} }
# filter out patches, if present
$top_slices = [ grep { $_->is_reference or $self->is_haplotype($_,$self->dba) } @$top_slices ];
my ($big_chr, $small_chr, $min_big_chr, $min_small_chr); my ($big_chr, $small_chr, $min_big_chr, $min_small_chr);
foreach my $slice (@{ $top_slices }) { foreach my $slice (@{ $top_slices }) {
next if ($slice->length eq 10000); #hack for chrY pseudoslice next if ($slice->length eq 10000); #hack for chrY pseudoslice
...@@ -1718,7 +1722,7 @@ sub get_unique_genes { ...@@ -1718,7 +1722,7 @@ sub get_unique_genes {
if ( ! $slice->is_reference() and ! $self->is_haplotype($slice,$dba) ) { if ( ! $slice->is_reference() and ! $self->is_haplotype($slice,$dba) ) {
# if ( 0 ) { # if ( 0 ) {
$patch = 1; $patch = 1;
my $slices = $sa->fetch_by_region_unique( $slice->coord_system_name(),$slice->seq_region_name() ); my $slices = $sa->fetch_by_region_unique( $slice->coord_system_name(),$slice->seq_region_name(),undef,undef,undef,$slice->coord_system()->version() );
foreach my $slice ( @{$slices} ) { foreach my $slice ( @{$slices} ) {
push @$genes,@{$ga->fetch_all_by_Slice($slice)}; push @$genes,@{$ga->fetch_all_by_Slice($slice)};
# my $start = $slice->start; # my $start = $slice->start;
......
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