[Bio] / StandaloneTools / gff_to_tbl.pl Repository:
ViewVC logotype

View of /StandaloneTools/gff_to_tbl.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Fri Sep 24 14:16:43 2004 UTC (15 years ago) by overbeek
Branch: MAIN
CVS Tags: HEAD
Convert Bielefeld GFF format to SEED tbl format. -- /gdp

#!/usr/bin/perl -w

$org_id  = shift @ARGV;

$orf_num = 0;
while (defined($line = <STDIN>))
{
    chomp $line;
    
    next if ($line =~ m/^\#/);
    next if ($line !~ m/\S/);
    
    ($contig, undef, $type, $left, $right, undef, $strand) = split /\t/, $line;
    
    next if ($type !~ m/CDS/);
    
    if    ($strand eq '+')
    {
	($beg, $end) = ($left, $right-3);
    }
    elsif ($strand eq '-')
    {
	($beg, $end) = ($right, $left+3);
    }
    else
    {
	print STDERR "Invalid strand in $line\n"; 
    }
    
    ++$orf_num;
    print "fig|$org_id.peg.$orf_num\t$contig\_$beg\_$end\t\n";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3