@solvedのC#の構文解析の速度を向上させる、私はPerlでphred33のFASTQファイルを解析していますし、それが(15分程度)かなりの時間を取っているは、同じコードでFASTQ
倍の速度です。 fastqファイルは約3ギグです。 これをより速くする合理的な方法はありますか?
$file=shift;
open(FILE,$file);
open(FILEFA,">".$file.".fa");
open(FILEQA,">".$file.".qual");
while($line=<FILE>)
{
chomp($line);
if($line=~m/^@/)
{
$header=$line;
$header =~ s/@/>/g;
$seq=<FILE>;
chomp($seq);
$nothing=<FILE>;
$nothing="";
$fastq=<FILE>;
print FILEFA $header."\n";
print FILEFA $seq."\n";
$seq="";
print FILEQA $header."\n";
@elm=split("",$fastq);
$i=0;
while(defined($elm[$i]))
{
$Q = ord($elm[$i]) - 33;
if($Q!="-23")
{
print FILEQA $Q." ";
}
$i=$i+1;
}
print FILEQA "\n";
}
}
print $file.".fa\n";
print $file.".qual\n";
、私はおそらくcachegrind ... –
を起動したいいくつかの簡単なグーグルます。http ://www.biostars.org/post/show/5005/ngs-huge-fastq-file-parsing-which-language-for-good-efficiency/あなたは ':raw'から読むこともできます:http:// www.perlmonks.org/?node_id=837624 http://stackoverflow.com/questions/1349604/what-is-the-fastest-way-to-read-10-gb-file-from-the-diskを参照してください。おそらくhttp://stackoverflow.com/questions/1052765/linux-perl -mmap-performance –
私は多くのperlを知らないです - '$ nothing =;'ファイル全体を配列として読み込みますか?おそらくあなたはファイル全体を繰り返し読んでいるでしょうか? –