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

19 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
  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
  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
  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