title: How to remove small contigs from fasta files?
body: <pre><code>## removesmalls.pl
  #!/usr/bin/perl
  use strict;
  use warnings;
  
  my $minlen = shift or die "Error: `minlen` parameter not provided\n";
  {
      local $/="&gt;";
      while(&lt;&gt;) {
          chomp;
          next unless /\w/;
          s/&gt;$//gs;
          my @chunk = split /\n/;
          my $header = shift @chunk;
          my $seqlen = length join "", @chunk;
          print "&gt;$_" if($seqlen &gt;= $minlen);
      }
      local $/="\n";
  }
  </code></pre>
  
  <p>Exexecuting the script as follows: </p>
  
  <pre><code>perl removesmalls.pl 1000 contigs.fasta &gt; contigs-1000.fasta
  </code></pre>
  
  <p>The above script works for me but there is a problem,
  i have 109 different fasta files with different file names.
  i can run the script for individual file but i want to run the script at once for all files and the result file should be individually different for each.</p>
  
  <p>file names are like SRR8224532.fasta, SRR8224533.fasta, SRR8224534.fasta, and so on
  i want the result files after removing the contigs (i.e., for me less than 1000) something like SRR8224532-out.fasta,
  SRR8224533-out.fasta, and so on.</p>
  
  <p>Any help or suggestion would be helpfull.</p>