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

View of /FigKernelScripts/svr_rRNA.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Tue Apr 5 18:55:25 2011 UTC (8 years, 10 months ago) by fangfang
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_release_3_0_4, mgrast_dev_06072011, mgrast_dev_08022011, rast_rel_2014_0912, myrast_rel40, rast_rel_2014_0729, mgrast_dev_05262011, mgrast_release_3_1_2, mgrast_release_3_1_1, rast_rel_2011_0928, mgrast_dev_04132011, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_10262011, mgrast_dev_04082011, mgrast_release_3_1_0, HEAD
Changes since 1.1: +23 -0 lines
update pod

#
#	This is a SAS Component.
#

use strict;

=head1 svr_rRNA

Get 16S rRNAs of genomes 

  Usage: svr_rRNA [--c=N] <genome_id_list >rRNA.fasta

=head2 Command-Line Options

=over 4

=item -c Column

This is used only if the column containing Genome IDs is not the last.

=back

=head2 Output Format

The standard output is a FASTA file containing the rRNA sequences.

=cut


use Getopt::Long;
use gjoseqlib;

my $usage = "Usage: svr_rRNA [--c=N] <genome_id_list >rRNA.fasta\n\n";
my $column;

my $opted = GetOptions('c=i' => \$column);
$opted or die $usage;

my @lines = map { chomp; [ split /\t/ ] } <STDIN>;
$column ||= @{$lines[0]};

my %gid = map { /(\d+\.\d+)/ ? ($1 => 1) : () } map { $_->[$column-1] } @lines;

my $rRNA_file = "/vol/public-pseed/FIGdisk/FIG/Data/Global/genome_rRNA.fasta";
-s $rRNA_file or die "Could not open $rRNA_file\n\n";

my @seqs = grep { $gid{$_->[0]} } gjoseqlib::read_fasta($rRNA_file);

gjoseqlib::print_alignment_as_fasta(@seqs);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3