[Bioperl-l] Problems after changing display_id of a sequence in SimpleAlign

Jason Stajich jason at bioperl.org
Mon Mar 23 00:47:21 EDT 2009


It has to do with the way the names are kept to handle the idea that  
there can be multiple sequences with same id (the ID is stored as ID/ 
START-END). So changing the ID means it cannot be found without  
updating the hash with the names.

Currently it is generally easier to remove the sequence and re-add it.  
We can add a rename function I suppose -- there should be a way to do  
it via the $aln object but I don't think that API is currently written.

$aln->remove_seq($seq);
$seq->display_id("1");
$aln->add_seq($seq);


On Mar 20, 2009, at 2:09 PM, albezg wrote:

> Hi all,
> I'm trying to change FASTA header(display_id) for a sequence in an
> alignment(SimpleAlign).
>
> There are no issues when I print it, however when I use AlignIO to  
> write
> the alignment to a FASTA file, it does not work. Is this behavior  
> intended?
>
> Demo code: http://github.com/jhannah/sandbox/tree/master/Bio_AlignIO_bug
>
> The error:
> ------------- EXCEPTION -------------
> MSG: No sequence with name [1/1-11]
> STACK Bio::SimpleAlign::displayname
> /scratch/BioSoftware/bioperl-live/Bio/SimpleAlign.pm:2659
> STACK Bio::AlignIO::fasta::write_aln
> /scratch/BioSoftware/bioperl-live/Bio/AlignIO/fasta.pm:200
> STACK toplevel ./demo.pl:14
> -------------------------------------
>
> Alexandr
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

Jason Stajich
jason at bioperl.org





More information about the Bioperl-l mailing list