[Bioperl-l] Getting all thae matrices from transfac

Stefan Kirov skirov at utk.edu
Thu Jun 3 20:58:47 EDT 2004


Currently TFBS is not in bioperl. You can do what you want with 
Bio::Matrix::PSM::IO. Also TFBS reads Jaspar format, transfac format is 
quite different.
my $io=new Bio::Matrix::PSM::IO(-file=>'matrix.dat',-format=>'transfac');
while (my $matrix=$io->next_psm) {
    my $id=$matrix->id;
    my $an=$matrix->accession_number;
    my $l=$matrix->width;
    my $cons=$matrix->IUPAC;
    print"$id\t$an\t$l\t$cons\n";
}
matrix.dat is usually the Transfac file, containing the matrices data, 
unless you have renamed it.
see as well Bio::Matrix::PSM::SiteMatrix.
Hope this helps.
Stefan
   

gtg974p at mail.gatech.edu wrote:

>Hi all,
>Can someone tell me how to get all the matrices from Local TRANSFAC. The 
>get_MatrixSet() module works only for Jaspar. I need something like -- 
>
>
>my $db =  TFBS::DB::FlatFileDir->connect("$jaspardir");
>my $matrixset = $newdb->get_MatrixSet(-matrixtype=>"PFM");
>my $mx_iterator = $matrixset->Iterator(-sort_by=>'name');
>printf("\n %-10s%15s%25s \n",'MatrixID','Name','Length');
>while(my $pfm = $mx_iterator->next())
>{
>    printf(" %-10s%15s%25s \n", $pfm->ID, $pfm->name, $pfm->length);
>}
>
>
>for getting all the matrices from TRANSFAC.
>
>Thanks in advance.
>_______________________________________________
>Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org
>http://portal.open-bio.org/mailman/listinfo/bioperl-l
>  
>

-- 
Stefan Kirov, Ph.D.
University of Tennessee/Oak Ridge National Laboratory
1060 Commerce Park, Oak Ridge
TN 37830-8026
USA
tel +865 576 5120
fax +865 241 1965
e-mail: skirov at utk.edu
sao at ornl.gov



More information about the Bioperl-l mailing list