[Bioperl-l] SCF get_header stopped working

samkalat at sneakrets.com samkalat at sneakrets.com
Thu Oct 28 14:51:29 EDT 2004

(Apologies in advance if this is a duplicate; this is my third time sending the message.  The first was rejected as sent from an unregistered email address, and the second time I'm not so sure what went wrong.)

Hi folks.

I have a couple of scripts that generate PNG graphics from SCF files:
one for looking at traces, and the other for browsing sequence and
quality data (especially for auditing how well our basecalling,
screening, and trimming has performed).  Knowing that people are
likely to lose track of what graphic goes with what chromatogram if
they are left to their own devices, I decided to embed a lot of file
header information directly in the image.

I got this all working and somewhere along the line updated my bioperl
package (without even noticing, as part of a debian system update) and
the scripts broke.  Part of the problem was I was using the
get_trace() function in Bio::SeqIO::scf (I think), which I see now was
deprecated in favor of the SequenceTrace object.  Fair enough, that
was a small fix.

What I cannot seem to repair is that header info, which looks like it
is supposed to work but doesn't.  I get a hash with keys but no
values.  Code looks like so:

my %header = %{$scf_input_file->get_header()};

my $info = $scf_input_file->{'comments'}->{'NAME'}."  ";
$info .= "Nucleotides: ".$header{'bases'}."  ";
if ( $scf_input_file->{'comments'}->{'MACH'} )
       { $info .= "Machine: ".$scf_input_file->{'comments'}->{'MACH'}."  ";}
if ( $scf_input_file->{'comments'}->{'SIGN'} )
       { $info .= "Signal strength:
".$scf_input_file->{'comments'}->{'SIGN'}."  ";}

$info = "SCF version: ".$header{'version'}."  ";
if ( $scf_input_file->{'comments'}->{'CONV'} )
       { $info .= "Converted by:
".$scf_input_file->{'comments'}->{'CONV'}."  ";}
if ( $scf_input_file->{'comments'}->{'BCSW'} )
       { $info .= "Base called by:
".$scf_input_file->{'comments'}->{'BCSW'}."  ";}
if ( $scf_input_file->{'comments'}->{'DYEP'} )
       { $info .= "Dye: ".$scf_input_file->{'comments'}->{'DYEP'}."  ";}
if ( $scf_input_file->{'comments'}->{'LANE'} )
       { $info .= "Lane: ".$scf_input_file->{'comments'}->{'LANE'}."  ";}


Is there a different, preferred way of extracting this kind of
information from an SCF file?  I don't know specifically which fields
are likely to be important in the long run, but I figure the more, the

Sam Kalat


More information about the Bioperl-l mailing list