[Bio] / BSub / gencirc Repository:
ViewVC logotype

View of /BSub/gencirc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (download) (annotate) (vendor branch)
Tue Nov 29 19:19:57 2005 UTC (13 years, 10 months ago) by olson
Branch: foo, MAIN
CVS Tags: bar, HEAD
Changes since 1.1: +0 -0 lines
New dir for B. subtilis work

use strict;
use FIG;
use FileHandle;

my $fig = new FIG;


my $genome = '83333.1';

my @features = $fig->all_features($genome, 'peg');

my %cfh;
for my $contig ($fig->all_contigs($genome))
{
    my $fh = new FileHandle(">$contig.tab") or die $!;
    $cfh{$contig} = $fh;
    
    my $len = $fig->contig_ln($genome, $contig);
    print $fh "\%$len\n";
    print $fh "!" . join("\t", 'strand', 'slot', 'start', 'stop', 'type', 'label', 'mouseover') . "\n";
}

for my $f (@features)
{
    my $loc = $fig->feature_location($f);

    my($contig, $beg, $end) = $fig->boundaries_of($loc);

    my $strand = 'forward';

    if ($beg > $end)
    {
	($end, $beg) = ($beg, $end);
	$strand = 'reverse';
    }

    my $func = $fig->function_of($f);
    my @a = $fig->feature_aliases($f);
    my @gene_names = grep { /^[a-zA-Z]{4}$/ } @a;
    my $show_name;
    if (@gene_names)
    {
	$show_name = $gene_names[0];
    }
    else
    {
	my($g, $p) = $fig->genome_and_peg_of($f);
	$show_name = $p;
    }
    my $fh = $cfh{$contig};
    print $fh join("\t",
	       $strand,
	       1,
	       $beg,
	       $end,
	       'gene',
	       $show_name,
	       $func), "\n";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3