#!/usr/bin/perl -w
$|=1;
print "input your genome sequence,then press Enter!\n";
my $seq=;
open FASTA,"$seq" or die "can not open FASTA file,$!";
print "input your gff file name,then press Enter!\n";
my $gff=;
open GFF,"$gff" or die "can not open GFF file,$!";
open OUT,">gene_sequence";
while (){
chomp;
if (/>/){
my @qq=split;
$key=$qq[0];$key =~ s/>//g;}
else {$hash{$key}.=$_}
}#把基因序列文件扫描进去hash表
while ()
{
chomp;
@F=split;
$out=substr($hash{$F[0]},$F[2]-1,$F[3]-$F[2]+1);
print OUT">$F[1]\n$out\n";
}
exit;
阅读(941) | 评论(0) | 转发(0) |