first_n_seqs.pl 180 B

1234567891011121314151617
  1. #!/usr/bin/perl -w
  2. #
  3. use strict;
  4. my $n = shift or die("Usage: $0 <num_of_seqs> [fasta_file]\n");
  5. my $m = 0;
  6. while(<>){
  7. if(/^>/){
  8. last if($m == $n);
  9. $m ++;
  10. }
  11. print;
  12. }
  13. 1;