拟南芥基因注释

Athaliana_447_Araport11.annotation_info.txt文件下载链接 https://phytozome.jgi.doe.gov/pz/portal.html#!bulk?org=Org_Athaliana_er

#!/usr/bin/perl

my $infile=shift;
my $gene_num=shift;
my $outfile=$infile.".annotation.txt";
$gene_num-=1;

my %anno_hash;

$usage="USAGE:
    perl $0 infile line_number\n";
unless($infile && $gene_num>=1){
    die "$usage";
}

my $anno_file="./Athaliana_447_Araport11.annotation_info.txt";
open ANNO,$anno_file or die "fileOpenError: unable to open $anno_file\n";
while(<ANNO>){
    chomp;
    my @line=split "\t",$_;
    if($line[12]){
        $anno_hash{$line[1]}=$line[12];
    }
}
close ANNO;


open INFILE,$infile or die "fileOpenError: unable to open $infile\n";
open OUTFILE,">".$outfile;
while(<INFILE>){
    chomp;
    my $line=$_;
    my @line=split "\t",$line;
    my $gene=$line[$gene_num];
    $gene=~s/\..*//g;
    if(exists $anno_hash{$gene}){
        print OUTFILE "$line\t$anno_hash{$gene}\n";
    }
    else{
        print OUTFILE "$line\n";
    }
}
close INFILE;
close OUTFILE;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值