This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Assemblathon Perl script Error

Trying to run assemblathon_stats.pl to calculate many of the basic contig- and scaffold-level statistics but getting error,

Screenshot below

assembly genome

which version of perl is it?

This is perl 5, version 18, subversion 2 (v5.18.2)

could you try using perl -s assemblathon... and report whether the same errors occur please

actually, ignore that, it sounds like the script was written non-strict but it's running under 'use strict'. Im not sure how to set no strict from the command line. You could modify the scriptand add no strict; just after the shebang line

solved by installing perl version 5.10.0 This script does not work under the latest Perl version, need to install an older version (Perl 5.10.0).

Were you running the most recent version of assemblathon_stats from https://github.com/KorfLab/Assemblathon/blob/master/assemblathon_stats.pl ? I can only assume you aren't since that script seems to be written strictly. Try downloading it again and running it under perl 5.18. Installing loads of different versions of perl on your system doesn't strike me as any kind of solution.

please don't post screenshots of console outputs when a simple copy/paste into the question window using code markup would work.

3 answers

solved by installing perl version 5.10.0 This script does not work under the latest Perl version, need to install an older version (Perl 5.10.0).

Where did you get that script from? Please post the link to download the script or the complete script. Did you change anything?

These are syntax errors thrown when the author of a script forgets to declare a variable, like so:

 use strict;
 use warnings;
 my @seqs = (0, 1, 2, 3); # ok, declared @seqs
 foreach $matches (@seqs) { # not ok, need to declare with my! ICICIC
      $count++ if ($matches > 0); # same here, $count undeclared! ICICIC
 }

This is just an example, nothing to do with the actual script. If you show us the script, we can check what's the best way to fix that.

There is a fix for perl v5.18.2 https://github.com/ucdavis-bioinformatics/assemblathon2-analysis/pull/1/commits

You can fix it yourself by putting parentheses around the qw() in lines 301 and 428:

[original] foreach my $base qw(A C G T N){

[edited] foreach my $base (qw(A C G T N)){

Log in to answer this question.