Bio::G...:Loader(3pm)

πŸ“¦
version 2.40 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– 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 .wib files will be created. the second argument specifies the base name for the created .wib files β€” 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 or Bio::Graphics::FeatureFile. the returned file will have one feature per WIG track, plus a properly formatted "wigfile" attribute that directs Bio::Graphics to 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 more Bio::Graphics::Features objects, which can be used to create Bio::Graphics tracks with the wiggle_xyplot (and related) glyphs. go off. πŸ”₯
  • $loader->allow_sampling(1) β€” if allow_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