[Bioperl-l] Announce: Bio::Seq::Quality
heikki at ebi.ac.uk
Thu Jul 14 11:19:56 EDT 2005
The way I wrote Bio::Seq::Meta modules is that you can set meta sets and
sequence completely independently and everything is stored within the object,
but only that part of the meta arrays are rerurned that have residues.
I tried this out now and realised that it does not work for padding the
$s = new Bio::Seq::Quality(-qual=> "6 6 7")
$s->qual(); # returns 
$s->qual_text(); # returns ''
$qual_text(); # should return '6 6 7 0' but returns '6 6 7';
I have to tweak the code now. So, what do you think? Is the automatic padding
a good or bad thing? Should I get rid of it or make sure it works as I
In other words, do you think it is better to let users make their own mistakes
and offer ways to check for inconsistencies, or offer a "padded" fool proof
system? (If this fool gets it right in the first place.)
On Thursday 14 July 2005 10:53, Marc Logghe wrote:
> Hi Heikki,
> > I've left Bio::Seq::PrimaryQual for the next rewrite. Its
> > functionality is all in the Quality class (get and set id and
> > quality values), but you can not get the quality values from
> > a Bio::Seq::Quality object if you do not have the sequence
> > set. Usually qualities without residues do not make such
> > sense, but there is something in Bio::Assembly code or at
> > least in its tests that need plain qualities.
> > > The greatest difference to Bio::Seq::SeqWithQuality is
> > that in this
> > > implementation quality for all sequence residues are automatically
> > > assigned a value of '0' (zero) unless you set it to something
> > > else. Length of the quality array always equals the length of the
> > > sequence. Therefore, length() never returns "DIFFERENT".
> When these to extracts of your mail are considered, am I correct in
> thinking that the lengths of the sequence and quality array only are
> identical when you pass a sequence in the construcor together with the
> quality string ? But in all the other cases, how can one be sure that
> the lengths are equal ?
> E.g. you can first create the Bio::Seq::Quality object passing it the
> quality and assign the sequence afterwards by calling $qual->seq($seq).
> As you indicated, it is even possible not to set the sequence, so seq
> length is zero while the quality is not.
> Does it mean a user should check the lengths explicitely ?
> BTW I am currently editing Bio::Assembly::IO::ace so that it also parses
> CAP3 generated ACE files. You think it is OK also to set the contig
> sequence for the quality object, e.g. not leaving the seq attribute
> empty. I'll check the Bio::Assembly code why plain quality is needed to
> pass the tests.
______ _/ _/_____________________________________________________
_/ _/ http://www.ebi.ac.uk/mutations/
_/ _/ _/ Heikki Lehvaslaiho heikki at_ebi _ac _uk
_/_/_/_/_/ EMBL Outstation, European Bioinformatics Institute
_/ _/ _/ Wellcome Trust Genome Campus, Hinxton
_/ _/ _/ Cambridge, CB10 1SD, United Kingdom
_/ Phone: +44 (0)1223 494 644 FAX: +44 (0)1223 494 468
More information about the Bioperl-l