Tuesday, September 3, 2013

Fixed error in resampling in ENMTools 1.4.3

I've fixed a bug in 1.4.3 that kept the "resample from raster" command from printing results to the output file.  It was a very silly error; basically I had disabled printing for debugging and forgot to turn it back on!

Anyway, it's fixed now and should be working fine.  While I was at it, I fixed it so that the resample command now uses the output directory set in the ENMTools Options tab, instead of printing to the directory where the layers you're resampling from are located.  The new version is here:

http://www.danwarren.net/enmtools/builds/ENMTools_1.4.3.zip

38 comments:

  1. Hi Dan,

    Great set of tools you have here. While trying to run an identity test in version 1.4.3, I'm getting the following error:

    Can't open G:/Research/Maxent_results/WorldClim/Fremont_genetics/8ClimVar_current/ENMTools/NicheIdentityTest_2/Populus california_rep0.asc!!


    while executing
    "::perl::CODE(0x45c95a8)"
    invoked from within
    ".b5 invoke "
    invoked from within
    ".b5 instate !disabled { .b5 invoke } "
    invoked from within
    ".b5 instate pressed { .b5 state !pressed; .b5 instate !disabled { .b5 invoke } } "
    (command bound to event)

    Any thoughts you have on how to address this error would be much appreciated!
    Cheers,
    Dana

    ReplyDelete
    Replies
    1. Hi,
      I am Daniel Romero-Álvarez. I had a similar error but with the background similarity test. I solved it by changing the path directory of JAVA in a folder. It looked like the program couldn't recognise the proper path to open the program. You can review a tutorial about this issue here: https://goo.gl/ncKk3x

      Delete
  2. Hi Dana! It's hard to tell just from this error what's going on, but clearly ENMTools isn't finding the Maxent output where it expects it to be. That usually means that Maxent has failed for some reason. Did the test generate a csv file for the replicates in your working directory? If so, does that file look right when you open it?

    ReplyDelete
    Replies
    1. There's a csv file labeled Populus california predicting Populus arizona (which has the pops and lats and longs, identical to what my input csv file has except "rep" is in the name) and another labeled Populus california predicting Populus utah which is blank.

      Delete
  3. So the reps file has the exact same data points? And the same number of them?

    ReplyDelete
    Replies
    1. Yup, same data points (i.e., same lat and long) and the same number of them, just in a different order. I was doing only one rep, instead to the initial 50 I was running, to see if I could figure out where the issue was.

      Delete
    2. Hi Dana and Dan,
      I've been having the same problem lately. The error message is the same, and the csv file is generated, but speciesname_rep0.asc is not created. Interestingly, this error only occurs when I try to incorporate a bias file in the identity test. At first, I thought that my bias file was in the wrong format but it works fine when I run it directly through Maxent. Have you try your analysis with and w/o a bias file Dana?

      Delete
    3. Hi Christopher,
      I'm not using a bias file. This may be different, since I do have the "..._rep0.asc" file. It just seems like the program can't grab it for some reason.

      Delete
  4. I'm guessing the two problems are actually different - this error is pretty generic and uninformative. Do the two of you have Dropbox? If you can send me a link to a folder containing your data, I'll take a look.

    Christopher, if you want to just get going immediately, you can probably use your reps file and run it in Maxent manually with your bias file. From there you can measure the overlaps using the methods outlined here:

    http://enmtools.blogspot.com.au/2009/10/how-to-run-enmtools-tests-on-cluster-or.html

    ReplyDelete
  5. I sent an invite to my dropbox folder to your gmail account.

    ReplyDelete
  6. Hi, I'm really new to MaxEnt, ENMTools etc. I just want to check for multicollinearity between variables but I can't open the ENM tools program. I've downloaded perl and am trying to use that to launch it but I'm struggling as I've never used Perl either. I don't have an option for Tk+, just Tk. I've tried launching ENMtools from windows explorer and as a command prompt in perl but I can't be doing it right. Any tips on how to launch the program?

    ReplyDelete
  7. Is this the ActiveState Perl distribution? If not, use that - it should have everything already included.

    ReplyDelete
    Replies
    1. Dear Warren, I have the same problem as Claire, I can't find TK+ on ActivatePerl distritution. I am looking for this package in perl package manager web site but I can´t find it either. Can you giveme some way to install this package in Perl distribution?

      Thanks!

      Delete
    2. If you've installed Activestate's Perl distribution, Tk+ should be included with it. You shouldn't have to install it manually unless they've changed something.

      Delete
    3. Hi Dan,I also have same problem with Claire and AntiR, Tk+ seemed to be missing the list

      Delete
    4. Did you install ActiveState Perl? I'm afraid I don't have the ability to troubleshoot issues with the Perl version of ENMTools very well any more.

      Delete
  8. Hi Dan,
    I have the same problem as Dana:
    Can't open C:/Users/guille/Documents/ENMtools/ENMTools_1.4.3/DatosENMtools/ResultadosENMtools/Delphinus delphis_rep0.asc!!
    while executing
    "::perl::CODE(0x3d3a090)"
    invoked from within
    ".b5 invoke "
    invoked from within
    ".b5 instate !disabled { .b5 invoke } "
    invoked from within
    ".b5 instate pressed { .b5 state !pressed; .b5 instate !disabled { .b5 invoke } } "
    (command bound to event)

    I don't have quotation marks in my .cvs files
    How I can solve it?
    Cheers,
    Guille

    ReplyDelete
  9. Are you on a Mac? Did you check your .csv files in a text editor to see if they have Mac line endings?

    ReplyDelete
    Replies
    1. Hi Dan. Apologies for my delay: I can just resume my work. I'm not on a Mac. I check my .csv files and any line or strange symbol does not appear in these.

      Delete
    2. Hi everyone!,
      I made a tutorial about a similar issue regarding the background similarity test and this error. You can review it here: https://goo.gl/ncKk3x (youtube). It looked like the program couldn't find the proper directory to open JAVA.
      Please let me know if it worked for you.
      Cheers!
      Daniel

      Delete
  10. Great article , if you want any help please click this link its provide good solution of your problem.
    Fix Windows 7 Error 1068
    Thank you
    Aalia lyon

    ReplyDelete
  11. Dear Dan,
    I´m trying to make a niche overlap measurements between several pairs of replicas I generated in Maxent. However, I have noticed that the result depends on which file is first or above. It makes no sense to me. Any opinions or suggestions you have on how to address this issue would be greatly appreciated!!!
    Thanks in advance,
    My best,
    Lázaro Guevara

    ReplyDelete
  12. I have never seen that happen before. Could you send me some of your .asc output files? You're not measuring overlap between species on different geographic backgrounds, are you?

    ReplyDelete
  13. Yes Dan, sp 1 and sp 2 are allopatric populations (on different backgrounds). Let me explain. Originally, background test generates a null distribution for the ENM difference expected between sp1 and occurrence points placed at random within the background of sp2. But, I note that each replicate based on random points is calibrated through the range of both species (It is true?). Thus, I´m using Maxent to calibrate each replicate strictly within the background of species 2. At end, my similarity test compares the actual similarity of the ENMs for sp1 calibrated within their range and sp2 calibrated within their range to the distribution of similarities obtained by comparing the ENM for sp1 to ENM´s -using random points- calibrated exclusively in the background for sp2. The analysis is repeated in the other direction. For that reason, my niche overlap is between .asc files with different geographic backgrounds. Does it make sense? Here, the results depend on which ascii file is load first in ENMTools.
    Thanks in advance!!

    ReplyDelete
  14. I'm not sure I entirely understand, but if you're calculating overlap between .asc files with different geographic extents that's a huge problem. The metric just doesn't work in that sort of situation - it's only meaningful when both .asc files have the exact same coverage. If you need to compare allopatric populations, I'd recommend using the methods in the Broennimann et al. paper from a few years back.

    ReplyDelete
  15. Hi Dan... I'm really new to ENMTools... I want to use to compare models’ predictions, measure niche breadth and niche similarity to determine niche overlap.... the user manual said double click the appropiate executable that it is a ENMTools......exe, but I downloaded the zip files and this file .exe is not there... then what I do?... thanks a lot for your help

    ReplyDelete
  16. I have the same problem. How did you solve it?

    ReplyDelete
  17. I have the same problem. How did you solve it?

    ReplyDelete
    Replies
    1. There's no way around this now except to install Activestate Perl and run it as a perl script. There's a short discussion of the reasons for this here:

      http://enmtools.blogspot.com.au/2012/11/testing-new-version-of-enmtools.html

      Delete
  18. Hi everybody!
    Just to make sure it can come in handy, I made a tutorial about how to overcome two common errors when performing the background similarity test. The first is related with ENMTools not opening the correct Java path directory; and the other has to do with the fatal error when maxent is running. Please let me know if it helps. youtube: https://goo.gl/ncKk3x).
    Kind regards
    Daniel

    ReplyDelete
    Replies
    1. Hello Daniel
      I did exactly the same as you mentitioned in your youtube tutorial, but i still get the same error. Do you have any other tips how i can solve it?
      Best regards.

      Delete
  19. Hello Dan et al.!
    I hope I am posting this question in the correct space. I am new to ENMtools, but I am very impressed with the tools! I am trying to run the resampling from raster tool and sample with NO replacement (69 points per replicate / 999 replicates) for the purpose of building point data to ultimately make a null model of AUC values. Each time I try to run without replacement, the program stalls at somewhere around 60-100 replicates. However, when I run WITH replacement, the program runs like a charm for 999 reps. Can you make any suggestions for me? Thank you, Jessica Beckham

    ReplyDelete
  20. Hi Jessica! Hard to say. What do you mean when you say it stalls? Does it give you any message?

    ReplyDelete
    Replies
    1. Hi Dan! Sorry, I will try to be more clear (though forgive me for not having all of the correct computational terms). So it just stops producing any more output ... to speak literally, the numbers in the Perl window stop moving? There is no error message, but no output is produced past the point at which it has stopped. The output file can only be opened as read-only, so I think the program is still running. When I try to force closing the program I get a "this program is not responding" sort of message. Any suggestions? Again, this only happens when I run WITH replacement. If I run without replacement, there is no problem.

      Delete
    2. Oh, actually, when I force close, the Windows error message is exactly: "Perl Command Line Interpreter has stopped working"

      Delete
    3. That message is just due to the forced close, I think.

      My best guess as to what's happening here is that it's not actually malfunctioning; it's just extremely slow. The method that the Perl version of ENMTools uses for sampling without replacement is fairly inefficient, and can take a very long time. My suggestion would be to do this in R instead, using the randomPoints function in dismo. It is much, much faster.

      Delete