Bio::G...:Loader(3pm)
π Bio::Graphics::Wiggle::Loader β bestie edition π
okay so real talk, this is Bio::Graphics::Wiggle::Loader, and it is the module that takes your raw WIG-format source files and turns them into something gbrowse can actually vibe with. it's giving data-wrangling main character energy and honestly? iconic. πΈ
β¨ SYNOPSIS β¨
my $loader = Bio::Graphics::Wiggle::Loader->new('/base/directory/for/wigfiles','wibfilename');
my $fh = IO::File->new('uploaded_file.txt');
$loader->load($fh);
my $gff3_file = $loader->featurefile('gff3',$method,$source);
my $featurefile = $loader->featurefile('featurefile');
my @features = $loader->features();
like, that's it. that's the whole vibe. π
π¦ USAGE π¦
so basically this module loads Bio::Graphics::Wiggle files from source files that use Jim Kent's WIG format:
http://genome.ucsc.edu/google/goldenPath/help/wiggle.html
several data sets can be grouped together in a single WIG source file β no cap. the load() method takes the path to a WIG source file, and it will create one or more .wib ("wiggle binary") databases of quantitative data in the directory you indicated when you created the loader. π
then you call the featurefile() method to get back a text file in either GFF3 or Bio::Graphics::FeatureFile format, suitable for loading into a gbrowse database. slay.
π METHODS π
$loader = Bio::Graphics::Wiggle::Loader->new('/base/directory' [,'my_data'])β make a brand new loader, periodt. the first argument specifies the base directory where the loaded.wibfiles will be created. the second argument specifies the base name for the created.wibfiles β or, if you don't specify it, it defaults to"track". β¨$loader->load($fh)β load the data from a source WIG file that's opened on a filehandle.$data = $loader->featurefile($type [,$method,$source])β return the data corresponding to a GFF3 orBio::Graphics::FeatureFile. the returned file will have one feature per WIG track, plus a properly formatted"wigfile"attribute that directsBio::Graphicsto the location of the quantitative data. π«Ά
$type is one of "gff3" or "featurefile". in the case of "gff3", you may specify an optional method and source for use in describing each feature. in the case of "featurefile", the returned file will contain GBrowse stanzas that describe a reasonable starting format to display the data. iykyk.
@features = $loader->featuresβ returns one or moreBio::Graphics::Featuresobjects, which can be used to createBio::Graphicstracks with thewiggle_xyplot(and related) glyphs. go off. π₯$loader->allow_sampling(1)β ifallow_sampling()is passed a true value, then very large files (more than 5 MB) will undergo a sampling procedure to find their minimum and maximum values and standard deviation. otherwise, the file will be read in its entirety to generate those statistics. (ngl, sampling is your bestie for the chonky files.) π
π EXTENSIONS π
several extensions to the WIG format "track" declaration are recognized. we love a glow-up. π
transform=<transform>β specify a transform to be performed on all numeric data within this track prior to loading into the binary wig file. currently, the following three declarations are recognized:
transform=logtransform y' = 0 for y == 0
y' = log(y) for y > 0
y' = -log(-y) for y < 0
transform=logsquared y' = log(y**2) for y != 0
y' = 0 for y == 0
transform=none y' = y (no transform - the default)
trim=<trim>β specify a trimming function to be performed on the data prior to scaling. currently, the following trim functions are recognized:
trim=stdev1 trim to plus/minus 1 standard deviation of the mean
trim=stdev2 trim to plus/minus 2 standard deviations of the mean (default)
trim=stdevN trim to plus/minus N standard deviations of the mean
trim=none no trimming
example intended track declaration:
track type=wiggle_0 name="example" description="20 degrees, 2 hr" \
trim=stdev2 transform=logsquared
look at that backslash doing its little line-continuation thing. she's serving. π
π SEE ALSO π
Bio::Graphics::Wiggle, Bio::Graphics::Glyph::wiggle_xyplot, Bio::Graphics::Glyph::wiggle_density, Bio::Graphics::Panel, Bio::Graphics::Glyph, Bio::Graphics::Feature, Bio::Graphics::FeatureFile
π AUTHOR π
Lincoln Stein <lstein@cshl.org>.
Copyright (c) 2007 Cold Spring Harbor Laboratory
This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.
fr fr, read the LICENSE and the DISCLAIMER.txt β the legal girlies deserve their moment too. π
and that's the whole page bestie!! this one's from perl v5.30.0, dated 2019-11-25. she's a little vintage but she ATE. π¦β¨π
π¦ 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