use
vars
qw($NTESTS $SVG_AVAIL)
;
BEGIN {
if
( $@ ) {
}
$NTESTS
= 3;
plan
tests
=>
$NTESTS
;
eval
{
};
$SVG_AVAIL
= $@ ? 0 : 1;
}
END {
for
(
$Test::ntest
..
$NTESTS
) {
skip(
"Cannot complete Pictogram tests. Skipping. "
,1);
}
}
if
(!
$SVG_AVAIL
){
warn
(
"SVG not installed, skipping tests"
);
exit
;
}
my
$file
= Bio::Root::IO->catfile(
"t"
,
"data"
,
"pictogram.fa"
);
my
$sio
= Bio::SeqIO->new(
-file
=>
$file
,
-format
=>
'fasta'
);
my
@seq
;
while
(
my
$seq
=
$sio
->next_seq){
push
@seq
,
$seq
;
}
my
$picto
= Bio::Graphics::Pictogram->new(
-width
=>
"800"
,
-fontsize
=>
"80"
,
-plot_bits
=>1,
-color
=>{
'A'
=>
'red'
,
'G'
=>
'blue'
,
'C'
=>
'green'
,
'T'
=>
'magenta'
});
ok
$picto
->isa(
"Bio::Graphics::Pictogram"
);
my
$svg
=
$picto
->make_svg(\
@seq
);
ok
$svg
->xmlify;
my
$psmIO
= new Bio::Matrix::PSM::IO(
-format
=>
'meme'
,
-file
=> Bio::Root::IO->catfile(
qw(t data meme.dat)
));
$picto
= Bio::Graphics::Pictogram->new(
-width
=>
"800"
,
-normalize
=>1,
-fontsize
=>
"80"
,
-plot_bits
=>1,
-color
=>{
'A'
=>
'red'
,
'G'
=>
'blue'
,
'C'
=>
'green'
,
'T'
=>
'magenta'
});
my
$psm
=
$psmIO
->next_psm;
$svg
=
$picto
->make_svg(
$psm
);
ok
$svg
->xmlify;