NAME

ranges - Compute ranges from list of chromosome start/stop coordinates

SYNOPSIS

ranges [file_name.txt]

DESCRIPTION

Given a file of exons like this where col1 is chromosome name col2 is orientation and rest are start and stop.

 Contig0 + 127874 130761 
 Contig0 + 129936 129984 
 Contig0 + 130573 130607 
 Contig0 + 130630 130761 
 Contig0 + 130732 130767 
 Contig0 + 130784 130818 
 Contig0 + 130832 130866 
 Contig0 + 130832 130867 
 Contig0 + 130893 130928 
 Contig0 + 130970 131004 
 Contig0 + 130982 131017 

Compute ranges from overlapping coordinates pairs. Take the smallest start position and largest stop position from overlapping coordinates. If no overlap for a pair, report as it is.

The result for the example block will be:

 Contig0 + 127874 130767 
 Contig0 + 130784 130818 
 Contig0 + 130832 130867 
 Contig0 + 130893 130928 
 Contig0 + 130970 131017 

OPTIONS

There are no runtime options.

DIAGNOSTICS

I/O ERRORS

"Unable to open infile:..."
Verify input file path is specified on command line.
Verify read permission for file and directory.
"Unable to close infile:..."

Probable hardware error. Record exact message and contact computer maintainence personel.

INPUT FILE ERRORS

"Input exons out of order for chromosome $chrom\n"

Preprocess "EXAMPLES" input with range_sort.pl

EXAMPLES

Process the default infile test.bed.txt.

perl ranges

Process the file today.txt in the current working directory.

perl ranges today.txt

Process the file today.txt and save the results.

perl ranges today.txt >today_ranges.txt

Process a file that is out of order.

perl range_sort.pl today.txt > tmp.txt

perl ranges tmp.txt > today_ranges.txt

ENVIRONMENT

This program does not use Environment variables.

FILES

This distribution consists of five files;

Program file ranges.pl
Sorting utilit range_sort.pl
This document ranges.html
Original data file test.bed.txt
Default data file test.bed.sorted.txt

CAVEATS

This program assumes that the input file of exons is sorted first by chromosome and then by start. The utility range_sort.pl can be used to sort the data if necessary.

BUGS

There are no known bugs.

RESTRICTIONS

There are no known restrictions.

SEE ALSO

This program was written in response to a post http://perlguru.com/gforum.cgi?post=75594 by oxydeepu in the internet forum perlguru.

AUTHOR

William K. Smith

COPYRIGHT AND LICENSE

 Copyright 2013 by YOUR William K. Smith

            This program is free software; you may redistribute it and/or modify
            it under the same terms as Perl itself.

HISTORY

 ranges v0.0.0 Demo of concept
        v0.1.0 Real input data, documentation