NAME

manipulate_wig.pl

A progam to manipulate wiggle files.

SYNOPSIS

manipulate_wig.pl [options] -i <file1.wig> -o <file1.out.wig>

File Options: 
-i --in <file>            Input file. Accepts 'stdin'.
-o --out <file>           Output file. Accepts 'stdout'.

Selection functions:
-k --skip <regex>         Skip lines where chromosomes match regex 
-y --apply <regex>        Only apply manipulations to matching chromosomes 

Manipulation functions:
-u --null                 Convert null, NA, N/A, NaN, inf values to 0
-d --delog [2|10]         Delog values of given base 
-a --abs                  Convert to the absolute value 
-m --mult <float>         Multiply score by the given value
-a --add <float>          Add the given value to the score
-l --log [2|10]           Convert to log2 or log10. 
-n --min <float>          Set the minimum score
-x --max <float>          Set the maximum score
-p --place <int>          Format score to decimal positions
-z --zero                 Discard lines with zero values

General functions:
-t --stats                Calculate statistics 
-v --version              print version and exit
-h --help                 show extended documentation

OPTIONS

The command line flags and descriptions:

File options

--in <file>

Specify the input wig file. All three formats, variableStep, fixedStep, and bedGraph, are supported. Files may be gzipped. Alternatively, the input may be read from standard input by specifying 'stdin' as the file name. For bigWig files, you may use a pipe as shown below

bigWigToWig file1.bw stdout | manipulate_wig.pl -i stdin 
--out <file>

Specify the output wig file. The output format will be the same format as the input. The file may be gzipped by appending .gz to the name. Alternatively, the output may be sent to standard output by specifying 'stdout' as the file name. For writing to bigWig files, use a pipe as show below

manipulate_wig.pl -o stdout | wigToBigWig stdin chroms.txt file.bw

Selection functions

--skip <regex>

Selectively skip (discard) lines corresponding to certain chromosomes that match the provided regular expression. For example, skip the mitochondrial and random contigs, use "chrM|chrUn|random".

--apply <regex>

Selectively apply manipulation functions to certain chromosomes that match provided regular expression, leaving remaining lines untouched. For example, to apply a normalization to the X chromosome, use 'chrX'.

Manipulation functions

--null

Convert lines with a score of null, NA, N/A, NaN, or inf to a value of 0.

--delog [2|10]

Convert lines from log space in the indicated base.

--abs

Convert line scores to absolute values.

--mult <float>

Multiply line scores by the indicated value.

--add <float>

Add the indicated value to each line score.

--log [2|10]

Convert the line score to a log equivalent in the indicated base space.

--min <float>

Set the minimum floor score. Any score below the indicated value will be set to the indicated value.

--max <float>

Set the maximum ceiling score. Any score above the indicated value will be set to the indicated value.

--place <integer>

Format the score value to the indicated number of decimal positions.

--zero

Discard lines with a score value of zero.

General functions

--stats

Calculate the statistics across the genome at base pair resolution. Statistics are calculated after any processing indicated above are performed. Only applied chromosomes are calculated. Results are printed to STDOUT, or STDERR if standard out is used as an output.

--version

Print the version number of the program and exit.

--help

Display the POD documentation using perldoc.

DESCRIPTION

A program to manipulate the score value of wig files. This will process all forms of text based wig files, including fixedStep, variableStep, and bedGraph. Files can be gzipped.

NOTE: More than one option may be specified! The options above are the order in which the score is manipulated. If they are not in the order you want, you may have to pipe to sequential instances. Use 'stdin' and 'stdout' for filenames. Use an equal sign to define options with negative values, e.g. --mult=-1

AUTHOR

Timothy J. Parnell, PhD
Dept of Oncological Sciences
Huntsman Cancer Institute
University of Utah
Salt Lake City, UT, 84112

This package is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.