BioPerl分割超大的fasta文件/largefasta

/ #生物信息学 / 5 comments

初学perl,有何不妥,请指出。

#! /usr/bin/perl -w
use Bio::SeqIO;
use  Bio::Seq;  
$catchseq_seqio_obj = Bio::SeqIO->new(-file=>"filename.fasta", -format=>"largefasta");
$n=1;
while($seq_obj = $catchseq_seqio_obj->next_seq)
{	
	$seqio_obj = Bio::SeqIO->new(-file =>">filename_seq_$n.fasta", -format =>"largefasta");
	$seqio_obj->write_seq($seq_obj);
	$n++;
}

主要就是里面的-format=>"largefasta"的使用了。它可以在你的/tmp里面建立一个缓存来解决大文件打开时内存不足的问题。输出时用 -format =>"fasta"也行哈,看情况了。

回应
  1. The proof changing -format to.Fasta instead of largefasta in .Bio SeqIO-new -file fileIn -format Fasta .solved my problem as was suggested this is probably not the right method.to use but it works ....Hilmar Lapp wrote .

    Reply
  2. The proof changing -format to.Fasta instead of largefasta in .Bio SeqIO-new -file fileIn -format Fasta .solved my problem as was suggested this is probably not the right method.to use but it works ....Hilmar Lapp wrote .

    Reply
    1. wbyxu
      @bank account offshore

      @bank account offshore, That's a good news.

      Reply
  3. The proof changing -format to.Fasta instead of largefasta in .Bio SeqIO-new -file fileIn -format Fasta .solved my problem as was suggested this is probably not the right method.to use but it works ....Hilmar Lapp wrote .

    Reply
    1. wbyxu
      @Monex

      @Monex O(∩_∩)O~~~

      Reply