WIGGLE2GFF3(1p)
π WIGGLE2GFF3(1p) β like, the wiggle2gff3.pl manual, bestie edition π
okay so welcome to the User Contributed Perl Documentation corner of the internet, where we're talking about wiggle2gff3.pl, and honestly? she's iconic. this is the little script that takes your UCSC WIG files and turns them into gff3 files. no cap. β¨
πΈ NAME πΈ
wiggle2gff3.pl β converts UCSC WIG format files into gff3 files. that's the whole job. she does it. slay. π
β¨ SYNOPSIS β¨
wiggle2gff3.pl [options] WIG_FILE > load_data.gff3
so basically, this converts UCSC WIG format files into gff3 files that are suitable for loading into GBrowse databases. and what is this for, you ask? it's for high-density quantitative data β think CNV, SNP and expression arrays. the data girlies. ππ¦
π DESCRIPTION π
use this converter when you've got dense quantitative data to display using the xyplot, density, or heatmap glyphs, and way too many data items (like, thousands) to load into GBrowse. she creates one or more space-efficient binary files containing the quantitative data, plus a small GFF3 file that you can load into Chado or other GBrowse databases. two for one. we love an efficient queen. π
typical usage is literally this:
% wiggle2gff3.pl --method=microarray_oligo my_data.wig > my_data.gff3
π Options π
the following options are accepted, and yes, you're gonna want to know all of them:
--method=<method name>β sets the method for the GFF3 lines representing each quantitative data point in the track. the default is"microarray_oligo."π--source=<source>β sets the source field for the GFF3 file. the default is none. (she's mysterious like that.)--gff3β create a GFF3-format file. this is the default, so if you do nothing, congrats, you already did it.--featurefileβ create a"featurefile"format file. this is the simplified format used for GBrowse uploads. π«Ά
heads up bestie: this option is incompatible with the --gff3 option. pick a lane. π
--sampleβ if true, then very large files (>5 MB) will be sampled to obtain minimum, maximum and standard deviation; otherwise the entire file will be scanned to obtain these statistics. this will process the files faster but may miss outlier values. speed vs accuracy, the eternal struggle. β‘--path=<path>β specify the directory in which to place the binary wiggle files. the default is the current temporary directory (/tmpor whatever is appropriate for your operating system). ποΈ--base=<path>β same as"--path". two names, one vibe.--tracknameβ specify the trackname base for the wigfile creation. π΅--helpβ this documentation. hi, you found it. π
this script will accept a variety of option styles, including abbreviated options ("--meth=foo"), single character options ("-m foo"), and other common variants. she's flexible, she's accommodating, she's a people pleaser fr fr. β¨
π¦ Binary wiggle files π¦
the binary "wiggle" files created by this utility are readable using the Bio::Graphics::Wiggle module. the quantitative data is scaled to the range of 1-255 (losing lots of precision, but still more than enough for data visualization), and stored in a packed format in which each file corresponds to the length of a single chromosome or contig. one chromosome, one file. monogamous file structure. π
once created, the binary files should not be moved or renamed, unless you are careful to make corresponding changes to the pathnames given by the "wigfile" attribute in the GFF3 file feature lines. so like, don't just drag them around in your file manager and hope for the best. π
you should also be careful about using the cp command to copy the binary files; they are formatted with "holes" in such a way that missing data does not take up any space on disk. if you cp them, the holes will fill up with zeroes and the space savings will be lost. π
better to use the"tar"command with its--sparseoption to move the files from one place to another. protect the holes, they're doing important work. π³οΈβ¨
π Example WIG File π
this example is from <http://genome.ucsc.edu/goldenPath/help/wiggle.html>:
# filename: example.wig
#
# 300 base wide bar graph, autoScale is on by default == graphing
# limits will dynamically change to always show full range of data
# in viewing window, priority = 20 positions this as the second graph
# Note, zero-relative, half-open coordinate system in use for bed format
track type=wiggle_0 name="Bed Format" description="BED format" \
visibility=full color=200,100,0 altColor=0,100,200 priority=20
chr19 59302000 59302300 -1.0
chr19 59302300 59302600 -0.75
chr19 59302600 59302900 -0.50
chr19 59302900 59303200 -0.25
chr19 59303200 59303500 0.0
chr19 59303500 59303800 0.25
chr19 59303800 59304100 0.50
chr19 59304100 59304400 0.75
chr19 59304400 59304700 1.00
# 150 base wide bar graph at arbitrarily spaced positions,
# threshold line drawn at y=11.76
# autoScale off viewing range set to [0:25]
# priority = 10 positions this as the first graph
# Note, one-relative coordinate system in use for this format
track type=wiggle_0 name="variableStep" description="variableStep format" \
visibility=full autoScale=off viewLimits=0.0:25.0 color=255,200,0 \
yLineMark=11.76 yLineOnOff=on priority=10
variableStep chrom=chr19 span=150
59304701 10.0
59304901 12.5
59305401 15.0
59305601 17.5
59305901 20.0
59306081 17.5
59306301 15.0
59306691 12.5
59307871 10.0
# 200 base wide points graph at every 300 bases, 50 pixel high graph
# autoScale off and viewing range set to [0:1000]
# priority = 30 positions this as the third graph
# Note, one-relative coordinate system in use for this format
track type=wiggle_0 name="fixedStep" description="fixed step" visibility=full \
autoScale=off viewLimits=0:1000 color=0,200,100 maxHeightPixels=100:50:20 \
graphType=points priority=30
fixedStep chrom=chr19 start=59307401 step=300 span=200
1000
900
800
700
600
500
400
300
200
100
you can convert this into a loadable GFF3 file with the following command:
wiggle2gff3.pl --meth=example --so=example --path=/var/gbrowse/db example.wig \
> example.gff3
the output will look like this:
##gff-version 3
chr19 example example 59302001 59304700 . . . Name=Bed Format;wigfile=/var/gbrowse/db/track001.chr19.1199828298.wig
chr19 example example 59304701 59308020 . . . Name=variableStep;wigfile=/var/gbrowse/db/track002.chr19.1199828298.wig
chr19 example example 59307401 59310400 . . . Name=fixedStep;wigfile=/var/gbrowse/db/track003.chr19.1199828298.wig
π PROBLEMS π
ngl, this script has trouble with wig files from very fragmented genomes (that's >100K scaffolds, bestie). in this case, you may wish to run split_wig.pl, which splits the original wig file into a series of smaller files with a maximum of 900 scaffolds each. it then runs wiggle2gff3.pl for each subfile and stores the results in separate folders. divide and conquer, main character energy. πβ¨
π₯ SEE ALSO π₯
Bio::DB::GFF, bp_bulk_load_gff.pl, bp_fast_load_gff.pl, bp_load_gff.pl, bp_seqfeature_load.pl
(the whole load-gff cinematic universe. go read them. iykyk. π)
π AUTHOR π
Lincoln Stein <lstein@cshl.org>.
Copyright (c) 2008 Cold Spring Harbor Laboratory
This package 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. See DISCLAIMER.txt for disclaimers of warranty. π
and that's the whole page, bestie!! π«Ά this was WIGGLE2GFF3(1p), coming at you from perl v5.40.0, dated 2024-10-20. now go convert some wigs and slay. π
πΈβ¨
π¦ where this page comes from
- ubuntu questing: gbrowse 2.56+dfsg-12build4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms