Our Sponsors



Download BioinformaticsOnline(BOL) Apps in your chrome browser.

Freelancer

AdvertiseWithUs
  • BioScripts
  • Bulbul
  • Perl script to remove the duplicate sequences from multifasta file

Perl script to remove the duplicate sequences from multifasta file

  • Public
By Bulbul 239 days ago
use strict; use Bio::SeqIO; my %unique; my $file = "myseqs.fa"; my $seqio = Bio::SeqIO->new(-file => $file, -format => "fasta"); my $outseq = Bio::SeqIO->new(-file => ">$file.uniq", -format => "fasta"); while(my $seqs = $seqio->next_seq) { my $id = $seqs->display_id; my $seq = $seqs->seq; unless(exists($unique{$seq})) { $outseq->write_seq($seqs); $unique{$seq} +=1; } }