File: gff2browser.pl

package info (click to toggle)
augustus 3.4.0%2Bdfsg2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 758,480 kB
  • sloc: cpp: 65,451; perl: 21,436; python: 3,927; ansic: 1,240; makefile: 1,032; sh: 189; javascript: 32
file content (52 lines) | stat: -rwxr-xr-x 935 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/perl

use strict;
use warnings;

my $offset=0;
my @output;

if (@ARGV) {
    $offset = shift @ARGV;
}

my $target;
my ($from, $to) = ($offset, $offset+10000);
my $name="AUGUSTUS";

while (<>) {
    chomp;
    my $comment = "";
    if (/^# .* --predictionStart=(\d+) --predictionEnd=(\d+)/) {
	($from, $to) = ($1 + $offset -1000, $2 + $offset +1000);
	$from = 0 if $from < 0;
    }
    if (/^# .* --proteinprofile/) {
	$name .= "-PPX";
    }
    $comment = $1 if s/\s*\#.*$//;
    my @line = split /\t/;
    next unless @line == 9;
    next if $line[2] eq "interblock_region";
    if ($line[8] =~ /ID=([^;]*)/) {
	$line[8]=$1;
    } else {
	next;
    }
    $target = $line[0] unless defined $target;
    push @output,join("\t", @line)."\n";
}

print "browser position $target:$from-$to hide all\n";
print "track offset=$offset name=\"$name\" description=\"$name prediction\" visibility=3\n";
print foreach @output;