Commit e6864ed3 authored by Daniel Rios's avatar Daniel Rios
Browse files

added 2 new attributes in protein and dna alignFeatures to get the name of the...

added 2 new attributes in protein and dna alignFeatures to get the name of the external database and the displayable name
parent d096124a
......@@ -58,10 +58,14 @@ use Bio::EnsEMBL::Utils::Exception qw(throw warning);
sub _tables {
my $self = shift;
return ['dna_align_feature', 'daf'];
return (['dna_align_feature', 'daf'],['external_db','exdb']);
}
sub _left_join{
return (['external_db',"exdb.external_db_id = daf.external_db_id"]);
}
=head2 _columns
Args : none
......@@ -95,7 +99,9 @@ sub _columns {
daf.score
daf.external_db_id
daf.hcoverage
daf.external_data);
daf.external_data
exdb.db_name
exdb.db_display_name);
}
......@@ -326,13 +332,13 @@ sub _objs_from_sth {
my($dna_align_feature_id, $seq_region_id, $analysis_id, $seq_region_start,
$seq_region_end, $seq_region_strand, $hit_start, $hit_end, $hit_name,
$hit_strand, $cigar_line, $evalue, $perc_ident, $score,
$external_db_id, $hcoverage, $extra_data );
$external_db_id, $hcoverage, $extra_data, $external_db_name, $external_display_db_name );
$sth->bind_columns(
\$dna_align_feature_id, \$seq_region_id, \$analysis_id, \$seq_region_start,
\$seq_region_end, \$seq_region_strand, \$hit_start, \$hit_end, \$hit_name,
\$hit_strand, \$cigar_line, \$evalue, \$perc_ident, \$score,
\$external_db_id, \$hcoverage, \$extra_data );
\$external_db_id, \$hcoverage, \$extra_data, \$external_db_name, \$external_display_db_name );
my $asm_cs;
......@@ -453,6 +459,8 @@ sub _objs_from_sth {
'external_db_id' => $external_db_id,
'hcoverage' => $hcoverage,
'extra_data' => $extra_data ? $self->get_dumped_data($extra_data) : '',
'dbname' => $external_db_name,
'db_display_name' => $external_display_db_name
} ) );
}
......
......@@ -190,13 +190,13 @@ sub _objs_from_sth {
my ($protein_align_feature_id, $seq_region_id, $seq_region_start,
$seq_region_end, $analysis_id, $seq_region_strand, $hit_start,
$hit_end, $hit_name, $cigar_line, $evalue, $perc_ident, $score,
$external_db_id, $hcoverage );
$external_db_id, $hcoverage, $external_db_name, $external_display_db_name );
$sth->bind_columns(\$protein_align_feature_id, \$seq_region_id,
\$seq_region_start,\$seq_region_end, \$analysis_id,
\$seq_region_strand, \$hit_start,\$hit_end, \$hit_name,
\$cigar_line, \$evalue, \$perc_ident, \$score,
\$external_db_id, \$hcoverage );
\$external_db_id, \$hcoverage, \$external_db_name, \$external_display_db_name );
my $asm_cs;
my $cmp_cs;
......@@ -316,7 +316,9 @@ sub _objs_from_sth {
'adaptor' => $self,
'dbID' => $protein_align_feature_id,
'external_db_id' => $external_db_id,
'hcoverage' => $hcoverage
'hcoverage' => $hcoverage,
'dbname' => $external_db_name,
'db_display_name' => $external_display_db_name
} ) );
}
......@@ -329,7 +331,7 @@ sub _objs_from_sth {
sub _tables {
my $self = shift;
return ['protein_align_feature', 'paf'];
return (['protein_align_feature', 'paf'], ['external_db','exdb']);
}
......@@ -351,7 +353,13 @@ sub _columns {
paf.perc_ident
paf.score
paf.external_db_id
paf.hcoverage );
paf.hcoverage
exdb.db_name
exdb.db_display_name);
}
sub _left_join{
return (['external_db',"exdb.external_db_id = paf.external_db_id"]);
}
=head2 list_dbIDs
......
......@@ -119,10 +119,10 @@ sub new {
my $self = $class->SUPER::new(@_);
my ($hstart,$hend,$hstrand,$percent_id,$score, $species, $hspecies,
$p_value, $hseqname, $f1,$f2, $coverage, $hcoverage, $group_id,$level_id, $external_db_id, $extra_data) =
$p_value, $hseqname, $f1,$f2, $coverage, $hcoverage, $group_id,$level_id, $external_db_id, $extra_data, $external_db_name, $external_display_db_name) =
rearrange(['HSTART','HEND','HSTRAND','PERCENT_ID','SCORE','SPECIES',
'HSPECIES', 'P_VALUE', 'HSEQNAME', 'FEATURE1','FEATURE2',
'COVERAGE', 'HCOVERAGE', 'GROUP_ID','LEVEL_ID', 'EXTERNAL_DB_ID', 'EXTRA_DATA'], @_);
'COVERAGE', 'HCOVERAGE', 'GROUP_ID','LEVEL_ID', 'EXTERNAL_DB_ID', 'EXTRA_DATA', 'DBNAME', 'DB_DISPLAY_NAME'], @_);
if(defined($hstart) && defined($hend) && ($hend < $hstart)) {
throw('HSTART must be less than or equal to HEND');
......@@ -147,6 +147,8 @@ sub new {
$self->{'level_id'} = $level_id;
$self->{'external_db_id'} = $external_db_id;
$self->{'extra_data'} = $extra_data;
$self->{'dbname'} = $external_db_name;
$self->{'db_display_name'} = $external_display_db_name;
#
# Feature1 and Feature2 arg handling for backwards compatibility
......@@ -542,6 +544,43 @@ sub external_db_id {
}
=head2 dbname
Arg [1] : string $external_db_name (optional)
Example : $ex_db_name = $fp->dbname();
Description: Getter/Setter for the external_db_name attribute, name of external database
Returntype : string
Exceptions : none
Caller : general
Status : At Risk
=cut
sub db_name {
my $self = shift;
$self->{'dbname'} = shift if(@_);
return $self->{'dbname'};
}
=head2 db_display_name
Arg [1] : string $db_display_name (optional)
Example : $ex_db_display_name = $fp->db_display_name();
Description: Getter/Setter for the db_display_name attribute
The preferred display name for the external database.
Returntype : string
Exceptions : none
Caller : general
Status : At Risk
=cut
sub db_display_name {
my $self = shift;
$self->{'db_display_name'} = shift if(@_);
return $self->{'db_display_name'};
}
=head2 p_value
......
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