-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbiomodelos_connec.Rmd
More file actions
121 lines (97 loc) · 3.14 KB
/
biomodelos_connec.Rmd
File metadata and controls
121 lines (97 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
title: "Climate adaptive habitat connectivity"
description: |
Using biomodelos as the base layers
author:
- name: Lei Song
url: https://github.com/LLeiSong
affiliation: University of California, Santa Barbara
output:
distill::distill_article:
toc: true
toc_depth: '2'
header-includes:
\usepackage{caption}
\renewcommand{\figurename}{Fig.}
\renewcommand{\thefigure}{S\arabic{figure}}
\renewcommand{\thetable}{S\arabic{table}}
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, eval = FALSE)
```
## Set up the HPC environment
**Step1**. Install R, R spatial packages and R essentials
Note: Due to issues with the SQLite library, these steps have been tested to ensure all packages are installed correctly and function as expected.
```
conda install conda=25.5.1
conda install conda-forge::r-base
conda install r::r-juliacall
conda install conda-forge::r-terra
conda install conda-forge::libsqlite --force-reinstall
conda install conda-forge::r-codetools
conda install conda-forge::r-sf
conda install conda-forge::r-gdalutilities
conda install conda-forge::r-essentials
```
Install other essential R packages
```
conda install -c conda-forge r-stringr r-fastshap r-optparse r-readxl r-rgbif r-here r-devtools
```
**Step2**. Install Julia and Omniscape package
```
# Install Juliaup manager and julia
conda install -c conda-forge juliaup
juliaup add <version> # or juliaup add release
juliaup config channelsymlinks true
# Get the Julia path for R call later
# ~/anaconda3/envs/conn/bin/julia-1.11.3
which julia-1.11.3 # or which julia-release
# Install customized omniscape
using Pkg
]
# Extra steps because of the issue in ArchGDAL
add PROJ_jll@901.300 GDAL_jll@301.900
add ArchGDAL
# Link and compile Omniscape
dev /home/ls1686/Omniscape.jl
using Omniscape
# Add other packages for R
add Suppressor
add RCall
# Log out of conda if necessary
conda deactivate
```
A note for juliaup: there should be a `juliaup.json` file like this:
```
{
"Default": "release",
"InstalledVersions": {
"1.11.3+0.x64.linux.gnu": {
"Path": "./julia-1.11.3+0.x64.linux.gnu"
},
"1.11.4+0.x64.linux.gnu": {
"Path": "./julia-1.11.4+0.x64.linux.gnu"
}
},
"InstalledChannels": {
"1.11.3": {
"Version": "1.11.3+0.x64.linux.gnu"
},
"release": {
"Version": "1.11.4+0.x64.linux.gnu"
}
},
"Settings": {},
"Overrides": [],
"LastVersionDbUpdate": "2025-04-08T22:32:43.036417355Z"
}
```
## Omniscape
A few terms:
**Source strength**: Similar to conductance but represents the number of individuals originating from a given pixel.
**Resistance layer**: The inverse of conductance, representing the difficulty of movement across the landscape.
**Target/ground pixel**: The central pixel within the circular window.
**Source pixels**: All pixels within the circular window that exceed the defined source strength threshold. They are identified similarly to the target pixel.
Omniscape essentially operates Circuitscape in advanced mode, treating the central target pixel as the ground and the source pixels as current sources to model connectivity dynamics.