Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added display_name() to Bio::DB::GFF::RelSegment

svn path=/bioperl-live/trunk/; revision=6155
  • Loading branch information...
commit 58857b70b52774d31285dc9407ab05c81ce6984c 1 parent 3ca0b44
@lstein lstein authored
View
6 Bio/DB/GFF.pm
@@ -2636,6 +2636,12 @@ sub make_feature {
}
}
+# fix for some broken GFF files
+# unfortunately - has undesired side effects
+# if (defined $tstart && defined $tstop && !defined $strand) {
+# $strand = $tstart <= $tstop ? '+' : '-';
+# }
+
if (ref $parent) { # note that the src sequence is ignored
return Bio::DB::GFF::Feature->new_from_parent($parent,$start,$stop,
$method,$source,
View
4 Bio/DB/GFF/Feature.pm
@@ -929,7 +929,7 @@ sub adjust_bounds {
# fix up our bounds to hold largest subfeature
my($start,$stop,$strand) = $feat->adjust_bounds;
$self->{fstrand} = $strand unless defined $self->{fstrand};
- my ($low,$high) = $start < $stop ? ($start,$stop) : ($stop,$start);
+ my ($low,$high) = $start < $stop ? ($start,$stop) : ($stop,$start);
if ($self->{fstrand} ne '-') {
$self->{start} = $low if !defined($self->{start}) || $low < $self->{start};
$self->{stop} = $high if !defined($self->{stop}) || $high > $self->{stop};
@@ -943,7 +943,7 @@ sub adjust_bounds {
next unless $h && $h->isa('Bio::DB::GFF::Homol');
next unless $g && $g->isa('Bio::DB::GFF::Homol');
($start,$stop) = ($h->{start},$h->{stop});
- if ($h->strand >= 0) {
+ if ($start <= $stop) {
$g->{start} = $start if !defined($g->{start}) || $start < $g->{start};
$g->{stop} = $stop if !defined($g->{stop}) || $stop > $g->{stop};
} else {
View
11 Bio/DB/GFF/Segment.pm
@@ -682,10 +682,10 @@ sub primary_id {
}
-=head2 display_id
+=head2 display_name
- Title : display_id
- Usage : $id = $obj->display_id or $obj->display_id($newid);
+ Title : display_name
+ Usage : $id = $obj->display_name or $obj->display_name($newid);
Function: Gets or sets the display id, also known as the common name of
the Seq object.
@@ -705,10 +705,13 @@ sub primary_id {
Returns : A string
Args : None or a new id
+Note, this used to be called display_id(), and this name is preserved for
+backward compatibility. The default is to return the seq_id().
=cut
-sub display_id { shift->seq_id }
+sub display_name { shift->seq_id }
+*display_id = \&display_name;
=head2 accession_number
View
15 Bio/Das/SegmentI.pm
@@ -120,6 +120,21 @@ $VERSION = 1.00;
sub seq_id { shift->throw_not_implemented }
+=head2 display_name
+
+ Title : seq_name
+ Usage : $ref = $s->seq_name
+ Function: return the human-readable name for the landmark
+ Returns : a string
+ Args : none
+ Status : Public
+
+This defaults to the same as seq_id.
+
+=cut
+
+sub display_name { shift->seq_id }
+
=head2 start
Title : start
View
12 Bio/Graphics/Glyph/segments.pm
@@ -79,17 +79,17 @@ sub draw_component {
eval { # protect against data structures that don't implement the target() method.
if ($draw_target && $self->option('ragged_start')){
my $target = $self->feature->hit;
- if ($target->start < $target->end && $target->start < RAGGED_START_FUZZ && $self->{partno} == 0) {
- warn "ragged left";
+ if ($target->start < $target->end && $target->start < RAGGED_START_FUZZ
+ && $self->{partno} == 0) {
$offset = $target->start - 1;
if ($offset > 0) {
- $dna = $target->subseq(1-$offset,0)->seq . $dna;
- $genomic = $self->feature->subseq(1-$offset,0)->seq . $genomic;
+ $dna = $target->subseq(1-$offset,0)->seq . $dna;
+ $genomic = $self->feature->subseq(1-$offset,0)->seq . $genomic;
$x1 -= $offset * $self->scale;
}
}
- elsif ($target->end < $target->start && $target->end < RAGGED_START_FUZZ && $self->{partno} == $self->{total_parts}) {
- warn "ragged right";
+ elsif ($target->end < $target->start &&
+ $target->end < RAGGED_START_FUZZ && $self->{partno} == $self->{total_parts}) {
$offset = $target->end - 1;
if ($offset > 0) {
$dna .= $target->factory->get_dna($target,$offset,1);
Please sign in to comment.
Something went wrong with that request. Please try again.