-
Notifications
You must be signed in to change notification settings - Fork 1
Code
The code used to produce the results presented in the paper. All the code files are located in this repository under a folder with the same name.
Open the R project file (softimpute.Rproj) in the main repository folder. This will automatically set the working directory so the scripts run properly. From there, you can run the relevant scripts to reproduce the results.
This script contains the main code producing the results in the paper. It contains:
- Island-scale prediction.
- Jaccard analysis
- Distance decay
- Correlations
emln dataset no. 60: dataset of plant-pollinator interactions collected in the canary islands that was archived in the emln R package. used to build the layers of the network.
data/distance_between_sites_canary.csv: used to calculate correlations in the analysis. Taken from the paper that collected the data.
results/predictions_island_scale.rds: The results of the link prediction. used for further analysis in the same scripts as well as in other scripts
Plots:
results/paper_figs/optimal_threshold.pdf: figure S8
results/paper_figs/predicted_original.pdf: figure S10
results/paper_figs/pr_roc.pdf: figure S9
results/paper_figs/hist_f1a_legend_bottom.pdf: figure 2b
results/paper_figs/netsize_f1_nnse.pdf: figure S13
netdensity_f1_nnse.pdf: figure S5
degree_unobserved_links.pdf: figure 3c
map_missing_links.pdf: figure 3a
map_missing_links_diags_offs.pdf: figure S11
pie_chart.pdf: figure 3b
island_heatmap_f1.pdf: figure 2c
degree_occurrence.pdf: figure S12
results/paper_figs/isl_jaccard_distance.pdf: figure 4 \
This script handles a sensitivity analysis to check the combined effect of different Ks and lambdas.
results/predictions_island_scale.rds: The predictions found by Abramov_et_al_spatial_prediction_analysis.R script
plot: boxplot to visualize f1s for each lambda and K tested. not saved in a new file.
This script contains the code for site scale analysis. It contains:
- Island-scale prediction.
- Jaccard analysis
- Distance decay
- ecological inference
emln dataset no. 60: dataset of plant-pollinator interactions collected in the canary islands that was archived in the emln R package. used to build the layers of the network.
data/distance_between_sites_canary.csv: used to calculate correlations in the analysis. Taken from the paper that collected the data.
results/predictions_site_scale.rds: The results of the link prediction, but this time, site scale.
Plots:
hist_f1_site.pdf: figure S3
site_netsize_f1_nnse.pdf: figure S6
site_netdensity_f1_nnse.pdf: figure S7
site_heatmap_f1.pdf: figure S2
jaccard_site_f1.pdf: figure S4
cor_plot_site_dif_f1.pdf: figure S5
nnse_f1_scales.pdf: figure S1 \
This script contains the code to compare prediction quality when using the entire species pools of A and P for prediction vs. prediction done based on subsetting only the species they share.
emln dataset no. 60: dataset of plant-pollinator interactions collected in the canary islands that was archived in the emln R package. used to build the layers of the network.
results/predictions_island_scale.rds: The results of the link prediction, on the island scale (only if it didn't exist already).
Plots:
subset_analysis.pdf: figure 2a,b