Package: graph4lg 2.0.0

graph4lg: Build Graphs for Landscape Genetics Analysis

Build graphs for landscape genetics analysis. This set of functions can be used to import and convert spatial and genetic data initially in different formats, import landscape graphs created with 'Graphab' software (Foltete et al., 2021) <doi:10.1016/j.simpa.2021.100065>, make diagnosis plots of isolation by distance relationships in order to choose how to build genetic graphs, create graphs with a large range of pruning methods, weight their links with several genetic distances, plot and analyse graphs, compare them with other graphs. It uses functions from other packages such as 'adegenet' (Jombart, 2008) <doi:10.1093/bioinformatics/btn129> and 'igraph' (Csardi et Nepusz, 2006) <https://igraph.org/>. It also implements methods commonly used in landscape genetics to create graphs, described by Dyer et Nason (2004) <doi:10.1111/j.1365-294X.2004.02177.x> and Greenbaum et Fefferman (2017) <doi:10.1111/mec.14059>, and to analyse distance data (van Strien et al., 2015) <doi:10.1038/hdy.2014.62>. Recent updates introduce multiple habitat graph functionalities (as described by Savary et al., 2024) <doi:10.1007/s10980-024-01947-4>.

Authors:Paul Savary [aut, cre], Gilles Vuidel [ctb], Tyler Rudolph [ctb], Alexandrine Daniel [ctb], Jong Yoon Jeon [ctb]

graph4lg_2.0.0.tar.gz
graph4lg_2.0.0.zip(r-4.7-any)graph4lg_2.0.0.zip(r-4.6-any)graph4lg_2.0.0.zip(r-4.5-any)
graph4lg_2.0.0.tgz(r-4.6-any)graph4lg_2.0.0.tgz(r-4.5-any)
graph4lg_2.0.0.tar.gz(r-4.7-any)graph4lg_2.0.0.tar.gz(r-4.6-any)
graph4lg_2.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
graph4lg/json (API)

# Install 'graph4lg' in R:
install.packages('graph4lg', repos = c('https://psavary3.r-universe.dev', 'https://cloud.r-project.org'))
Datasets:

On CRAN:

Conda:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

5.18 score 3 stars 1 packages 85 scripts 554 downloads 73 exports 109 dependencies

Last updated from:1579e74e89. Checks:7 NOTE, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develNOTE234
source / vignettesOK346
linux-releaseNOTE256
macos-releaseNOTE187
macos-oldrelNOTE207
windows-develNOTE128
windows-releaseNOTE137
windows-oldrelNOTE141
wasm-releaseOK188

Exports:add_nodes_attrcheck_graphab_objectcheck_graphab_versioncompar_r_fishercompute_graph_modulcompute_node_metricconvert_cddeg2raddf_to_pw_matdist_gc_hvsdist_gc_slcdist_gc_vicentydist_great_circledist_max_corrg_percolgen_graph_indepgen_graph_thrgen_graph_topogenepop_to_genindgenind_to_genepopgenind_to_structureget_graphabget_graphab_linksetget_graphab_linkset_costget_graphab_metricget_graphab_raster_codesgini_coeffgraph_modul_compargraph_node_compargraph_plangraph_plot_compargraph_to_dfgraph_to_gpkggraph_to_shpgraph_topo_compargraphab_capacitygraphab_corridorgraphab_graphgraphab_habitatgraphab_interpolgraphab_linkgraphab_merge_graphgraphab_metapatchgraphab_metricgraphab_modulgraphab_pointsetgraphab_projectgraphab_project_descgraphab_showgraphab_to_igraphgstud_to_genindharm_meankernel_paramlink_comparloci_to_genindmat_cost_distmat_gen_distmat_geo_distmat_pw_dpsmat_pw_fstmypalettepatch_areasplot_graph_lgplot_w_histpop_gen_indexpop_rare_gen_indexpw_mat_to_dfreorder_matsample_rastersc01scatter_distscatter_dist_gstructure_to_genind

Dependencies:abindade4adegenetapebase64encbootbslibcachemclassclassIntcliclustercommonmarkcpp11DBIdeldirdigestdplyre1071ecodistfarverfastmapfontawesomefsgastongdistancegenericsggplot2gluegoftestgtablegtoolshierfstathtmltoolshttpuvigraphisobandjquerylibjsonliteKernSmoothlabelinglaterlatticelifecyclemagrittrMASSMatrixmemoisemgcvmimenlmeotelpegaspermutepillarpixmappkgconfigplyrpolyclippromisesproxypurrrR6rappdirsrasterrbibutilsRColorBrewerRcppRcppArmadilloRcppEigenRcppParallelRdpackreshape2rlangrparts2S7sassscalessegmentedseqinrsfshinysourcetoolsspspatstat.dataspatstat.explorespatstat.geomspatstat.linnetspatstat.modelspatstat.randomspatstat.sparsespatstat.univarspatstat.utilsstringistringrtensorterratibbletidyrtidyselectunitsutf8vctrsveganviridisLitewithrwkxtable

1 - Landscape and genetic data processing with graph4lg
Introduction | Data used in this vignette | Genetic data loading and format conversions | GENEPOP to genind | genind to GENEPOP | STRUCTURE to genind | gstud to genind | Genetic diversity assessment | Distance calculations | Genetic distances | Geographical distances | Cost-distances | Processing tools | Reorder a matrix | Convert Euclidean distances into cost distances | From pairwise matrix to data frame | From data frame to pairwise matrix | Conclusion | References

