[Bio] / FigMetagenomeTools / fasta_subseqs.pl Repository:
ViewVC logotype

View of /FigMetagenomeTools/fasta_subseqs.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Mon Feb 19 17:15:26 2007 UTC (13 years, 3 months ago) by olson
Branch: MAIN
Branch point for: x
Initial revision

#!/usr/bin/perl -w

# grab some sequences from a file, at random

use strict;
use lib '/clusterfs/home/rob/perl';
use Rob;
my $rob=new Rob;

my $fasta=shift||die "$0 <fasta file><number of seqs>\n";
my $nos=shift||die "$0 <fasta file><number of seqs>\n"; 

my $fa=$rob->read_fasta($fasta);
my $arr=$rob->rand([keys %$fa]);
map {
 $fa->{$_}=~s/\s+//g; $fa->{$_}=~ s/(.{60})/$1\n/g; chomp($fa->{$_});
 print ">$_\n", $fa->{$_}, "\n";
} splice(@$arr, 0, $nos);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3