+ -
当前位置:首页 → 问答吧 → 请问下面的 return $self->{'_start'};处的_start?谢谢!

请问下面的 return $self->{'_start'};处的_start?谢谢!

时间:2011-03-21

来源:互联网

请问下面的  return $self->{'_start'};处的_start怎么这么方便就表示找到start了???是不是其他地方还有代码表示怎么找出start???谢谢!!

=head2 new()

new() initializes the attributes:
_transcript_array
_transcriptID_array
_start
_end

=cut

sub new {
  my ($class,$whatever)=@_;

  if (ref($class)){
    $class = ref($class);
  }
  my $self = {};
  bless($self,$class);
  
  if ($whatever){
    $self->throw( "Can't pass an object to new() method. Use put_Genes() to include Bio::EnsEMBL::Gene in cluster");
  }

  return $self;
}
#########################################################################

=head1 Range-like methods

Methods start and end are typical for a range. We also implement the boolean
and geometrical methods for a range.

=head2 start()

  Title   : start
  Usage   : $start = $transcript_cluster->end();
  Function: get/set the start of the range covered by the cluster. This is re-calculated and set everytime
            a new transcript is added to the cluster
  Returns : a number
  Args    : optionaly allows the start to be set

=cut

sub start{
  my ($self,$start) = @_;
  if ($start){
    $self->throw( "$start is not an integer") unless $start =~/^[-+]?\d+$/;
    $self->{'_start'} = $start;
  }
  return $self->{'_start'};
}

TranscriptCluster.zip (3.69 KB)

下载次数:3

2011-03-21 18:32

作者: havocor   发布时间: 2011-03-21

那个 $self->{_start} 的值不就是传入 sub start 的参数

作者: zhlong8   发布时间: 2011-03-21