Last update: 2026-09-24
Started: 2020-07-22

2 - Genetic graph construction and analysis with graph4lg
Introduction | Data used in this vignette | Preliminary analyses: diagnostic plots | Distance of maximum correlation | IBD pattern as a scatter plot | Genetic graph construction | Pruning based on distance thresholds | Pruning based on topological constraints | Pruning based on the conditional independence principle | Genetic graph analysis | Computing graph-theoretic metrics | Graph partitioning | Visual analysis | Export to geopackage layers | Conclusion | References

Last update: 2026-09-24
Started: 2020-07-22

3 - Landscape graph construction and analysis with Graphab and graph4lg
Introduction | What is Graphab? | Data used in this vignette | Landscape graph construction | Project creation | Habitat creation | Link set creation | Graph construction | Landscape graph analysis | Metric calculation | Graph partitioning | Using landscape graphs in landscape genetic analyses | Computational performance | Conclusion | References

Last update: 2026-09-24
Started: 2020-07-22

4 - Landscape and genetic graph comparison with graph4lg
Introduction | Data used in this vignette | Comparing node metrics | Comparing graph links | Comparing graph modules | References

Last update: 2026-09-24
Started: 2020-07-22

Readme and manuals

Help Manual

Help pageTopics
Add attributes to the nodes of a graphadd_nodes_attr
Compute modules from a graph by maximising modularitycompute_graph_modul
Compute graph-theoretic metrics from a graph at the node levelcompute_node_metric
Fit a model to convert cost-distances into Euclidean distancesconvert_cd
data_ex_genind genetic datasetdata_ex_genind
data_ex_gstud genetic datasetdata_ex_gstud
data_ex_loci genetic datasetdata_ex_loci
data_simul_genind genetic datasetdata_simul_genind
data_tuto : data used to generate the vignettedata_tuto
Convert an edge-list data.frame into a pairwise matrixdf_to_pw_mat
Compute the distance at which the correlation between genetic distance and landscape distance is maximaldist_max_corr
Prune a graph using the 'percolation threshold' methodg_percol
Create an independence graph of genetic differentiation from genetic data of class genindgen_graph_indep
Create a graph of genetic differentiation using a link weight thresholdgen_graph_thr
Create a graph of genetic differentiation with a specific topologygen_graph_topo
Convert a GENEPOP file into a genind objectgenepop_to_genind
Convert a genind object into a GENEPOP filegenind_to_genepop
Download Graphab if not present on the user's machineget_graphab
Get linkset computed in the Graphab projectget_graphab_linkset
Get cost values associated with a linkset in a Graphab projectget_graphab_linkset_cost
Get metrics computed at the patch/node level in the Graphab projectget_graphab_metric
Get unique raster codes from a Graphab projectget_graphab_raster_codes
Compare the partition into modules of two graphsgraph_modul_compar
Compare the local properties of the nodes from two graphsgraph_node_compar
Create a graph with a minimum planar graph topologygraph_plan
Visualize the topological differences between two spatial graphs on a mapgraph_plot_compar
Convert a graph into a edge list data.framegraph_to_df
Export a spatial graph to geopackage filesgraph_to_gpkg
Export a spatial graph to shapefile layersgraph_to_shp
Compute an index comparing graph topologiesgraph_topo_compar
Computes custom capacities of patches in the Graphab projectgraphab_capacity
Computes corridors from least-cost paths already computed in the Graphab projectgraphab_corridor
Create a graph in the Graphab projectgraphab_graph
Create a habitat type in a Graphab projectgraphab_habitat
Creates a raster with interpolated connectivity metric values from metrics already computed in the Graphab projectgraphab_interpol
Create a link set in the Graphab projectgraphab_link
Merge graphs in a multiple-graph Graphab projectgraphab_merge_graph
Create a new habitat type made of meta-patches based on inter-patch distances in an existing graphgraphab_metapatch
Compute connectivity metrics from a graph in the Graphab projectgraphab_metric
Create modules from a graph in the Graphab projectgraphab_modul
Add a point set to the Graphab projectgraphab_pointset
Create a Graphab projectgraphab_project
Describe the objects of a Graphab projectgraphab_project_desc
Create landscape graphs from Graphab link setgraphab_to_igraph
Convert a file from 'gstudio' or 'popgraph' into a genind objectgstud_to_genind
Compute dispersal kernel parameterskernel_param
Convert a loci object into a genind objectloci_to_genind
Compute cost distances between points on a rastermat_cost_dist
Compute a pairwise matrix of genetic distances between populationsmat_gen_dist
Compute Euclidean geographic distances between pointsmat_geo_dist
Plot graphsplot_graph_lg
Plot histograms of link weightsplot_w_hist
Compute population-level genetic indicespop_gen_index
pts_pop_ex : details on simulated populationspts_pop_ex
pts_pop_simul : details on simulated populationspts_pop_simul
Convert a pairwise matrix into an edge-list data.framepw_mat_to_df
Reorder the rows and columns of a symmetric matrixreorder_mat
Plot scatterplots of genetic distance vs landscape distancescatter_dist
Plot scatterplots of distances to visualize the graph pruning intensityscatter_dist_g
Convert a file in STRUCTURE format into a genind objectstructure_to_genind