[Bioperl-l] drawing a quality trace on a panel?

Smithies, Russell Russell.Smithies at agresearch.co.nz
Wed Oct 15 03:28:23 UTC 2008


Hi all,
I'm writing a contig viewer and want to add a trace of quality trace
data.
I can get the values OK but how do I draw these on a panel with the
xyplot glyph?
Any ideas?


Here's some example code:
(sorry if Outlook will screws up the formatting)

=====================================
my $parser = new Bio::Assembly::IO(-file   => $infile ,-format => "ace")
or die $!;

# just work on the first contig
my ($contig) = $parser->next_assembly->all_contigs;

my $consensus = $contig->get_consensus_sequence();

my @quality_values  = @{$contig->get_consensus_quality()->qual()};

#create panel
my $panel = Bio::Graphics::Panel->new(
	                              	-length   => $consensus->length,
	                              	-width    => gdSmallFont->width
* 1.5 * $consensus->length,
				-bgcolor  => 'white',
				-grid => 1,
				-pad_left=> 20,
				-pad_right=> 20,
				);

# add a scale
$panel->add_track('arrow' => Bio::Graphics::Feature->new(
						      	-start =>
$consensus->start,
						    	-end   =>
$consensus->end ),
							-bump   => 0,
							-double => 1,
							-tick   => 2,
						      	);

my $consensus_feature = Bio::SeqFeature::Generic->new(
							-start =>
$consensus->start,
							-end   =>
$consensus->end,
							-strand=>
$consensus->strand,
							-display_name =>
$consensus->display_name,
							);

my $consensus_seq = Bio::PrimarySeq->new( -seq => $consensus->seq);
$consensus_feature->attach_seq($consensus_seq);
$panel->add_track( $consensus_feature,
					-glyph => 'segments' ,
					-height => 10,
					-label  => 1, 
					-draw_dna  => 1,
					-bgcolor  => "white", 
					-fgcolor => "silver"
					);

# somehow get the array of quality_values into an xyplot?


#other code to draw rest of the reads

# output
print $panel->png;

=======================================
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================




More information about the Bioperl-l mailing list