hyphy absrel的使用

mafft --auto EPAS1.pep.fa > EPAS1.pep.mafft.fa;

perl pal2nal.pl EPAS1.pep.mafft.fa EPAS1.cds.fa -output fasta > EPAS1.cds.nal;
#转换为密码子比对

perl filter.pl EPAS1.cds.nal EPAS1.cds.filter.nal;
#过滤终止密码子

iqtree -s EPAS1.cds.filter.nal -nt 10 -bb 1000
#最好有外群去定根
#iqtree -s EPAS1.cds.filter.nal -nt 10 -bb 1000 -o TAX

hyphy label-tree.bf --list spp.list --output label.tree --tree EPAS1.cds.filter.nal.treefile #可以忽略

hyphy absrel --alignment EPAS1.cds.filter.nal --tree label.tree  --branches Foreground  --output EPAS1.absrel

pal2nal.pl
https://github.com/liaochenlanruo/PAL2NAL


cat filter.pl

#usage perl <fasta> <filter_file>
use warnings;
open($I,"<$ARGV[0]")  or die "No input fasta file!!\n"."Usage :perl filter.pl <fasta> <filter_file>; ";
open($O,">$ARGV[1]")  or die "Please assign output_file!!\n"."Usage :perl filter.pl <fasta> <filter_file>; ";
@array1 = <$I>;
@count = undef;
##捕获位点
for($i=0;$i<=$#array1;$i++)
    {
    if($array1[$i] =~ /\>/)
        {
        }   
    else    
    {   
        my @a = $array1[$i] =~ /(.{3})/g;
        for($n=0;$n<=$#a;$n++)
        {   
            my $c = $a[$n];
            chomp $c;
            if ($c eq "TGA" || $c eq "TAA" || $c eq "TAG" )
            {
            push @count,"$n";
            }
        }
        
    }
    }
##过滤密码子
for($i=0;$i<=$#array1;$i++)
    {
    if($array1[$i] =~ /\>/)
        {
        print {$O} "\n$array1[$i]";
        }   
    else    
    {   
        my @a = $array1[$i] =~ /(.{3})/g;
        for ($e=0;$e<=$#a;$e++)
        {   
            for ($g=1;$g<=$#count;$g++)
            {
            $a[$count[$g]] = "";
            }
            $c = $a[$e];
                        print {$O} $c;
        }
        }
        
    }
system("sed -i '1d' $ARGV[1]");
close $I;
close $O;
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容