Skip to content

apaijmans/AFS_recaptures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Antarctic fur seal recapture analysis

Overview contents:

  1. Workflow
  2. Data

1. Workflow

This analysis aimed to identify duplicated genotypes in the Antarctic fur seal (AFS) microsatellite database. To achieve this, we developed a custom script (the "recapture analysis") designed to handle the added complexity arising from samples having been genotyped using either 9 or 39 microsatellite loci. The script performs pairwise comparisons of all genotypes. For each comparison, mismatches were allowed as follows:

  • If at least one sample was genotyped at 9 loci, a maximum of 2 mismatches was allowed.
  • If both samples were genotyped at 39 loci, a maximum of 4 mismatches was allowed. All potentially matching groups of genotypes were stored in an .Rdata output file. Once the script completed, the output file was converted to an Excel file. Mismatches within these groups were visually inspected and errors were corrected. Genotype groups with no remaining mismatches after visual inspection were assigned to the same individual; all other samples were classified as distinct individuals.

Stepwise comparisons

The recapture analysis was run separately for different groups of samples to reduce computation time. All runs were performed on a server.

  1. Pup vs. pup (p-p) All pup samples were compared against all other pup samples. Unique pups were then identified, allowing duplicated pup samples to be excluded from subsequent recapture analyses.
  2. Pup vs. female (p-f) and pup vs. male (p-m) All unique pups were compared against all female samples, and separately against all male samples.
  3. Within adults (f-f, m-m) All adult female samples were compared against one another, and all adult male samples were compared against one another.

This resulted in five main script versions, available in the Rcode subfolder of the Recapture_analysis_server folder:

  • recaptures_p-p_2023.R
  • recaptures_p-f_2023.R
  • recaptures_p-m_2023.R
  • recaptures_f-f_2023.R
  • recaptures_m-m_2023.R and recaptures_m-m_repeats.R. The second male-to-male run (recaptures_m-m_repeats.R) was conducted after initially omitting repeat adult male samples (e.g. positive controls and known repeats). Including these repeats allowed us to (i) confirm that the script was correctly identifying known repeats, and (ii) correct any mismatches detected in those samples.

Additional analyses

To increase the sample size of male pups genotyped at 39 loci, 10 plates of male pups (racks 159–168) were re-genotyped. The script was then rerun for p-p and p-m comparisons, restricted to comparing the newly added genotypes against the existing ones:

  • recaptures_p-p_r159-168.R
  • recaptures_p-m_r159-168.R These scripts are also available in the Rcode subfolder of the Recapture_analysis_server folder.

Output and post-processing

The recapture analysis produced .Rdata files, which were post-processed using recaptures_postprocessing.R (which calls the custom function exportResults.R) on a local machine. These scripts are available in the ./Rcode subfolder. Post-processing generated '.xlsx' files used for visual inspection. All corrected results were combined into a final file, 'recapture_results_14_04_26.xlsx', consisting of three tabs:

  • Pup: combined results from 'recaptures_p-p_2023.R' and 'recaptures_p-p_r159-168.R'
  • Female: combined results from 'recaptures_p-f_2023.R' and 'recaptures_f-f_2023.R'
  • Male: combined results from 'recaptures_p-m_2023.R', 'recaptures_p-m_r159-168.R', 'recaptures_m-m_2023.R', 'recaptures_m-m_repeats.R', and 'recaptures_m-m_r159-168.R' Genotypes identified as confirmed duplicates were flagged in the microsatellite database by manually entering the matching tissue IDs in the Matches column. The updated file, 'all_msat_genotypes_uniqueID.xlsx', was then stored in a Zenodo repository: DOI and is used as input for the recruitment analysis, which is maintained in a separate github repository.

2. Data

The table below summarises where input and output files are located.

Description File(s) Location
Raw data for Stepwise comparisons all_msat_genotypes_raw.xlsx Recapture_analysis_server/Data/raw/
Raw data for Additional analyses all_msat_genotypes_raw_R159-168.xlsx Recapture_analysis_server/Data/raw/
.Rdata files produced by both steps (input for post-processing) Several files Recapture_analysis_server/Data/processed/
.xlsx files generated by post-processing Several files Recapture_analysis_local/Data/processed/
Corrected results and final summary file recapture_results_14_04_26.xlsx Recapture_analysis_local/Data/processed/checked/

Citation

Citation will be added upon publication.

This repository is licensed under the MIT License.

About

Scripts and data for identifying duplicate genotypes in an Antarctic fur seal microsatellite database

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages