1 / 20

Python Tool to create genetic Divergence landscapes

Python Tool to create genetic Divergence landscapes. William Perry U.S. Geological Survey Western Ecological Research Center Geography 375 Final Project May 22, 2013. Background. Rapidly growing field of landscape genetics in ecological research

Download Presentation

Python Tool to create genetic Divergence landscapes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Python Tool to create genetic Divergence landscapes William Perry U.S. Geological Survey Western Ecological Research Center Geography 375 Final Project May 22, 2013

  2. Background • Rapidly growing field of landscape genetics in ecological research • Promising approach using GIS visualization and analysis of genetic landscapes • Allows users to map patterns of genetic divergence and diversity • Need to automate a series of steps to create these genetic landscapes • Python tool speeds up work and reduces error in complex, repetitive workflows Python Script Script Output

  3. Script Overview Three Main Sections - • Read in species point data, create TIN edges with midpoints, • join back to points to create composite key 2. Read in file with genetic distance data, create composite key, join back to the species midpoints file 3. Create single species genetic surfaces

  4. Input data Species collection points Table with genetic distance values

  5. Python Script • Read in species point feature class. • Create TIN • Edit TIN to add in the species point information. • Create TIN triangle polygons and TIN edges. • Convert feature vertices to points from TIN edges. • Add XY coordinates to the Mid points of TIN edge. • Make Table view to do a spatial join between input points and TIN edge lines • Add field to store genetic distance data • Add fields to store unique composite key to start and end population names. • Read in dbf file containing genetic data. • Create composite key for start and end populations. • Create genetic landscape surface using IDW interpolation. • Clip genetic landscape surface to study area grid. • Create Minimum, Maximum, AllNegative, Allpositive grids using Map Algebra. • Divide the species grid by the Maximum grid to get standardized grid.

  6. Python Script Script Info

  7. Python Script Create variables for tool dialog Set the workspace

  8. Python Script Create scratch geodatabase

  9. Python Script Create TIN, edit TIN, create TIN edges, start, end and mid points Add XY coordinates to TIN midpoint file

  10. Python Script Spatial join from TIN edge start points back to point features Spatial join from TIN edge end points back to point features

  11. Python Script Add fields, create composite key Read in file with genetic distance values Add fields, create composite key

  12. Python Script Write genetic values to species midpoints Create the genetic surface using IDW, clip to study area grid, then clip to TIN polygon tag file

  13. Python Script Create grids needed for final output grid Create final standardized grid and grid with raw values

  14. Files Created

  15. Tool Dialog in ArcMap

  16. Tool runs successfully!

  17. Tool Output

  18. Obstacles Encountered • Exported python from ModelBuilder for code outline • Numerous changes required to get tools to function in python • Changes in tool syntax between ArcGIS versions (Map Algebra) • Excel files not supported in x64 version of python! • Additional troubleshooting required to run as tool in ArcGIS

  19. Test script for 64 vs 32 bit python to read in Excel files Batch file to run 32 bit version of python

  20. Future Enhancements • Add support for additional input formats (csv) • Finish polishing script and include with toolbox for distribution • Customize script tool behavior using python validation

More Related