#!/usr/bin/perl
$example = <
>A|c21852_g1f1
XXXXXX
>B|10011958m
XXXXXX
>C|311240
XXXXXX
>D|AT1G01880
XXXXXX
............
E
;
open IN,"
open OUT,">result";
while (){chomp;
if(/^>/){ $key =$_;}else{$hash{$key}.=$_}
}
foreach $line(keys %hash){ chomp$line;
$line=~/>(\w+)/;
if ($seq{$1}){ $seq{$1}.=$hash{$line} }else{ $seq{$1}.=$hash{$line}
}
}
foreach (keys %seq){
print OUT">$_\n$seq{$_}\n";
}
阅读(752) | 评论(0) | 转发(0) |