[Bioperl-l] Fasta Qual files

James Gilbert jgrg@sanger.ac.uk
Thu, 14 Sep 2000 14:14:09 +0100 (BST)


On Thu, 14 Sep 2000, Ewan Birney wrote:

> On Thu, 14 Sep 2000, Hilmar Lapp wrote:
> 
> > "Brian A. Desany, Ph.D." wrote:
> > > 
> > > This works great. My question is, does bioperl have the capability of
> > > treating fasta.qual files like this? I tried it on a fasta.qual file and it
> > > definitely did not work! Error message about unrecognized alphabet. It
> > 
> > I have code for reading Phred-produced seq/qual pairs of FASTA-formatted
> > files into Bio::QualSeq objects, which are merely Bio::Seq objects with
> > quality values (being truncated and reversed, too, when you
> > truncate/reverse the seq). The code can also write qual-files.
> > 
> > If you think this is useful for you I'll try to put it to the repository.
> 
> Sounds very useful. Check it in!

Hi,

Sorry if I'm insulting anyone by stating the
obvious.

I have to deal with quality values for the Sanger
submissions.  It is a good trick to store the
quality array in memory as a string of unsigned
chars.  Perl arrays 100k long start consuming a
lot of memory!  To do this you use pack and
unpack:

  my @qual = (40,34,35,99,99);
  my $qual_str = pack('C*', @qual);
  @qual = unpack('C*', $qual_str);

	James

James G.R. Gilbert
The Sanger Centre
Wellcome Trust Genome Campus
Hinxton
Cambridge                        Tel: 01223 494906
CB10 1SA                         Fax: 01223 494919