[Bioperl-l] Bio::Seq::SequenceTrace and Bio::SeqIO::scf

Chad Matsalla chad at dieselwurks.com
Tue Jan 28 17:46:40 EST 2003



Greetings,

Some time ago, I trolled for feelings about having an object that models
a sequence trace. The information that would be in this object would
mimic the information available in a scf "Sequence Chromatogram File" as
found on the staden site here:
http://www.mrc-lmb.cam.ac.uk/pubseq/manual/formats_unix_2.html

I have committed a module: Bio::Seq::SequenceTrace that does this. It
inherits from Bio::Seq::SeqWithQuality because that seemed to fit. It
also inherits from Bio::Seq::TraceI which was the starting point in my
development of the methods required.

I have also committed rather thorough tests in t/sequencetrace.t that
illustrate the ways in which I intended for people to use this object.

A primary reason for me to develop this was because I have a need to
take a slice of an SCF and write that as a new SCF. This is achieved
through the use of
Bio::Seq::SequenceTrace->sub_trace_object($start,$end) which can then be
passed into SeqIO::scf->write_seq.

The creation of the SequenceTrace object required that SeqIO::scf be
rewritten.  I gladly did this because the old module was somewhat...
clunky. It now features decoupled procedures and little reliance on the
$self->{} constructs I was fond of at the time.

Here is some example code for reading in an scf, taking a slice of that
scf, and writing it out:

$out_scf = Bio::SeqIO->new('-verbose' => 1,
                  '-file' => ">write_scf_subtrace.scf",
                  '-format' => 'scf');
$in_scf_v3 = Bio::SeqIO->new('-file' => Bio::Root::IO->catfile
                    ("t","data",
                     "version3.scf"),
                    '-format' => 'scf',
                    '-verbose' => $verbose);
$v3 = $in_scf_v3->next_seq();
my $sub_v3 = $v3->sub_trace_object(5,50);
$out_scf->write_seq(
          -target   =>   $sub_v3
);


Here is some sample code for creating a SequenceTrace object with a
SeqWithQuality, asking the SequenceTrace object to synthesize false
traces for that quality, and then writing out the synthetic trace:

$swq = Bio::Seq::SeqWithQuality->new(-seq=>'ATCGATCGAA',
                         -qual=>"10 20 30 40 50 20 10 30 40 50",
                         -alphabet=>'dna');

my $trace = Bio::Seq::SequenceTrace->new(
                         -swq =>   $swq);

$out_scf->write_seq(
               -target   =>   $trace,
               -MACH          =>   'CSM sequence-o-matic 5000',
               -TPSW          =>   'trace processing software',
               -BCSW          =>   'basecalling software',
               -DATF          =>   'AM_Version=2.00',
               -DATN          =>   'a22c.alf',
               -CONV          =>   'Bioperl-scf.pm');


If anybody has any comments, I would of course be glad to hear them. In
the meantime, this system works! I have been using it for about a week
now and it seems to be reliable.

Chad Matsalla



More information about the Bioperl-l mailing list