求用perl编个程序去除fasta中大于30bp的片段

2025-02-24 07:15:15
推荐回答(1个)
回答1:

#!/usr/bin/perl -w
use strict;

open IN,"seq.fasta" or die $!;
open OUT,">seqlessthan30.fa" or die $!;
while(){
chomp;
my $name=$_;
chomp(my $seq=);
chomp(my $strand=);
chomp(my $qual=);
next if(length($seq)>30);
print OUT join("\n",($name,$seq,$strand,$qual)),"\n";
}