[Bioperl-l] Bio/Align/DNAStatistics.html print $jcmatrix->print_matrix;

Jose . joseguillin at hotmail.com
Mon Sep 14 12:48:28 UTC 2009




Hello,

I'm trying to use Bio::Align::DNAStatistics, but I get the following message:

Can't call method "print_matrix" on unblessed reference at Tree.pl line 32, <GEN0> line 44.

Other modules do work, such us Bio::SimpleAlign;




My code is basically a modification of the code I found in http://doc.bioperl.org/releases/bioperl-current/bioperl-live/Bio/Align/DNAStatistics.html, as it is as follows:

use strict;
use Bio::AlignIO;
use Bio::Align::DNAStatistics;


my $stats = Bio::Align::DNAStatistics->new();

my $alignin = Bio::AlignIO->new(-file => 'e1_output_uno_solo.fas',
                            -format => 'fasta');
my $aln = $alignin->next_aln;

my $jcmatrix = $stats-> distance (-align => $aln,
                  -method => 'Jukes-Cantor');

print $jcmatrix->print_matrix;

And the file 'e1_output_uno_solo.fas' has the following sequences:

>A
GGTTATCTCAACAACTGTCACC--GTGGGCGCTGGTCATTGGTACGGGTGAACGAGAGTT
AAACGGTCGTTAACCATAGAAACAAAACACACTGCACCTTAACTCACTGAATAGTTGACG
GTCTGCCTCAGGGCTTGAGACAACGGATGGATCTAAACTCATGCTGTAGCCTATCAAACT
TAGCCCCAGGGTACTTCCGTCCCTAGCCTCGCTACAAGGCCAGAAAGGGTTTTGAAGTCT
ACTCACTGTGACCAGCGGTCTAGTCAGGTTATGCTTCGGCACAAAACCTCAGAATCGGTA
ACCAGCCACTACACGAACTGAAATCAAATCGCGGGAGGTGGTCCATCTTTGTCCACGCTG
CGATGATTGGGTTGCTTTATAGTCTAGCTGCAAGGTTTTGCGTTCTGGTGGGAAGCGGCA
TCCAAGGGGTTGACTCCGCTCGTTTATAACATGCCTTGGGCCTCCATGGTGAGTCGCAAC
GTCAGCGTAGGCCTAGACGGCT

>B
GGATATCTCGACAACTTTTAGC--CTGGGCGCTTGGCATTGGTACACGTGACTTGCAGTT
AAAGGGTCGTTATACATAGAATCACTACCCAC--CAGGCGAACTCGCTGGAGAGCTGAGG
GTCACCCTCAGCGGTTGAGTTAACTGCTCGATGTTAACCGATGTTGGATCATAGGTAACT
TATCCTCAGTGTTCCTCTGTCCCTAGACTGGCTACAGGGCTACACCGGGTTTGAGGGGAT
ACTGACTGTTTTCAGCGGTAGTGTAAGTGTATGGTCCAACCCAAGGGTTCATGACCGGTA
AACTGCCCGTTCCCGCATTGAAATCAAATTGCAGGAGTTGGTACTTATTTGTCAACCTTA
CGATGATTGGGATGCATTTTAGTCGGGCTGGGCGGATTTGCGATCTGGGTGGAAGAGAGA
TGCATGGGGCTAACTCGTCTTGGTGAGTACCGGCATTGCACCGCAATGGACCGCCAAAAC
ATAAGAGTAGGTCGGGATGGCA

>C
GCTTATCTCAACAACCGACACGAAGTCGTCGCAGGTCAATGGTACACGTGAATTGAAGTC
ATAAGATCAGTAATGATCGAACCACCAAACCCTTAACCTCGACTCACGCGATAGCCGAGG
GTCTGCCTCCAGGGTTGATTTAAAGGTTCTATTTAAGACCGTTTTCGATCATAGGTTACT
TATCCCCAGAGTTCTACCGTCGTGAGAATGGCTACAAGGCTAGAATAGGTTTTAGGGT-T
ACTTACGGTCTGCAGCCGTATTGTGAGGTTATGGTCCGGCCCTAGGCGTCATGACCGATA
ATCAGCCCCTACCTGAAATGAAATCAAATCGCGGGAGTTGGTACTTATCTGTCAACGTTG
CGATGATGGGGATACATGTTGGTCTACCGCGACGGACTAGCGATCACGGGGGAAGCGGAT
TGCCCGGTGGTGACTCGACACGTTTAAAACCTGCCTGGTTCCCGCATGGATCGTCACAAC
GTATGTGCAGGTCGAAACGAGT

>D
CGTGATCGCAACAACTGTCACC--GTGGGCGCTGGCCGTTGGACCACGTGAAATGCTGTT
AAACGATCGTTCACCATAGAACCACTACACTCTTCACCTCAACCCGCGGGACAGGTGATG
GTGTCCCCCAGGGGTTGAGTGAACGGCTCGATGTAAACCCATGTTCGATCATAGGTAACG
TAGCCCCAGGGTGATTCCGTTCCTAAACTGGTTACAAGGCTAAAACGTGTTTTAGAGTAT
AATGACTGTCTACGGCGGTATTGTGATGTTATCATCCGTCCCTAGGCGTGGCGACCGTTA
AACAGCCTCTTCCCTAACTGATATCTAATCGTAGGAGTTGCTACGCATTTGTCAACGCAG
CGATGATGGTGATGCATCTTAATCTAGCTGG----TTTTTTGATCTCGGGTGACGCAGAT
AGTCAGGGGTTGACTCGCGTCGTTTGAAACGTGCCTTGCTCCTCAATGGACCCTCCGAAC
CTAAGAGTAGCTCGACACGGCT



I think the $aln object is OK, as I can use it with SimpleAlign.

Moreover, if I write
          print $jcmatrix;
instead of
          print $jcmatrix->print_matrix;
I get the memory reference, as normal===> ARRAY(0x859f08)

So my question is:

Why do I have an unblessed reference?

Can't call method "print_matrix" on unblessed reference at Tree.pl line 32, <GEN0> line 44.

Thank you very much in advance.

Jose G.

_________________________________________________________________
Hay tantos ordenadores como personas. ¡Descubre ahora cuál eres tú!
http://www.quepceres.com/



More information about the Bioperl-l mailing list