[Bioperl-l] dnastatistics

Jose . joseguillin at hotmail.com
Tue Sep 22 14:39:52 UTC 2009



Hi Liam,
I've tried analyzing the same alignment with both softwares (DNAStatatistics and dnadist), using the same analysis method (Jukes-Cantor), and I got pretty much the same results:

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;
RESULT:A              0.00000  0.40900  0.41834  0.38044B              0.40900  0.00000  0.41358  0.37240C              0.41834  0.41358  0.00000  0.37809D              0.38044  0.37240  0.37809  0.00000

I used the web-based dnadist  ( http://mobyle.pasteur.fr/cgi-bin/portal.py?form=dnadist ), which is mentioned in the CPAN-dnadist documentation ( http://search.cpan.org/~birney/bioperl-run-1.4/Bio/Tools/Run/PiseApplication/dnadist.pm ),  setting Jukes-Cantor as Distance (D), and these are the Results:    4
A          0.000000 0.408996 0.418335 0.380436
B          0.408996 0.000000 0.413575 0.372400
C          0.418335 0.413575 0.000000 0.378086
D          0.380436 0.372400 0.378086 0.000000The difference is because of rounding off.Could it be by any chance that your analysis were made using two different methods, by default? (I think dnadist uses F84 instead of Jukes-Cantor by default). 

Using F84 instead of Jukes-Cantor in dnadist gives:
    4
A          0.000000 0.470013 0.479477 0.435071
B          0.470013 0.000000 0.468730 0.417669
C          0.479477 0.468730 0.000000 0.421582
D          0.435071 0.417669 0.421582 0.000000

On the other hand, DnaStatistics documentation offers the possibility of using F84, but it's not yet implementedMSG: Abstract method "Bio::Align::DNAStatistics::D_F84" is not implemented by package Bio::Align::DNAStatistics.
This is not your fault - author of Bio::Align::DNAStatistics should be blamed!



So, I think Jukes-Cantor works the same in Bio::Align::DNAStatistics and web-based dnadist; but other methods maybe not.
I want to thank you for letting me know about Data::Dumper, I've read the documentation and seems very handy. I think it could help me sooner or later. I'll try it out!!As I'm using DNAStatistics for a project, please let me know if you find what is wrong; or if I can help you further somehow.
Regards,
Jose G.




Subject: dnastatistics
From: lelbourn at science.mq.edu.au
Date: Tue, 22 Sep 2009 17:14:44 +1000
CC: maj at fortinbras.us; bioperl-l at bioperl.org; joseguillin at hotmail.com
To: jason at bioperl.org



So I also had no problem running the code as written by Jose (Bioperl 1.6.0, perl 5.10), but in the documentation for DNAStatistics it says:
"The routines are not well tested and do contain errors at this point. Work is underway to correct them, but do not expect this code to give you the right answer currently!"!
So I'm using dnadist (as I think the documentation recommends), and it does produce different numbers to $stats->distance(-).
I tried write_matrix from Bio::Matrix::IO - got a message saying it hasn't been implemented yet?
And if Jose hasn't already found it, try Data::Dumper; it will change your life....
Regards,Liam.
On 15/09/2009, at 3:54 AM, Jason Stajich wrote:Yeah it seems like more of a bioperl problem -- possible that the older code didn't recognize 'jukes-cantor' but you can try the abbreviation 'jc' -- better to just upgrade tho!

This isn't the cause of the problem but I would also encourage use of Bio::Matrix::IO for printing the matrix (use the 'write_matrix' function) rather than print_matrix on the matrix itsself.

-jason
On Sep 14, 2009, at 10:00 AM, Mark A. Jensen wrote:

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
CGATGATTGGGTTGCTTTATAGTCTAGCTGCAAGGTTTTGCGTTCTGGTGGGAAGCGGSubject: Re: [Bioperl-l] Bio/Align/DNAStatistics.html
	print$jcmatrix->print_maCA
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


_______________________________________________
Bioperl-l mailing list
Bioperl-l at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l

--
Jason Stajich
jason.stajich at gmail.com
jason at bioperl.org


_______________________________________________
Bioperl-l mailing list
Bioperl-l at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/bioperl-l


______________________________


_________________________________________________________________
Comparte tus mejores momentos del verano ¡Hazlo con Windows Live Fotos!
http://www.vivelive.com/compartirfotos



More information about the Bioperl-l mailing list