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

View of /FigMetagenomeTools/getfasta.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, 1 month ago) by olson
Branch: MAIN
Branch point for: x
Initial revision

#!/usr/bin/perl -w

# get some fasta sequences from a file

use strict;
use lib '/clusterfs/home/rob/perl';
use Rob;

my $us=<<EOF;
$0

-f fasta file
-n needed sequences, one per line

EOF

my ($faf, $nf);

while (@ARGV) {
 my $t=shift;
 if ($t eq "-f") {$faf=shift}
 elsif ($t eq "-n") {$nf=shift}
}

die $us unless ($faf && $nf);

my $fasta = Rob->read_fasta($faf);
open(IN, $nf) || die "Can't opne $nf";
while (<IN>) {
 chomp;
 if ($fasta->{$_}) {
  $fasta->{$_} =~ s/\s+//g;
  print ">$_\n", $fasta->{$_}, "\n";
 } else {
  print STDERR "No sequence for $_\n";
 }
}




MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3