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

Annotation of /FigMetagenomeTools/fasta_subseqs.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.1 #!/usr/bin/perl -w
2 :    
3 :     # grab some sequences from a file, at random
4 :    
5 :     use strict;
6 :     use Rob;
7 :     my $rob=new Rob;
8 :    
9 :     my $fasta=shift||die "$0 <fasta file><number of seqs>\n";
10 :     my $nos=shift||die "$0 <fasta file><number of seqs>\n";
11 :    
12 :     my $fa=$rob->read_fasta($fasta);
13 :     my $arr=$rob->rand([keys %$fa]);
14 :     map {
15 :     $fa->{$_}=~s/\s+//g; $fa->{$_}=~ s/(.{60})/$1\n/g; chomp($fa->{$_});
16 :     print ">$_\n", $fa->{$_}, "\n";
17 :     } splice(@$arr, 0, $nos);
18 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3