[Bioperl-l] How to rename sequences in an alignment and write_alnthem

Chris Fields cjfields at uiuc.edu
Wed Sep 27 20:11:45 UTC 2006


Albert,

You could try something similar to what Bio::SeqIO::fasta does, which is set
preferred_id_type() to display the identifier based on various information,
such as the display ID, accession, etc.  You could add a similar method to
Bio::AlignIO(), then have every write_aln() use that method for determining
what the displayed name in the alignment should be.  

Beyond that, I'm not sure how you would go about making it easier beyond
iterating through the LocatableSeq objects (as you had already tried).

Christopher Fields
Postdoctoral Researcher - Switzer Lab
Dept. of Biochemistry
University of Illinois Urbana-Champaign 

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Albert Vilella
> Sent: Wednesday, September 27, 2006 9:03 AM
> To: Bioperl-l at lists.open-bio.org
> Subject: [Bioperl-l] How to rename sequences in an alignment and
> write_alnthem
> 
> Hi all,
> 
> What is the preferred way to rename the sequence names for a given
> alignment object (Bio::SimpleAlign) so that then one can print out
> (Bio::AlignIO::write_aln) the alignment with the renamed sequences?
> 
> I found out that is a bit complicated to do it right now: the only way
> I managed to do it is to mess with each Bio::LocatableSeq sequence
> object, and adding back the sequences to the alignment.
> 
> Maybe we could change the half a dozen write_aln methods so that one
> can directly get/set the display_names for each sequence, editing the
> $aln instance, instead of going into the LocatableSeq goriness.
> 
> Comments?
> 
> Cheers,
> 
>     Albert.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list