Bio::G...togram(3pm)
πΈ Bio::G...togram(3pm) β the User Contributed Perl Documentation glow-up πΈ
okay bestie, sit down, hydrate, because this one is genuinely adorable: it's the manual page for Bio::Graphics::Pictogram, a Perl module that makes SVG pictures of consensus motifs. Yes, like those little letter-stack sequence logos. It's giving bioinformatics but make it β¨aestheticβ¨.
π NAME π
Bio::Graphics::Pictogram β it generates SVG output of a Pictogram display for consensus motifs. that's the whole job. she's focused. π
π¦ SYNOPSIS π¦
the classic "here's how you'd actually use it" moment:
use Bio::Graphics::Pictogram;
use Bio::SeqIO;
my $sio = Bio::SeqIO->new(-file=>$ARGV[0],-format=>'fasta');
my @seq;
while(my $seq = $sio->next_seq){
push @seq, $seq;
}
my $picto = Bio::Graphics::Pictogram->new(-width=>"800",
-height=>"500",
-fontsize=>"60",
-plot_bits=>1,
-background=>{
'A'=>0.25,
'C'=>0.18,
'T'=>0.32,
'G'=>0.25},
-color=>{'A'=>'red',
'G'=>'blue',
'C'=>'green',
'T'=>'magenta'});
my $svg = $picto->make_svg(\@seq);
print $svg->xmlify."\n";
#Support for Bio::Matrix::PSM::SiteMatrix now included
use Bio::Matrix::PSM::IO;
my $picto = Bio::Graphics::Pictogram->new(-width=>"800",
-height=>"500",
-fontsize=>"60",
-plot_bits=>1,
-background=>{
'A'=>0.25,
'C'=>0.18,
'T'=>0.32,
'G'=>0.25},
-color=>{'A'=>'red',
'G'=>'blue',
'C'=>'green',
'T'=>'magenta'});
my $psm = $psmIO->next_psm;
my $svg = $picto->make_svg($psm);
print $svg->xmlify;
π yes, Bio::Matrix::PSM::SiteMatrix support is in there now. we love a glow-up era.
π DESCRIPTION π
so, what does this module actually do? It generates SVG output for a Pictogram display of consensus motifs. This style of representation was described by Burge and colleagues β specifically (Burge, C.B., Tuschl, T., Sharp, P.A. in The RNA world II, 525-560, CSHL press, 1999). cite your sources, periodt. π
It's a simple module that takes in an array of sequences (assuming they're equal lengths) and calculates relative base frequencies, where the height of each letter reflects the frequency of each nucleotide at a given position. It can also plot the information content at each position, scaled by the background frequencies of each nucleotide. main character behaviour fr fr. π
It needs the SVG-2.26 or later module by Ronan Oger, available at http://www.cpan.org. don't skip the prerequisites bestie, they WILL come for you. π
For viewing the SVG, the recommended option is the plugin available at Adobe: http://www.adobe.com/svg. iconic viewing experience, no notes. β¨
π«Ά FEEDBACK π«Ά
π Mailing Lists π
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated β genuinely, they mean it, come hang out. π₯Ή
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π Reporting Bugs π
Report bugs to the Bioperl bug tracking system to help them keep track of the bugs and their resolution. Bug reports can be submitted via the web:
http://bugzilla.open-bio.org/
bestie if you find a bug, please actually report it instead of just posting "it's giving broken" in the group chat. they can't fix what they can't see. π
π AUTHOR - Shawn Hoon π
Email shawnh@fugu-sg.org
β APPENDIX β
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ β iykyk, if it starts with an underscore, mind your business (or don't, we're not the cops). π
π§ new π§
- Title:
new - Usage:
my $picto = Bio::Graphics::Pictogram->new(-width=>"800",
-height=>"500",
-fontsize=>"60",
-plot_bits=>1,
-background=>{
'A'=>0.25,
'C'=>0.18,
'T'=>0.32,
'G'=>0.25},
-color=>{'A'=>'red',
'G'=>'blue',
'C'=>'green',
'T'=>'magenta'});
- Function: Constructor for Pictogram Object π±
- Returns:
L<Bio::Graphics::Pictogram>
it's the constructor. it constructs. she's born. π
π¦ make_svg π¦
- Title:
make_svg - Usage:
$picto->make_svg(); - Function: make the SVG object π¨
- Returns:
L<SVG> - Arguments: A fasta file or array ref of
L<Bio::Seq>objects or aL<Bio::Matrix::PSM::SiteMatrixI>
this is the one that actually pops off and hands you your SVG. π₯
πΈ fontsize πΈ
- Title:
fontsize - Usage:
$picto->fontsize(); - Function: get/set for fontsize
- Returns: int
- Arguments: int
big letters, small letters, your call bestie. β¨
π color π
- Title:
color - Usage:
$picto->color(); - Function: get/set for color
- Returns: a hash reference
- Arguments: a hash reference
get it? set it? it's a hash ref. slay. π
π svg_obj π
- Title:
svg_obj - Usage:
$picto->svg_obj(); - Function: get/set for svg_obj
- Returns:
L<SVG> - Arguments:
L<SVG>
the SVG object itself, gettable and settable, as is the way. π«Ά
β plot_bits β
- Title:
plot_bits - Usage:
$picto->plot_bits(); - Function: get/set for plot_bits to indicate whether to plot information content at each base position
- Returns:
1/0 - Arguments:
1/0
1 = yes plot the information content at each base position, 0 = no. binary queen. π
π normalize π
- Title:
normalize - Usage:
$picto->normalize($newval) - Function: get/set to make all columns the same height. default is to scale height with information content.
- Returns: value of
normalize(a scalar) - Args: on set, new value (a scalar or undef, optional)
ngl this one's lowkey important: by default the heights scale with information content, but flip this on and every column is the same height. two very different vibes, pick your fighter. π
π background π
- Title:
background - Usage:
$picto->background(); - Function: get/set for hash reference of nucleodtide bgd frequencies
- Returns: hash reference
- Arguments: hash reference
(and yes, that's spelled nucleodtide in the original β we don't fix, we preserve. π«‘) background nucleotide frequencies, as a hash ref. πΈ
π§ pwm π§
- Title:
pwm - Usage:
$picto->pwm(); - Function: get/set for pwm
- Returns: int
- Arguments: int
position weight matrix, get it, set it, int in, int out. short and sweet, we love her. π
and that's the whole page bestie!! no cap, you now know everything this module wants you to know. π β¨
sign-off time: this was perl v5.30.0, dated 2019-11-25, and it came to you courtesy of the good people at Bio::G...togram(3pm). go make some beautiful little letter stacks. π¦πΈπ
π¦ where this page comes from
- debian bookworm: libbio-graphics-perl 2.40-6 Β· Perl
- debian trixie: libbio-graphics-perl 2.40-6 Β· Perl
- ubuntu jammy: libbio-graphics-perl 2.40-6 Β· Perl
- ubuntu noble: libbio-graphics-perl 2.40-6 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms