[Bioperl-l] names/id in multi-alignment files

Jason Stajich jason.stajich at duke.edu
Thu Sep 23 07:27:45 EDT 2004


On Sep 22, 2004, at 10:29 PM, Marco Landwehr wrote:

> Hi,
> when reading in s multi alignment file of the fasta format:
>
> #read in alignment
> $str = Bio::AlignIO->new('-file' => $filename);	
> $aln = $str->next_aln();
>
> I cannot extract the "header" name or id with:
>

See the API doc for help on what methods you could do, perldoc 
Bio::SimpleAlign to see what you can do with the $aln object.

foreach my $seq ($aln->each_seq ) {
   print $seq->display_id, "\n";
}

> foreach $seq ($aln->id()){
> 	print $seq,"\n";
> }
>
> Is there a way to do this?
> When using:
>
> #alternative way to read all sequences from multi fasta file
> @seq_object_array = read_all_sequences($filename,'fasta');
>
> I can get the name of a specific sequence with:
> $seq_object_array[$i]
>
> but I dont want to read in the sequences both ways...
>
> Thanks for you help...
>
> Marco
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/



More information about the Bioperl-l mailing list