Our Sponsors



Download BioinformaticsOnline(BOL) Apps in your chrome browser.




Perl script to remove fasta sequences in multifasta file with certain length threshold

  • Public
By Poonam Mahapatra 2453 days ago
#!/usr/bin/perl use strict; use warnings; my $minlen = shift or die "Error: `minlen` parameter not provided\n"; { local $/=">"; while(<>) { chomp; next unless /\w/; s/>$//gs; my @chunk = split /\n/; my $header = shift @chunk; my $seqlen = length join "", @chunk; print ">$_" if($seqlen >= $minlen); } local $/="\n"; }