[Bioperl-l] RE: not all sequence is created equal

Chad Matsalla matsallac@EM.AGR.CA
Fri, 29 Jun 2001 18:54:30 -0400


On Fri, 29 Jun 2001, Chad Matsalla wrote:
> I would  like to work with anyone who cares to implement the next_seq method
> for it.  I don't need it, but, they go together and would make a nice
> submission to BioPerl.  Perhaps Chad Matsala would find this a good
> collab???

Hi!

I just completed an additional module I tentatively called CSM::Phred (no
these names aren't permanent). I wrote CSM::Phred so I could retrieve
arbitrary phred quality values (from the phredfile) for a given read in an acefile. It has a
constructor that takes in either a path to a read or (an acefile AND the
name of a read in the acefile). It then allows easy retrieval of ranges of
quality values from the phredfile. It also provides mechanisms for
reversing and complementing sequences _and_ respective quality values.
(Well ok, just the sequence is complemented :).)

An example of the usage (taken from my t/04test_phred.t) with some stuff omitted:

#!/usr/bin/perl -w
use strict;
use CSM::Phred;

my $o_phred = CSM::Phred->new(  -acefile        =>      $acefile,
                                -readname       =>      $read);
$o_phred->set_reverse_and_complement("on");
my @range1 = @{$o_phred->get_range($start,$end)};
my @bases1 = @{$o_phred->get_base_range($start,$end)};
my @quals1 = @{$o_phred->get_quality_range($start,$end);};


In the case of this script, the range is retrieved working backwards from
the end of the script (because reverse_and_complement is "on"). You can
retrieve juse the bases, just the qualities, or the entire line from the
phredfile:
g 19 55
t 24 64
a 24 72
c 19 81
g 16 96
c 10 103
...

I used a bit of recursion to do the reversing.

Malcom, your code that makes phredfiles and my code that objectifies them
might be really useful together. I hope we can combine them into one
module and put it somewhere logical in the distribution.

I was really boggling in the fact that I couldn't find anything that did
these things. Does anybody know if these kinds of things have already been
done?


Have a good weekend,

Chad Matsalla