CS.prep: Prepare and bundle input CIRCUITSCAPE model parameters

View source: R/CS_prep.R

CS.prepR Documentation

Prepare and bundle input CIRCUITSCAPE model parameters

Description

This function will prepare objects needed for running optimization functions

Usage

CS.prep(n.Pops, 
response, 
covariates = NULL,
formula = NULL,
CS_Point.File, 
CS.program, 
Neighbor.Connect, 
pairs_to_include, 
platform, 
parallel, 
cores)

Arguments

n.Pops

The number of populations that are being assessed

response

Vector of pairwise genetic distances (lower half of pairwise matrix).

covariates

Data frame of additional covariates that you want included in the MLPE model during opitmization.

formula

If covariates are included in the model, specify the R formula for the fixed effects portion of the MLPE model.

CS_Point.File

The path to the Circuitscape formatted point file. See Circuitscape documentation for help.

CS.program

The path to the CIRCUITSCAPE executable file (cs_run.exe) on a Windows PC. If using a Linux or Mac system, provide the full path to the "csrun.py" file. See details below.

Neighbor.Connect

Select 4 or 8 to designate the connection scheme to use in CIRCUITSCAPE (Default = 8)

pairs_to_include

Default is NULL. If you wish to use the advanced CIRCUITSCAPE setting mode to include or exclude certain pairs of sample locations, provide the path to the properly formatted "pairs_to_include.txt" file here. Currently only "include" method is supported.

platform

What computing platform are you using ("pc", "other"). This code has only been tested on Windows PC!!!

parallel

(Logical) If using Linux / Ubuntu, do you want to run CIRCUITSCAPE in parallel?

cores

If using Linux / Ubuntu and 'parallel = TRUE', how many cores should be used for parallel processing?

Details

IT IS HIGHLY RECOMMENDED THAT YOU LOOK INTO USING THE JULIA VERSION OF CIRCUITSCAPE. THIS FUNCTION IS NO LONGER BEING ACTIVELY SUPPORTED OR UPDATED. CS.program Example of path to CIRCUITSCAPE executible on Windows:

'"C:/Program Files/Circuitscape/cs_run.exe"'

***NOTE: Double quotation used*** This is the current default for CS.program, but the directory may need to be changed depending upon your installation of CIRCUITSCAPE

Linux To call CIRCUITSCAPE from R on with Linux, first change file permissions from the command line terminal (shortcut: control + alt+ t) ' sudo chomod 755 /usr/local/bin/csrun.py ' Then specify CS.program as 'csrun.py'

Only with Linux, parallel can be set to TRUE, and the number of cores to run in parallel can be specified with cores.

The Linux and Mac versions are in development. Please let me know if you encounter errors.

When specifying a formula, provide it as: response ~ covariate. the formula response will use the vector of values specified for the response parameter. Make sure that covariate names match variable names provided in covariates

Value

An R object that is a required input into optimization functions

Author(s)

Bill Peterman <Peterman.73@osu.edu>

Examples

 
## Not run:
## *** TO BE COMPLETED *** ##

## End (Not run)

wpeterman/ResistanceGA documentation built on Nov. 20, 2023, 11:50 p.m.