[Bio] / FigKernelScripts / find_SEED_SSU_rRNA_genes.pl Repository:
ViewVC logotype

View of /FigKernelScripts/find_SEED_SSU_rRNA_genes.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Sat Feb 21 15:37:22 2009 UTC (11 years, 3 months ago) by overbeek
Branch: MAIN
CVS Tags: rast_rel_2009_03_26
Changes since 1.1: +1 -1 lines
minor fixes

#! /usr/bin/perl
#
#   find_SEED_SSU_rRNA_genes [ genome_id ... ]
#

use strict;
use find_homologs;
use gjoseqlib;
use Data::Dumper;
use FIG;
my $fig = new FIG;

use SSU_rRNA_reps;
my @rrna = @SSU_rRNA_reps::SSU_rRNA_reps;

my @genomes = @ARGV;
if ( ! @genomes )
{
    @genomes = grep { $fig->is_prokaryotic($_) } $fig->genomes('complete');
}

foreach my $genome ( @genomes )
{
    my $contig_file = "$FIG_Config::organisms/$genome/contigs";
    -f $contig_file or print STDERR "Could not find contig file $contig_file\n"
                    and exit;
    my $options = { description => 'Small subunit ribosomal RNA',
                    extrapolate =>  10,
                    refseq      => \@rrna
                  };
    my $instances = find_homologs::find_nucleotide_homologs( $contig_file, $options );
    my @instances = map  { $_->[2] }
                    sort { $a->[0] cmp $b->[0] || $a->[1] <=> $b->[1] }
                    map  { my $loc = $_->{ location };
                           my $seq = $_->{ sequence };
                           my ( $c, $b, $e ) = $loc =~ /^(.*)_(\d+)_(\d+)$/;
                           $seq =~ s/^(.{24})...+(.{24})$/$1...$2/;
                           [ $c, $b+$e, [ $genome, $loc, lc $seq ] ]
                         }
                    @$instances;
    foreach ( @instances ) { print join( "\t", @$_ ), "\n" }
    print "\n" if @instances;
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3