[Bioperl-l] SCF file get_header call

Sam Kalat sam.kalat at gmail.com
Wed Oct 27 10:31:05 EDT 2004


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'}."  ";}
$img->string(gdSmallFont,5,0,$info,$black);

$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'}."  ";}

$img->string(gdSmallFont,5,10,$info,$black);

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
merrier.

Thanks,
Sam Kalat


More information about the Bioperl-l mailing list