作者seagal (待救的小米)
看板perl
标题Re: [问题]关於bioperl:::clustalW
时间Sat Oct 2 06:52:09 2004
※ 引述《plankton (我..凭什麽)》之铭言:
: ※ 引述《seagal (待救的小米)》之铭言:
: 这位大大..首先非常谢谢你回答我的问题
: : 这是我从tutorial cut下来的
: : --------------------------------
: : use Bio::Tools::Run::Alignment::Clustalw;
: : @params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
: : $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
: : $ktuple = 3;
: : $factory->ktuple($ktuple); # change the parameter before executing
: : $seq_array_ref = \@seq_array;
: : # where @seq_array is an array of Bio::Seq objects
: : $aln = $factory->align($seq_array_ref);
: : --------------------------------
: : 你要不要先学tutorial方式
: : 先把序列存到@seq_array
: : 再去MSA?
: ^^^?
Multiple Sequence Alignment
ClustalW就是一种MSA
: 很抱歉我不知道什麽是MSA..全文是...^_^||
: 关於tutorial的方式..我大都已经用过了..
: 所以这个我也试过了^_^|||...
: : 这样最保险 因为我想你也是做练习用途
: 那个....其实并不是上课练习用之类的...谢谢...对我来说非常重要
: : 另外 我这边有一些之前去国高教书的范例档
: : 刚好就没有clustalW
: : 但有其他范例 例如blast
: : 都是确定可以跑的
: : 看你有没需要拿去练习
: 好啊~~实在太感谢了...有关blast的程式都好
: 多看看说不定能找出什麽端倪..谢谢你^_^
如果你不是练习用途的话
建议你可以直接在linux下面使用ClustalW执行档跑出结果
再利用AlignIO去处理出来的结果
ex.
use Bio::AlignIO;
my $io = Bio::AlignIO->new(-file => "receptors.aln",
-format => "clustalw" );
因为你使用ClustalW模组 他还是必须要去呼叫ClustalW执行档的
我不知道你的问题是否出在 你有没正确安装这个执行档
而且clustalw执行方式很简单 所以我才没有使用过bioperl的这个模组
你利用外部呼叫(ex `clutalw`, system('clustalw'))去执行他
以及使用ClustalW模组
根据我的经验 两种写出来的程式码是差不多简单的
是工作而不是练习需要 就不一定要坚持用bioperl完成搂~~~ 事情做的出来就好
下面贴给你blast范例
有分两个部分
1. local执行
2. under internet
---------------------------------------------------
#!/usr/bin/perl
use Data::Dumper;
use Bio::Tools::Run::StandAloneBlast;
@params = ('program' => 'blastn',
'database' => 'ecoli.nt');
$factory = Bio::Tools::Run::StandAloneBlast->new(@params);
$input = Bio::Seq->new(-id =>"test query",
-seq =>"AACGGGCAATATGTCTCTGTGT");
$blast_report = $factory->blastall($input);
print Dumper($blast_report);
while (my $sbjct = $blast_report->nextSbjct){
while (my $hsp = $sbjct->nextHSP){
print $hsp->score . " " . $hsp->subject->seq_id . "\n";
print $hsp->bits, "\n";
print $hsp->percent, "\n";
print $hsp->P, "\n";
print $hsp->match, "\n";
print $hsp->positive, "\n";
print $hsp->length, "\n";
print $hsp->querySeq, "\n";
print $hsp->sbjctSeq, "\n";
print $hsp->homologySeq, "\n";
print $hsp->query->start, "\n";
print $hsp->query->end, "\n";
print $hsp->hit->start, "\n";
print $hsp->hit->end, "\n";
print $hsp->hit->seq_id, "\n\n";
}
}
=head
use Bio::Tools::Run::RemoteBlast;
$remote_blast = Bio::Tools::Run::RemoteBlast->new(
'-prog' => 'blastp','-data' => 'ecoli','-expect' => '1e-10' );
$r = $remote_blast->submit_blast("ecolitst.fa");
while (@rids = $remote_blast->each_rid ) {
foreach $rid ( @rids ) {$rc = $remote_blast->retrieve_blast($rid);}
}
=cut
--
http://140.109.73.177/待救的小米.mht
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.109.73.177
※ 编辑: seagal 来自: 140.109.73.177 (10/02 06:53)
※ 编辑: seagal 来自: 140.109.73.177 (10/02 06:58)