[Bioperl-l] order of sublocations

Marc Logghe Marc.Logghe at devgen.com
Wed Sep 17 07:31:34 EDT 2003


Hi,
I could not find anything back in the 'DDBJ/EMBL/GenBank Feature Table Definition' about this, but apparently applications exist (like e.g. VectorNTI) which are really picky about the order of sublocations in split locations.
 CDS             join(complement(649..>1045),complement(129..218),
                     complement(<1..66))
for instance, is not accepted by vectorNTI. The following is OK:
     CDS             join(complement(<1..66),complement(129..218),
                     complement(649..>1045))
I expect this is more a problem of vectorNTI, rather than BioPerl ;-) but anyhow, this can easily be fixed by sorting the sublocations first:
in Bio::Location::Split
sub to_FTstring  {
    my ($self) = @_;
    my @strs;
    foreach my $loc ( sort { $a->start <=> $b->start } $self->sub_Location() ) { 
#                            ~~~~~~~~~~~~~~~~~~~~~~~  
        my $str = $loc->to_FTstring();
        # we only append the remote seq_id if it hasn't been done already
        # by the sub-location (which it should if it knows it's remote)
        # (and of course only if it's necessary)
        if( (! $loc->is_remote) &&
            defined($self->seq_id) && defined($loc->seq_id) &&
            ($loc->seq_id ne $self->seq_id) ) {
            $str = sprintf("%s:%s", $loc->seq_id, $str);
        } 
        push @strs, $str;
    }    

    my $str = sprintf("%s(%s)",lc $self->splittype, join(",", @strs));
    return $str;
};

Cheers,
Marc



More information about the Bioperl-l mailing list