I´m doing some analysis of my data with Perl, using a specific package of BioPerl.
I read some recommendations about this problem in another post, but I really don´t understand how this applies to my script.
This is my script:
use strict;
use warnings;
use Bio::AlignIO;
use Bio::Align::DNAStatistics;
my $file = $ARGV[0];
my $idfile = $ARGV[1];
if ($file eq "" ) {
$file = "NT_MSA_S_protein.fasta";
} elsif ($idfile eq "" ) {
$idfile = "NT_ID_S_protein.csv";
}
my @contentIDS;
open (LIST, $idfile) or die;
while (my $l = <LIST>) {
$l =~ s/\n//g; # delete newline
$l =~ s/\r//g; # delete CR
next if (length($l) < 1);
push @contentIDS, $l;
}
close LIST;
my $stats = Bio::Align::DNAStatistics->new();
my $alignin = Bio::AlignIO->new(-format => 'fasta', -file => $file); # MSA file
while (my $aln = $alignin->next_aln) {
my $matrix = $stats->distance(-align => $aln, -method => 'Tajima-Nei');
WL1:
foreach my $aaa (@contentIDS) { ### ID #1
WL2:
foreach my $baa (@contentIDS) { ### ID #2
next (WL2) if ($aaa eq $baa);
my $data = $matrix->get_entry($aaa, $baa);
print "DISTANCE\t$aaa\t$baa\t$data\n";
} # END WL2
} # END WL1
}
This is the message error:
Can't locate object method "get_entry" via package "0" (perhaps you forgot to load "0"?) at Tajima-Nei_Distance_NV.pl lin$
I think that the problem is related to "=> instead ->", maybe. I just suppose.