[Bioperl-l] Phyloxml SeqI without actual sequence

Chris Fields cjfields at uiuc.edu
Tue Jul 29 13:58:43 EDT 2008


On Jul 29, 2008, at 11:13 AM, Han, Mira wrote:

>
> Another phyloxml parsing question.
> We have <Sequence> tags that sometimes have actual molecular  
> sequences and
> sometimes don't.
> I decided to create a SeqI object and link it to AnnotatableNode.
> But when it doesn't have actual sequence
> It gives warning that the sequence is empty.
> I don't think it's a big problem,
> And I'd prefer having consistency than having two different  
> solutions for
> the same tag.
> But I'd like to hear people's opinion on this as well.
> Thank you
>
> Mira Han


Feasibly, you could have the same AnnotationCollection be used for  
both the AnnotatableNode and the Seq (if present), e.g. if you called  
$node->annotation or $node->seq->annotation you would get the same  
collection.  Under circumstances where no seq data is present you  
wouldn't need to create a blank Seq object; have $node->seq return  
without a Seq and (possibly) issue a warning.

Following through with this line of thought, it might be advantageous  
to set up has_* methods in AnnotatableNode, similar to  
SeqFeatureI::has_tag() for simple boolean tests, where you could do:

if ($node->has_Seq) { # do Seq-related things }
if ($node->has_Align) { # do SimpleAlign-related things }

chris



More information about the Bioperl-l mailing list