perl应用:SNP的提取(4):信息的补全和重复区域的删除!
我们在上一篇文章中看了最后的输出结果如下:
#!/usr/bin/perl# move repeat arear outuse strict;use warnings;my %position;my @pos;my $cout;my $key;my $value;open (ALL,"all_information.txt")||die("can not open!");while(<ALL>){$position{$1}=$2 if $_=~/^(\d+)\s(.+)$/;}open (POS,"sepChr5.txt")||die("can not open!");while(<POS>){@pos=split;for($cout=$pos[1]+1;$cout<$pos[2]+1;$cout++){if(exists $position{$cout}){delete $position{$cout};}else {next;}}}open (RESULT,">without_repeat_information.txt")||die ("can not open!");foreach $key(sort keys %position){print RESULT "$key ";$value=$position{$key};print RESULT "$value \n";}