#!/usr/bin/perl # Time-stamp: <2005-12-30 14:09:41 kasper> use warnings; use strict; use Getopt::Long; use constant USAGE =><-OFFSET: into just and adjusts the start and end coordinates according to . OPTIONS: --help Prints this help. EXAMPLES: gffmapback.pl infile.gff outfile.gff cat *.gff | gffbackmap.pl > outfile.gff DEPENDENCIES: None. AUTHOR: Kasper Munch COPYRIGHT: This program is free software. You may copy, modify, and redistribute it under the same terms as Perl itself. END my $help = 0; GetOptions( "help" => \$help, ) or die USAGE; $help and die USAGE; @ARGV = ('-') unless @ARGV; my $input = shift @ARGV; open my $in, "$input" or die "$input: $!\n"; @ARGV = ('>&STDOUT') unless @ARGV; my $output = shift @ARGV; open my $out, ">$output" or die "$output: $!\n"; while (my $gff = <$in>) { chomp $gff; my @gff = split /\t/, $gff; $gff[0] =~ s/-OFFSET:(\d+)//; $gff[3] += $1; $gff[4] += $1; print $out join("\t", @gff), "\n"; } =head1 SYNOPSIS: gffmapback.pl [OPTIONS] [infile [outfile]] =head1 DESCRIPTION: This script converts GFF lines with first entry in the format: -OFFSET: into just and adjusts the start and end coordinates according to . =head1 OPTIONS: =over 4 =item --help Prints this help. =back =head1 EXAMPLES: gffmapback.pl infile.gff outfile.gff cat *.gff | gffbackmap.pl > outfile.gff =head1 DEPENDENCIES: None. =head1 AUTHOR: Kasper Munch =head1 COPYRIGHT: This program is free software. You may copy, modify, and redistribute it under the same terms as Perl itself. =cut