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

Annotation of /FigKernelScripts/find_SEED_SSU_rRNA_genes.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : overbeek 1.1 #! /usr/bin/perl
2 :     #
3 :     # find_SEED_SSU_rRNA_genes [ genome_id ... ]
4 :     #
5 :    
6 :     use strict;
7 :     use find_homologs;
8 :     use gjoseqlib;
9 :     use Data::Dumper;
10 :     use FIG;
11 :     my $fig = new FIG;
12 :    
13 :     use SSU_rRNA_reps;
14 :     my @rrna = @SSU_rRNA_reps::SSU_rRNA_reps;
15 :    
16 :     my @genomes = @ARGV;
17 :     if ( ! @genomes )
18 :     {
19 :     @genomes = grep { $fig->is_prokaryotic($_) } $fig->genomes('complete');
20 :     }
21 :    
22 :     foreach my $genome ( @genomes )
23 :     {
24 :     my $contig_file = "Organisms/$genome/contigs";
25 :     -f $contig_file or print STDERR "Could not find contig file $contig_file\n"
26 :     and exit;
27 :     my $options = { description => 'Small subunit ribosomal RNA',
28 :     extrapolate => 10,
29 :     refseq => \@rrna
30 :     };
31 :     my $instances = find_homologs::find_nucleotide_homologs( $contig_file, $options );
32 :     my @instances = map { $_->[2] }
33 :     sort { $a->[0] cmp $b->[0] || $a->[1] <=> $b->[1] }
34 :     map { my $loc = $_->{ location };
35 :     my $seq = $_->{ sequence };
36 :     my ( $c, $b, $e ) = $loc =~ /^(.*)_(\d+)_(\d+)$/;
37 :     $seq =~ s/^(.{24})...+(.{24})$/$1...$2/;
38 :     [ $c, $b+$e, [ $genome, $loc, lc $seq ] ]
39 :     }
40 :     @$instances;
41 :     foreach ( @instances ) { print join( "\t", @$_ ), "\n" }
42 :     print "\n" if @instances;
43 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3