Thursday, October 13, 2016

Nice tutorial on conducting background tests using the Perl version of ENMTools

Here's a really nice tutorial by Daniel Romero on how to do the background test in the standalone version of ENMTools.  He walks you through setting up the program, running the analysis, and how to avoid some of the errors that might crop up when trying to run the software.

Thanks, Daniel!

23 comments:

  1. Hi Dan!
    Thank you for sharing the tutorial. A pleasure to work with ENMTools.
    Best wishes

    ReplyDelete
  2. Hi, let me ask an offtop question: is there "resampling from a raster" function in R version of ENMTools?

    ReplyDelete
  3. Not at present, but dismo has a function called randomPoints that can do it. If I recall correctly it doesn't allow sampling with replacement, but you can hack it to do so fairly easily.

    ReplyDelete
  4. Hi, I'm having problems to run my background test and after a lot tempts, I still didn't figure out what is the problem. The program keeps showing the error "missing some spatial data (ex. Alt)", but I already checked it and I cliped my background's area using the layer of Alt. I really don't know what to do anymore. -.-

    ReplyDelete
    Replies
    1. Can you use the background points file it generated and extract the values from your rasters at the background points? That would probably tell you where you're getting nodata values.

      Delete
    2. Yes, I can. I'll try it. Thank you. I forgot to tell that all this trouble started when I ran the analysis and all my spreedsheets came showing 100 identical values os d, i and rr. So I tried to redo the background asc and now I have this new problem.

      Delete
  5. Hi Dr. Warren and more experienced ENMTools users,
    I am trying to do a background test in the standalone version of ENMTools using a mask for background area. So far I've found your instructions in the user manual and Dr. Romero-Alvarez's video very helpful but I am having a few issues. I am using the up to date version (1.4.4). In my tests it runs all the way through and produces outputs but in the main results csv all the D and I values are 1 which seems unlikely given the distribution of the species in question. Also when I go to set up the analysis I am missing the regularization parameter and remove duplicate options in the GUI. Also I would like to add a bias grid but can't find how to incorporate that into this analysis. Any suggestions would be greatly appreciated.
    Thank you,
    Nick

    ReplyDelete
    Replies
    1. Can you find your reps file and run it in Maxent manually?

      Delete
  6. Thanks for such a quick response, I really appreciate the help. The rep file would be the Sp1_versus_Sp2_reps.csv correct? Pardon my inexperience but how do I run the actual comparison in Maxent? Do I just treat each rep as it's own species under my preferred parameters for Sp1 and then come back and measure niche overlap for each output paired with the Sp1 in ENMtools?

    ReplyDelete
    Replies
    1. I just meant for you to try to run it, to make sure it's working correctly.

      Delete
    2. Pardon me, yes, I found it and the reps ran well in Maxent.

      Delete
    3. Right on. Well assuming it's producing output rasters, you can use the method outlined here:

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

      Delete
  7. Hi Dr. Warren,
    I'm hoping I could steal a moment more of your time to clarify some issues I've been having regarding the background similarity test. I went through the instructions for running these analyses as independent jobs you suggested. Although I think I understand the process I have a few things I am still confused about.

    First, the "simple no-frills script" that allows me to analyse the replicates, is that the same as the splitcsv.pl under the downloads? The in text link is dead. If so, why do I need to separate the reps file in this case? If I'm going to run them all in maxent can I not run the reps all at once on the same enviromental layers?

    More to the heart of my issues, I can get ENMtools to run Background test but I as I had mentioned I would like to incorporate the regularization multiplier and bias file from my highest scoring models so I am trying to run the background points generated in the reps file as observations to generate an .asc background file with my preferred settings.
    Am I running this correctly if my background/rep points from taxa A are combined environmental layers from taxa A even though they will eventually be compared to the observation/predictions of taxa B? My worry is that seems like an Identity test?

    I then take these asc files and run them as a script in ENMtools measureOverlap,c:/*PATH*/taxa_A.asc,c:/*PATH*/taxa_Bbakgnd_rep1.asc,testing_BackgroundOverlap1
    outputs measureOverlap,c:/*PATH*/taxa_A.asc,c:/*PATH*/taxa_Bbakgnd_rep2.asc,testing_BackgroundOverlap2
    ...

    Then compare the expected distributions generated here to the observed D and I statistics from the taxa models?

    Is that what you are suggesting I do here?
    Again I appreciate your time and any advice would be most helpful,
    Best,
    Nick

    ReplyDelete
  8. Splitting it into separate files was for running it on a cluster, where you're running a bunch of simultaneous Maxent instances. You don't have to do that at all if you're just going to run it all together.

    For your second question, I'm not actually sure what you mean. How can your points be environmental layers?

    ReplyDelete
  9. Sorry, I think my confusion is reflected in the way I am wording things.
    I am running the rep points generated by ENMtools as psuedopresence points to test the background correct? To generate an output using my preferred settings I will have to run it in maxent manually. So the issue I am having is I want to use the rep files to generate a prediction of the background from taxa B for comparison to observations from taxa A. Given that these taxa are parapatric predictions from the rep file psuedopresence points (taxa B) will have to generated using environmental layers for taxa B.

    My worry is that it in the end, I am comparing observations of taxa A to psuedopresence points of taxa B is that not just an identity test?

    ReplyDelete
    Replies
    1. The identity test compares the observed overlap between the points to a pair of species to random draws to the combined set of points from both species. The background/similarity test is drawing random points from the background of B, not using the real points for the species.

      Delete
  10. Dear Dan,
    I get the following error message when running enmtools 1.3:
    Can't open D:/ENMOUTPUTS/Ageratina adenophora.asc! at ENMTools_3-17-2011.pl line 5078, line 13.

    Can't open D:/ENMOUTPUTS/Ageratina adenophora.asc! at ENMTools_3-17-2011.pl line 5078, line 13.

    while executing
    "::perl::CODE(0x2f35ed4)"
    invoked from within
    ".b5 invoke "
    invoked from within
    ".b5 instate {pressed !disabled} { .b5 state !pressed; .b5 invoke } "
    (command bound to event)
    What could be the cause?
    I set up the focal species occurrence as CSV file generated while modelling in maxent and the asc file from the maxent output

    ReplyDelete
  11. 1. Try making a folder within your output folder called "plots" and see if that fixes it.

    2. If not, try running your *reps.csv file manually in Maxent and see if you get any errors.

    ReplyDelete
  12. Dear Dr. Warren, I get the following error message when running enmtools 1.3:
    Can't open C:/Users/pc_coni/Desktop/MODELADO DE NICHO/MODELOS_NORTEAMERICA_WC2/imperata brevifolia_rep0.asc!!




    Can't open C:/Users/pc_coni/Desktop/MODELADO DE NICHO/MODELOS_NORTEAMERICA_WC2/imperata brevifolia_rep0.asc!!


    while executing
    "::perl::CODE(0x3adee34)"
    invoked from within
    ".b5 invoke "
    invoked from within
    ".b5 instate {pressed !disabled} { .b5 state !pressed; .b5 invoke } "
    (command bound to event)
    I am sure my .csv files are right because I can model with maxent. Please I need your help

    ReplyDelete
    Replies
    1. Can you find the reps.csv file made by ENMTools and see if it can be run in Maxent? Not your original data, the one the program made.

      Delete
  13. Hi, What is "Bias File" in ENMTools software? or what data should i put in this section?

    ReplyDelete