diff --git a/modules/Bio/EnsEMBL/Utils/Converter/bio_ens.pm b/modules/Bio/EnsEMBL/Utils/Converter/bio_ens.pm index 4433302fbd8601d154c3586c99049d062922eb8e..4d4256b68970ee6957637afec6f8123fb088eef6 100644 --- a/modules/Bio/EnsEMBL/Utils/Converter/bio_ens.pm +++ b/modules/Bio/EnsEMBL/Utils/Converter/bio_ens.pm @@ -81,12 +81,14 @@ sub _initialize { my ($dbadaptor, $dbdriver, $dbhost, $dbport, $dbuser, $dbpass, $dbname, $analysis, $analysis_dbid, $analysis_logic_name, - $contig, $contig_dbid, $contig_name) = + $contig, $contig_dbid, $contig_name, + $translation_id) = $self->_rearrange([qw(DBADAPTOR DBDRIVER DBHOST DBPORT DBUSER DBPASS DBNAME ANALYSIS ANALYSIS_DBID ANALYSIS_LOGIC_NAME - CONTIG CONTIG_DBID CONTIG_NAME)], @args); + CONTIG CONTIG_DBID CONTIG_NAME + TRANSLATION_ID)], @args); if(defined $dbadaptor){ diff --git a/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_featurePair.pm b/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_featurePair.pm index 4a23a5be9c218d1d6e735e7c9383c9503a412337..e5641174d0e99970d4e90d697fce6bce99b20200 100644 --- a/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_featurePair.pm +++ b/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_featurePair.pm @@ -56,7 +56,9 @@ use Bio::EnsEMBL::Utils::Converter::bio_ens; sub _initialize { my ($self, @args) = @_; $self->SUPER::_initialize(@args); - + my ($translation_id) = $self->_rearrange([qw(TRANSLATION_ID)], @args); + $self->translation_id($translation_id); + # internal converter for seqFeature $self->{_bio_ens_seqFeature} = new Bio::EnsEMBL::Utils::Converter ( -in => 'Bio::SeqFeature::Generic', @@ -104,6 +106,7 @@ sub _convert_single_to_proteinFeature { -feature1 => $featurePair->feature1, -feature2 => $featurePair->feature2 ); + $proteinFeature->seqname($self->translation_id); return $proteinFeature; } @@ -155,5 +158,10 @@ sub _create_consensus{ return $consensus; } +sub translation_id { + my ($self, $arg) = @_; + return $self->{_translation_id} = $arg if(defined($arg)); + return $self->{_translation_id}; +} 1; diff --git a/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_seqFeature.pm b/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_seqFeature.pm index 2015cc67708fb5d52a66c1495863efc91f458cea..9c0b5b5b60453242fead9405d89b5a8698769ebf 100644 --- a/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_seqFeature.pm +++ b/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_seqFeature.pm @@ -64,16 +64,38 @@ sub _convert_single { $self->warn("No seq_id value. EnsEMBL SeqFeature will validate it"); $seq_id = 'Unknown'; } - + + # Debated issue here. There are p_value and percent_id in EnsEMBL API and DB + # schema, but not in bioperl. If in bioperl there are tags called p_value or + # percent_id, then the values are passed, otherwise set the default 1. + # + # the problem arise when I try to converter the seqfeature for tmhmm to + # EnsEMBL seqFeature. + # -- Juguang, 11 July '03 + my $score = $in->score || 1; + my $percent_id; + if($in->has_tag('percent_id')){ + ($percent_id) = @{$in->get_tag_values('percent_id')}; + }else{ + $percent_id ||= 1; + } + my $p_value; + if($in->has_tag('p_value')){ + ($p_value) = @{$in->get_tag_values('p_value')}; + }else{ + $p_value ||= 1; + } my $ens_seqFeature; my @args = ( -start => $in->start, -end => $in->end, -strand => $in->strand, - -score => $in->score, + -score => $score, -analysis => $self->analysis, -source_tag => $in->source_tag, - -seqname => $seq_id + -seqname => $seq_id, + -percent_id => $percent_id, + -p_value => $p_value ); my $output_module = $self->out;