3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
23 Please email comments or questions to the
public Ensembl
24 developers list at <http:
26 Questions may also be sent to the Ensembl help desk at
31 Juguang Xiao <juguang@tll.org.sg>
49 package Bio::EnsEMBL::Utils::Converter::bio_ens_seqFeature;
62 unless($in && defined($in) && $in->isa(
'Bio::SeqFeature::Generic')){
63 $self->throw(
"a Bio::SeqFeature::Generic object needed");
67 my $seq_id = $seqFeature->seq_id;
68 unless(defined($seq_id) && $seq_id){
69 $self->warn(
"No seq_id value. EnsEMBL SeqFeature will validate it");
73 # Debated issue here. There are p_value and percent_id in EnsEMBL API and DB
74 # schema, but not in bioperl. If in bioperl there are tags called p_value or
75 # percent_id, then the values are passed, otherwise set the default 1.
77 # the problem arise when I try to converter the seqfeature for tmhmm to
79 # -- Juguang, 11 July '03
80 my $score = $in->score || 0;
82 if($in->has_tag(
'percent_id')){
83 ($percent_id) = $in->get_tag_values(
'percent_id');
88 if($in->has_tag(
'p_value')){
89 ($p_value) = $in->get_tag_values(
'p_value');
90 }elsif($in->has_tag(
'evalue')){
91 ($p_value) = $in->get_tag_values(
'evalue');
99 -strand => $in->strand,
101 -analysis => $self->analysis,
102 -source_tag => $in->source_tag,
104 -percent_id => $percent_id,
108 my $output_module = $self->out;
110 if($output_module eq
'Bio::EnsEMBL::SeqFeature'){
113 }elsif($self->out eq
'Bio::EnsEMBL::SimpleFeature'){
115 # The field that there is in SimpleFeature, but not in SeqFeature.
116 $ens_seqFeature->display_label(
'__NONE__');
117 }elsif($self->out eq
'Bio::EnsEMBL::Exon'){
119 $self->contig, $seqFeature->start, $seqFeature->end,
120 $seqFeature->strand);
121 }elsif($self->out eq
'Bio::EnsEMBL::ProteinFeature'){
122 my $seq_id2 = $self->analysis->logic_name;
123 unless(defined $self->translation_id){
124 $self->throw(
'translation_id unset, in ProteinFeature conversion');
126 $args{
'-seqname'} = $self->translation_id;
136 $self->throw(
"[$output_module] as -out, not supported");
139 $ens_seqFeature->attach_seq($self->contig);
140 return $ens_seqFeature;