1

ここではPerlにとって完全に新しいものです。とにかく、私は特定のタスクを与えられ、まさに私が望んでいることを実行する perl モジュールをオンラインで見つけました。

マトリックス

ドキュメンテーション

これは perl モジュールのドキュメントです。Ext の下には pwmsearch という名前のモジュールがあり、まさに私が必要としている機能を備えています。

そこで、次のようなスクリプトを作成しようとしました。

#!/usr/bin/env perl -w

use strict; 
use TFBS::Ext::pwmsearch; #this was how the documentation said in synopsis part for pwmsearch so I figured this was how to do it

問題は、オブジェクトを pwmsearch に渡す方法がわからないことです。上記のドキュメントに示されている pwmsearch のソース コードは、$matrixobj と $seqobj を取り込んでいると述べており、これらは行列とシーケンスのファイルとして保存されています。

それで、私が試すことができることをグーグルで調べた後、次のようなことを試みました:

pwmsearch('matrix','sequence'); 

また

open FILE, 'matrix.txt' or die "Couldn't open file";
$matrix.=<FILE>
close FILE;

open FILE, 'sequence' or die "Couldn't open file";
$seq.=<FILE>
close FILE;
pwmsearch($matrix,$seq)

しかし、それらはすべて、さまざまなエラーで私にperlの吠え声を上げます。私は何を間違っていますか?それらを修正するにはどうすればよいですか?

4

1 に答える 1

1

pwm マトリックス オブジェクトを生成する方法のドキュメントは次のとおりです: http://tfbs.genereg.net/DOC/TFBS​​/Matrix/PWM.html

use TFBS::Matrix::PWM;
my $matrixstring = <<ENDMATRIX
 0.61 -3.16  1.83 -3.16  1.21 -0.06
-0.15 -2.57 -3.16 -3.16 -2.57 -1.83
-1.57  1.85 -2.57 -1.34 -1.57  1.14
 0.31 -3.16 -2.57  1.76  0.24 -0.83
ENDMATRIX;
my $pwm_matrix_in = TFBS::Matrix::PWM->new(-matrixstring => $matrixstring,
                 -name         => "MyProfile",
                 -ID           => "M0001"
                );

PWMSearch ドキュメント: http://tfbs.genereg.net/DOC/Ext/pwmsearch.html

$matrixobj、$seqobj、$threshold、$start、$end の 5 つの入力変数が必要です。最後の 3 つは、正しく表示されていればオプションです。

seqobj はおそらく Bio::Seq 互換オブジェクトです。ファイルから新しいオブジェクトを作成します: ドキュメント: http://metacpan.org/pod/Bio::SeqIO

use Bio::SeqIO;
my $seqobj_in  = Bio::SeqIO->new(-file => "inputfilename" ,
                           -format => 'Fasta');


use strict; 
use TFBS::Ext::pwmsearch;
TFBS::Ext::pwmsearch::pwmsearch($pwm_matrix_in,$seqobj_in);

これがお役に立てば幸いです。

于 2012-10-04T08:34:25.827 に答える