-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running SS_optim #44
Comments
By default, 'Distance' will be assessed as part of the outputs. Do you mean that Distance is identified as the best supported? |
Thanks for the reply. No I am referring to the "Distance" transformation used on continuous variables. From what I can make out from the source code 'GA.prep' uses the 'Resistance_transform' function for the transformation of continuous variables. When setting 'select.trans = list()' as "M","A", or "R", it also included the "Distance" transformation ("9"), however even when I set 'select.trans = list(3)' which from my understanding should only the "Monomolecular" transformation, the results in my 'ContinuousResults' output file still appear to show the "Distance" transformation equation is being used, as per below: Surface | obj.func_LL | k | AIC | AICc | R2m | R2c | LL | Equation | shape | max I'm happy to share my data if that helps. |
Whenever you see |
Thanks Bill, I'll try with more iterations and see if that fixes it. |
I've run the optimisation again with the 'run=500' but I'm still having the same issues. The optimisation test was run with an elevation raster and my GA.prep parameters and an example of my output is below. Any suggestions? GA.inputs <- GA.prep(ASCII.dir = rast_cropped, GA | iter = 490 | Mean = -100692.4 | Best = -99999.0 |
Can you share the files you're using? I can take a look at things and see if anything jumps out to me. You can send files or a link to [email protected] |
Hi there,
I've been trying to run ResistanceGA optimisation for the following categorical and continuous surfaces:
These rasters are in .asc format and are at a resolution of 10km due to the total area being large and the study species dispersal and home range size (red fox). I am running SS_optim to optimise each raster independently as I have found this to run much faster than running as a raster stack. I am also running 2 replicates of each optimisation.
JULIA_HOME <- "C:/Users/User/.julia/juliaup/julia-1.10.0+0.x64.w64.mingw32/bin" # Change to your julia bin location.
JuliaCall::julia_setup(JULIA_HOME, useRCall = TRUE)
Load in sample coordinates
sample_points <- read.table("C:/ResistanceGA_input/25-7-2024_inputs/Coords/Ch1_neutral_H_EA_xy_coords_adjusted_10km.txt", header = TRUE, sep = " ", row.names = 1) # Set path to coordinates CSV or you genlight@other@latlong here
sp.dat <- SpatialPoints(sample_points[, c("X", "Y")], proj4string = CRS("+proj=aea +lat_0=0 +lon_0=132 +lat_1=-18 +lat_2=-36 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs"))
Load genetic distance matrix
GD <- read.table("C:/ResistanceGA_input/25-7-2024_inputs/GD/Ch1_neutral_H_EA_GD_GenAlEx.txt", header = TRUE, row.names = 1, sep = " ")
Load single raster file or raster stack (change for each landscape variable)
Raster_layer <- raster("C:/ResistanceGA_input/25-7-2024_inputs/Rasters/H_EA/10km/ASC_files/Cropped/H_EA_Elevation_10km_crop.asc")
Set variables
GA.inputs_1 <- GA.prep(ASCII.dir = Raster_layer,
Results.dir = "C:/ResistanceGA_output/9-7-2024/H_EA/10km/Elevation/Test/Run_1/",
parallel = 7,
seed = 111,
cat.levels = 10,
min.cat = 0,
select.trans = list("A"))
GA.inputs_2 <- GA.prep(ASCII.dir = Raster_layer,
Results.dir = "C:/ResistanceGA_output/9-7-2024/H_EA/10km/Elevation/Test/Run_2/",
parallel = 7,
seed = 112,
cat.levels = 10,
min.cat = 0,
select.trans = list("A"))
Set variables to run Circuitscape in Julia
jl.inputs <- jl.prep(n.Pops = length(sp.dat),
response = lower(GD),
CS_Point.File = sp.dat,
JULIA_HOME = JULIA_HOME,
cholmod = T)
Run single surface optimisation for raster layer or all raster layers in a raster stack.
SSoptim_out_1 <- SS_optim(jl.inputs = jl.inputs, GA.inputs = GA.inputs_1)
SSoptim_out_2 <- SS_optim(jl.inputs = jl.inputs, GA.inputs = GA.inputs_2)
The transformation for all of my continuous variable uses the "Distance" transformation regardless if select.trans is set to "A" or "M". I'm trying to understand if this is correct or not or if I am doing something wrong?
The text was updated successfully, but these errors were encountered: