View Single Post
Old 07-27-2011, 06:32 AM   #2
BENM
Member
 
Location: PRC

Join Date: May 2009
Posts: 33
Default

Try this run in your terminal:

perl -e 'my ($name,$seq)=("","");while(<>){chomp;if ((/\>/)||(eof)){if (($seq ne "")||(eof)){$seq.=$_ if (eof);my @Seq=split /N+/,$seq;if (@Seq>1){for my $i(1..@Seq){print "$name contig$i\n";print $Seq[$i-1],"\n";}}else{print "$name\n$seq\n";}}$name=$_;$seq="";}else{chomp;$seq.=$_;}}' your_seq.fasta
BENM is offline   Reply With Quote