[Bioperl-l] Bio/Align/DNAStatistics.html print$jcmatrix->print_matrix;
Mark A. Jensen
maj at fortinbras.us
Mon Sep 14 17:00:24 UTC 2009
Hi Jose--
I don't get any problem with your script as written. You should upgrade to
BioPerl 1.6 and try again.
The "unblessed reference" is $jcmatrix. It may be undef for some reason.
MAJ
----- Original Message -----
From: "Jose ." <joseguillin at hotmail.com>
To: <bioperl-l at bioperl.org>
Sent: Monday, September 14, 2009 8:48 AM
Subject: [Bioperl-l] Bio/Align/DNAStatistics.html print$jcmatrix->print_matrix;
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/
_______________________________________________
Bioperl-l mailing list
Bioperl-l at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list