[Bioperl-l] how to determine if SeqFeature is attached to Sequence
Hilmar Lapp
hlapp@gmx.net
Thu, 28 Jun 2001 00:23:57 -0700
I'm not sure what the status here is ... forgive me if that's
since long been settled.
Ewan Birney wrote:
>
> On Wed, 20 Jun 2001, Jason Stajich wrote:
>
> > Ewan's suggestion looks good - couple of other comments after perusing the
> > code:
> >
> > a) Should Bio::LocationI seq_id should return the sequence id of the
> > sequence it is attached to. I know we create locations explicitly
> > with seq_id when parsing a seq file that has a location which
> > refers to another sequence, but should the default return the seq_id
> > for the current seq?
Location::seq_id() should always return the id for the seq it
references (i.e., it sits on).
> >
> > Bio::SeqFeature::attach_seq doesn't touch the location object.
It doesn't, but shouldn't it? If you attach a seq to a feature,
why would you want $feat->location()->seq_id() differ from
$feat->entire_seq()->display_id()?
> >
> > b) seqname doesn't appear to get set when attach_seq is called - should
> > it? This would be a less computational way than testing if
> > entire_seq() or seq() is null....
Well, I'm not sure it's less computational. I actually think
seqname() should get set if you attach a sequence with a valid
name (i.e., display_id()).
>
> seqname can be set with entire_seq being null. I think.
Right.
> > >
> > > Is there a "right way" to ask a SeqFeature if it has been attached to a
> > > Sequence by $Seq->add_SeqFeature?
You'd ask if($seq->entire_seq()) { ... } else { ... }.
Hilmar
--
-----------------------------------------------------------------
Hilmar Lapp email: hilmarl@yahoo.com
GNF, San Diego, Ca. 92122 phone: +1 858 812 1757
-----------------------------------------------------------------