1. 程式人生 > >合併並轉化一代測序seq純文字為fasta格式檔案

合併並轉化一代測序seq純文字為fasta格式檔案

use strict;
use warnings;

my @dir;
my @filelist;
open OUT, ">result.fst";
opendir (DIR, "./") or die "can't open the directory!";
@dir = readdir DIR;
foreach my $file (@dir) {
    if ( $file =~ /[a-z]*\.seq/) {
        push @filelist,$file;
    } 
}
closedir(DIR);

foreach my $file (@filelist
){ open IN, "<".$file or die "cannot open $file"; print OUT ">".$file."\n"; print OUT <IN>; close(IN); } close (OUT);