Data and code from: Effects of historical isolation and current river fragmentation on the genetic structure of a freshwater fish
Data files
Nov 30, 2026 version files 433.20 KB
-
Data_unformatted.xlsx
321.17 KB
-
Phoxinus_analysis.R
84.08 KB
-
README.md
27.95 KB
Abstract
Habitat fragmentation is a major threat to freshwater biodiversity. In river networks, the dendritic structure of drainage systems can compound the effects of barriers to dispersal, which have greatly increased as a result of anthropogenic activities. Yet, disentangling the relative contributions of these natural and anthropogenic barriers remains challenging. We assessed how historical catchment isolation and contemporary river fragmentation jointly shape the genetic structure of a low‐dispersal freshwater fish, the Pyrenean minnow (Phoxinus bigerri), across northern Spain by genotyping 280 individuals from five independent catchments at 26 microsatellite loci and analysing genetic structure at regional and within‐catchment scales using STRUCTURE. The effects of fragmentation metrics on pairwise genetic differentiation were quantified with Maximum Likelihood Population Effects mixed models, and demographic histories were reconstructed using BOTTLENECK and DIYABC‐RF. Strong genetic differentiation among catchments was consistent with long‐term isolation, while pronounced substructure within several catchments suggested restricted contemporary connectivity. Among fragmentation metrics, the number of barriers between river reaches emerged as the strongest predictor of genetic differentiation, whereas cumulative barrier height and river distance showed weaker effects. Demographic analyses revealed signatures of recent bottlenecks, likely dating to the post‐medieval period and coinciding with intensified human modification of river networks. Together, these findings suggest that contemporary river fragmentation may reinforce genetic differentiation superimposed on older patterns of catchment isolation, highlight the pervasive impact of barriers on connectivity, and provide insights relevant for the conservation and management of fragmented freshwater ecosystems.
Dataset DOI: https://doi.org/10.5061/dryad.fbg79cp9h
Study species: Phoxinus bigerri
Files: Data.xlsx; Phoxinus_analysis_integrated.R
Dataset overview
This dataset contains SSRseq genotypes, genotype-filtering intermediates, allele-size representations, population assignments, STRUCTURE ancestry coefficients, pairwise genetic and river-connectivity measures, water-chemistry dissimilarities, and outputs from demographic analyses of Phoxinus bigerri. The accompanying R script performs population-genetic summaries, visualisations, MLPE model selection, and de novo PCA/K-means/DAPC analyses.
The genetic data are organised at individual level, whereas the MLPE input comprises pairs of sampling sites within the same catchment. The final filtered dataset contains 280 individuals genotyped at 26 SSRseq loci.
Current workbook structure: Data_unformatted.xlsx contains 12 worksheets. The former Summary worksheet was intentionally removed because it was an auxiliary filtering summary. No Summary worksheet is included in the current deposit. The filtering criteria, variable definitions, and key counts previously documented there are now described in Sections 3 and 4 of this README. Consequently, there are no current Summary variables requiring column-level definitions.
Accessibility and data format: The accompanying Data_unformatted.xlsx is distributed as an unformatted, values-only workbook. Decorative cell formatting, conditional highlighting, drawings, filters, hyperlinks, merged cells, external links, and spreadsheet formulas have been removed. Pre-existing numeric results, including the calculated values previously stored in formula cells, have been retained as values. These presentation features and spreadsheet formulas are not required by the integrated R script. The 1stepFiltering and SeqLength sheets retain their original positional layouts; all cells with blank headers are described explicitly below.
General conventions and interpretation keys
| Field or convention | Definition / unit / interpretation |
|---|---|
Indiv |
Unique sample or control identifier (text; no physical unit). A name such as RimSec_Aiz-03-Pho01_A includes the catchment code (Aiz), sampling-site number (03), and individual/sample identification. |
NTC within an Indiv value |
Negative template control, not a biological fish sample (three controls in Raw). |
SSRseq_Phodra_XXX |
SSRseq locus identifier; XXX identifies the locus. Alleles are recorded as numeric allele/fragment lengths or as paired genotype strings, depending on the worksheet. |
_A suffix in Raw or 1stepFiltering column headers |
Second allele of the same diploid SSRseq locus; the corresponding header without _A denotes the first allele. Both are numeric allele lengths (base pairs, bp) or missing. |
| Diploid genotype string | allele1,allele2 (e.g., 121,125): two allele-length values for one locus, in bp. NA,NA indicates a missing genotype. |
pop |
Population/subpopulation assignment code, defined for the relevant worksheet below (categorical; no unit). |
Aiz |
Arantzazu catchment (Aizkorri geographic area). |
Ara |
Agauntza catchment (Aralar geographic area). |
Art |
Añarbe catchment (Artikutza geographic area). |
Gor |
Baias catchment (Gorbeia geographic area). |
Izk |
Izki catchment. |
NA, blank cells |
Missing or non-applicable values, depending on the worksheet. An empty demographic parameter cell means that the parameter was not reported/applicable for that fitted scenario; it is not zero. |
| Sampling-site numbers | Integer identifiers unique within a catchment, not across the entire dataset (no physical unit). |
Workbook: Data.xlsx
Raw
Unfiltered SSRseq allele calls: 285 biological samples plus three negative controls (288 data rows), across 48 loci.
Indiv(column A): individual/control identifier (text).SSRseq_Phodra_XXXandSSRseq_Phodra_XXX_A(columns B–CS): two allele calls for each of the 48 loci, in bp; missing calls are represented byNA.- Negative controls are identified by the
NTCcomponent of theirIndividentifiers.
1stepFiltering
Intermediate quality-control table containing the 285 biological samples after excluding the negative controls and the 26 loci retained after locus-level filtering. The 26 loci are represented by 52 allele columns (B–BA), in bp.
Explanation of the two intentionally blank first-row headers:
| Excel column | Header in row 1 | Values in rows 2–286 | Unit / interpretation |
|---|---|---|---|
| A | Indiv |
Biological sample identifier | Text; no unit |
| B–BA | Named SSRseq_Phodra_XXX / _A pairs |
First and second allele of each of the 26 retained loci | Allele lengths, bp; NA means missing |
| BB | Blank | Number of missing allele entries among the 52 allele columns for that individual (normally two missing entries per uncalled diploid genotype) | Count, from 0 to 52 |
| BC | Blank | 100 × (BB / 52), equivalently the percentage of missing diploid genotypes when both alleles are missing together |
Percent, 0–100% |
The two blank headers have been documented rather than changing the historical sheet layout. These columns are intermediate quality-control statistics and are not independent genetic loci.
Filtered
Final quality-filtered genotype table: 280 biological individuals × 26 SSRseq loci.
| Columns | Meaning | Unit / key |
|---|---|---|
Indiv |
Individual identifier | Text |
SSRseq_Phodra_XXX |
Diploid genotype for each retained locus | allele1,allele2; allele lengths in bp; NA,NA for missing |
pop |
Catchment assignment | One of Aiz, Ara, Art, Gor, Izk |
There are 28 missing diploid genotypes among 7,280 possible individual–locus genotypes (approximately 0.38%).
SeqLength
An allele-size representation prepared for demographic/bottleneck analyses, containing 280 biological individuals, 26 loci, and two numeric allele-size values per locus.
This worksheet uses a two-row, positional header rather than a single conventional header row:
| Cells | Contents | Interpretation / unit |
|---|---|---|
A1 |
BottleneckAnalisis |
Descriptive title/marker, not a sample identifier or measurement |
B1:BA1 |
Blank | No data in the title row |
A2 |
Blank | Header-layout cell, not a missing sample |
B2, D2, ..., AZ2 |
Locus identifiers such as SSRseq_Phodra_008 |
Each named column introduces a pair of adjacent allele-size columns |
C2, E2, ..., BA2 |
Blank | Second-allele column for the locus named immediately to its left; these are intentional positional blanks |
A3:A282 |
Individual identifiers | Text |
B3:BA282 |
Numeric allelic values | Locus-specific allele-size representation (base-pair-length coding); two adjacent values per locus; blank if unavailable |
Thus, for example, columns B and C contain the two allele-size entries for locus SSRseq_Phodra_008; D and E contain the two entries for SSRseq_Phodra_020, etc. The values are locus-specifically recoded lengths for demographic analysis and need not numerically equal the unprocessed fragment lengths in Raw. All 52 numeric columns are meaningful despite the alternate blank labels in row 2. This sheet is a prepared input/representation, not a step that is recomputed by the integrated R script.
FilteredSubPopulations
The same 280 individuals and 26 filtered loci as in Filtered, with a more detailed pop variable for analyses within catchments.
Indiv: individual identifier (text).SSRseq_Phodra_XXX: 26 diploid genotypes (allele1,allele2, bp;NA,NAif missing).pop: analytical catchment/subpopulation label (categorical):Aiz,Aiz_A,Ara,Art_A,Art_B,Gor_A,Gor_B, orIzk. Suffixes_Aand_Bdistinguish the study's within-catchment genetic subdivisions; they are not additional loci or alleles.
FilteredSubPopulations_DAPC
Input to de novo PCA, K-means and DAPC: 280 individuals and 26 SSRseq loci.
Indiv: individual identifier (text).SSRseq_Phodra_XXX: diploid genotypes (allele1,allele2; bp;NA,NAif missing).pop: catchment code (Aiz,Ara,Art,Gor,Izk), used as metadata only. Geographic grouping is not used to determine the de novo genetic clusters. The analysis instead infers groups from genotype information.
OutputFromStructure
Precomputed individual ancestry coefficients from STRUCTURE (280 rows). STRUCTURE itself is not run by the accompanying integrated R script.
| Column | Definition | Unit / key |
|---|---|---|
ID |
Numeric order/index of an individual in the STRUCTURE output | Integer identifier |
Pop1–Pop5 |
Inferred membership coefficient (Q) for each of five genetic clusters |
Proportion, 0–1; approximately sums to 1 within each individual; cluster numbers are arbitrary labels |
Basin |
Geographic region of origin | Categorical: Gorbeia (Baias/Gor), Izki (Izk), Aizkorri (Arantzazu/Aiz), Artikutza (Añarbe/Art), or Aralar (Agauntza/Ara) |
DataForMLPE
79 pairwise site comparisons, used in maximum-likelihood population-effects (MLPE) models of genetic differentiation and river fragmentation. Both endpoints belong to the same catchment.
| Column | Definition | Unit / interpretation |
|---|---|---|
Basin |
Catchment containing both sites | Arantzazu, Agauntza, Añarbe, Baias, Izki |
UpstreamPoint |
Upstream site ID | Integer identifier, no physical unit |
DownstreamPoint |
Downstream site ID | Integer identifier, no physical unit |
Up_Down |
Paired-site label, e.g., 3_8 |
Text; unique together with Basin |
GeographicDistance |
Along-river distance separating the two sites | Metres (m) |
CumHeight |
Sum of the heights of intervening barriers | Metres (m) |
N_obstacles |
Count of intervening river barriers | Number of barriers (integer/count; dimensionless) |
GeneticDistance |
Pairwise Nei's FST genetic differentiation estimate | Unitless; used as the MLPE response |
Water_quality |
Pairwise Euclidean dissimilarity in water-chemistry conditions, derived for this study from the physicochemical measurements described in the associated manuscript | Unitless derived distance index; included as the fourth MLPE predictor |
Update: Water_quality has been added to DataForMLPE for all 79 comparisons. The R script reads this column directly from Data.xlsx; it does not recalculate the underlying physicochemical distance matrix. GeneticDistance is not scaled; the four explanatory variables are standardised in R before model fitting.
ABC_Predictions
Outputs of DIYABC Random Forest model selection for six analytical genetic units. The integrated R script visualises these precomputed results; it does not rerun DIYABC-RF.
| Column | Definition | Unit / key |
|---|---|---|
Basin |
Analytical catchment/genetic unit | Cluster1Baias, Cluster2Baias, Izki, Arantzazu, Añarbe, or Agauntza |
Scenario 1 |
Random Forest votes for large stable population | Vote count (integer) |
Scenario 2 |
Votes for post-medieval bottleneck | Vote count (integer) |
Scenario 3 |
Votes for ancient bottleneck | Vote count (integer) |
Scenario 4 |
Votes for small stable population | Vote count (integer) |
SelectedModel |
Scenario selected by the analysis | Integer code 1–4, corresponding to columns Scenario 1–Scenario 4 |
PosteriorProbability |
Posterior probability estimated for the selected scenario | Proportion, 0–1 |
ABC_N1, ABC_N3, and ABC_t1
Precomputed DIYABC-RF posterior summaries for the parameter identified by each sheet name. Each contains six analytical genetic-unit rows. The parameter interpretation is conditional on the scenario and parameterisation of the original DIYABC-RF analysis.
ABC_N1: posterior summaries for parameterN1, generally representing historical effective population size where applicable (effective individuals in population-size scenarios).ABC_N3: posterior summaries for parameterN3, often used for a contemporary population-size parameter, but the unit and interpretation must be checked against the selected DIYABC scenario for each row. In particular, values in this sheet are not all on the same apparent population-size scale, so assigning a single biological unit to every row would be misleading.ABC_t1: posterior summaries for parametert1, time since a demographic event where applicable (generations).
All three sheets use the following columns:
| Column | Meaning | Unit / interpretation |
|---|---|---|
Basin |
Analytical genetic unit | Categorical, as in ABC_Predictions |
Expectation |
Posterior mean of the named parameter | Parameter's unit (N1 / N3 scenario-dependent; t1 generations) |
Median |
Posterior median | Same unit as the parameter |
Quantile_0.05 |
5th percentile of posterior distribution | Same unit as the parameter |
Quantile_0.95 |
95th percentile of posterior distribution | Same unit as the parameter |
Variance |
Posterior variance | Squared unit of the parameter |
SD |
Posterior standard deviation | Same unit as the parameter |
Blank cells indicate parameters not available or not reported for the selected demographic scenario; they should not be interpreted as zero. The workbook retains the values as exported, without reinterpreting parameter labels or recalculating demographic models.
Genotype filtering: replacement for the removed Summary sheet
The original Summary worksheet was intentionally removed. The following definitions provide the relevant QC information previously conveyed by that auxiliary sheet:
| QC statistic | Definition / calculation | Value / unit |
|---|---|---|
| Initial sample count | Biological samples before locus and individual filtering; negative controls excluded from this count | 285 individuals |
| Negative controls | Non-biological control rows in Raw |
3 controls |
| Initial marker count | Number of SSRseq loci before filtering | 48 loci |
| Locus missing-data threshold | Maximum permitted proportion of missing genotype calls among 285 biological samples at a locus | 3% |
| Retained loci | Loci passing the locus-level quality filter | 26 loci |
| Excluded loci | Loci failing the locus-level filter | 22 loci |
| Individual missing-data threshold | Maximum missing genotype proportion across the 26 retained loci | 10% |
| Excluded individuals | Individuals removed after locus filtering for exceeding the individual missing-data criterion | 5 individuals |
| Final individual count | Samples retained after both filtering steps | 280 individuals |
| Final genotype matrix size | 280 individuals × 26 loci | 7,280 potential genotypes |
| Remaining missing genotypes | Diploid genotypes encoded NA,NA |
28 genotypes |
| Final missing-data rate | 100 × 28 / 7,280 | Approximately 0.38% |
Interpretation: The locus missing-data threshold applies per locus, whereas the individual threshold applies per individual; these are distinct filtering steps. The auxiliary 1stepFiltering columns BB–BC report per-individual missingness after the locus filtering step, as described above.
R script: Phoxinus_analysis.R
The supplied integrated R script expects Data.xlsx (including Water_quality) in its configured project directory. Its main analysis steps are:
- STRUCTURE visualisation: reads ancestry coefficients from
OutputFromStructureand produces plots; does not execute STRUCTURE. - Population and subpopulation genetic diversity: observed/expected heterozygosity, allelic richness, and FIS statistics based on the genotype tables.
- Pairwise FST: estimates genetic differentiation at the analytical population/subpopulation level and between sampled sites.
- Fragmentation plot: displays
N_obstaclesagainstGeneticDistancefromDataForMLPE. - DIYABC-RF visualisation: plots existing scenario-vote proportions and parameter summaries; does not execute DIYABC-RF.
- MLPE with four predictors: fits
GeneticDistance ~ GeographicDistance + CumHeight + N_obstacles + Water_quality, with a catchment random intercept (Basin) and a pairwise-correlation structure (corMLPE). Fits are made by maximum likelihood. All four predictors are standardised, whereas the response is retained on its original scale. The script evaluates 16 model subsets using AIC, excludes models with maximum absolute coefficient correlation above 0.6, and identifies models with ΔAIC ≤ 2. It also directly comparesN_obstaclesalone withN_obstacles + Water_qualityusing AIC and a likelihood-ratio comparison. Results are exported to theModelfolder under filenames carrying a_WaterQualitysuffix. - De novo PCA/K-means/DAPC: genetically infers clusters without using geographic group labels as clustering input, evaluates BIC, and reports assignments/quality-control outputs at regional, drainage and individual-catchment levels. Sampling-site and catchment metadata are used subsequently to interpret group composition.
Software: R (4.x in the source documentation), using readxl, adegenet, hierfstat, corMLPE, nlme, MuMIn, ggplot2, dplyr, tidyr, tibble, scales, writexl, and patchwork. The script can save session information in its output folder; no particular R package versions are inferred from the deposited files. External analyses were performed using STRUCTURE v2.3.4 and DIYABC-RF, whose precomputed results are included in the workbook.
To run: place Data.xlsx and Phoxinus_analysis_integrated.R together, update PROJECT_DIR at the beginning of the script if needed, and execute from R/RStudio with the required packages available. No separate ModeloLinear.xlsx or ModeloLinear_WaterQuality.csv is needed. The integrated script does not need Excel styling, formulas, drawings, filters, or external workbook links to load or analyse the data.
Data preservation and update notes
- The obsolete
Summarysheet was deliberately removed, and its QC definitions have been transferred to this README. DataForMLPEnow contains the originalWater_qualitydistance values as a fourth explanatory variable for all 79 site-pair records, in addition to the three previously documented predictors.- The MLPE section of the integrated R script now reads these four predictors directly from
Data.xlsx, aligning the archived code with the reported model and avoiding an external MLPE CSV input. - The accompanying workbook has been exported without formatting to improve accessibility and portability, while retaining the original worksheet layouts, identifiers, numeric values and missing-data markers. Calculated Excel results have been retained as numeric values, not live formulas.
- No separate interpretation relies on colours, highlighted cells, merged ranges, hyperlinks, drawings, or filtered/hidden rows.
Data access and citation
The data are archived at Dryad, DOI: https://doi.org/10.5061/dryad.fbg79cp9h. Please cite the dataset and associated study in accordance with the repository's citation instructions.
