美文网首页
通过gff3文件获取起始密码位置

通过gff3文件获取起始密码位置

作者: qujingtao | 来源:发表于2020-04-20 09:35 被阅读0次

#!/usr/bin/perl

#The perl script is writen by Jingtao Qu

use warnings;

use strict;

open IN,"Zea_mays.AGPv4.38.gff3";

open OUT,">start_code_site.txt";

my %hash = ();

while (<IN>) {

next if /^#/;

my @a = split/\s+/;

next unless $a[2] =~ /CDS/;

$a[8] =~ /ID=CDS:([^;]*)/;

push @{$hash{$1}},[$a[0],$a[3],$a[4],$a[6]];

}

close IN;

foreach  (keys %hash) {

if (${$hash{$_}}[0]->[3] =~ /\+/) {

print OUT "$_\t${${$hash{$_}}[0]}[0]\t${${$hash{$_}}[0]}[1]\t".(${${$hash{$_}}[0]}[1]+2)."\n";

}else{

print OUT "$_\t${${$hash{$_}}[-1]}[0]\t".(${${$hash{$_}}[-1]}[2]-2)."\t${${$hash{$_}}[-1]}[2]\n";

}

}

close OUT;

相关文章

网友评论

      本文标题:通过gff3文件获取起始密码位置

      本文链接:https://www.haomeiwen.com/subject/tjllihtx.html