1
$\begingroup$

My third year comp sci friend got me this far, I hope you guys can help me with the last inch! For the record, I have practically no coding experience. I am using the 3.9.4 alpha version of MUMmer.

Here is the manual I have been following: http://mummer.sourceforge.net/examples/

I am at part 2.2.2 Running the Mummer plot, and I type in the final line to generate the plot.

I type:

mummerplot -x "[0,8666124]" -y "[0,9025688]" -postscript -p mummer mummer.mums

And the error is:

Can't use 'defined(%hash)' (Maybe you should omit the defined ()?) at /usr/bin/mummerplot line 884

Line at 884:

if ( defined (%$rref) ) {                                                                                                            #-- skip reference sequence or set atts from hash
        if ( !exists ($rref->{$idR}) ) { next; }
        else { ($refoff, $reflen, $refdir) = @{$rref->{$idR}}; }

Its perl

$\endgroup$
2
  • 1
    $\begingroup$ Hi could you please present your code inline, e.g. copy and paste? It is hard to read as an image. This looks like Perl, could you confirm this? $\endgroup$
    – M__
    Dec 3, 2020 at 8:26
  • $\begingroup$ Cross-posted on biostars: biostars.org/p/476874 $\endgroup$
    – Ram RS
    Dec 3, 2020 at 16:36

1 Answer 1

2
$\begingroup$

I had the same error and I solved by removing defined and writing only if (%$rref) in the mummerplot code. You have to do this for all the lines that you have it. There should be six lines to correct in this way .

You can find an explanation of why here, that tells that the function defined:

Returns a Boolean value telling whether EXPR has a value other than the undefined value undef. If EXPR is not present, $_ is checked.

And then:

Use of defined on aggregates (hashes and arrays) is no longer supported. It used to report whether memory for that aggregate had ever been allocated. You should instead use a simple test for size: if (%a_hash) { print "has hash members\n" }

$\endgroup$
2
  • $\begingroup$ @KamilSJaron thank you but to be honest the code is written in C and I am not really expert on this. Anyway, I tried to add more details that is what has helped to me . $\endgroup$ Jun 3, 2021 at 12:16
  • $\begingroup$ This is totally enough for people to get the idea that it's just an outdated part of the code, good job in figuring it out! $\endgroup$ Jun 3, 2021 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.