{"id":32643968,"url":"https://github.com/nmartinkova/diemr","last_synced_at":"2026-07-02T19:31:56.214Z","repository":{"id":314275342,"uuid":"1054815766","full_name":"nmartinkova/diemr","owner":"nmartinkova","description":"Genome polarization using the diagnostic index expectation maximisation algorithm in R","archived":false,"fork":false,"pushed_at":"2026-03-18T07:55:54.000Z","size":1326,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-18T23:37:02.758Z","etag":null,"topics":["bioinformatics","diem","diemr","genome-admixture","genome-polarisation","genome-polarization","genomics","hybridisation","hybridization","population-genetics","population-genomics","r","r-package","speciation"],"latest_commit_sha":null,"homepage":"https://CRAN.R-project.org/package=diemr","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmartinkova.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-11T11:19:47.000Z","updated_at":"2026-03-18T07:55:58.000Z","dependencies_parsed_at":"2025-09-11T15:46:07.789Z","dependency_job_id":"f3e00ca6-670e-4517-9416-4ad2d4b9e065","html_url":"https://github.com/nmartinkova/diemr","commit_stats":null,"previous_names":["nmartinkova/diemr"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nmartinkova/diemr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmartinkova%2Fdiemr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmartinkova%2Fdiemr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmartinkova%2Fdiemr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmartinkova%2Fdiemr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmartinkova","download_url":"https://codeload.github.com/nmartinkova/diemr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmartinkova%2Fdiemr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35060907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioinformatics","diem","diemr","genome-admixture","genome-polarisation","genome-polarization","genomics","hybridisation","hybridization","population-genetics","population-genomics","r","r-package","speciation"],"created_at":"2025-10-31T03:58:28.045Z","updated_at":"2026-07-02T19:31:56.205Z","avatar_url":"https://github.com/nmartinkova.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\r\noutput: github_document\r\n---\r\n\r\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\r\n\r\n```{r, include = FALSE}\r\nknitr::opts_chunk$set(\r\n  collapse = TRUE,\r\n  comment = \"#\",\r\n  fig.path = \"man/figures/README-\",\r\n  out.width = \"100%\"\r\n)\r\n```\r\n\r\n# diemr: Genome polarisation in R\r\n\r\n\u003c!-- badges: start --\u003e\r\n[![CRAN version](https://www.r-pkg.org/badges/version/diemr)](https://CRAN.R-project.org/package=diemr)\r\n[![CRAN downloads](https://cranlogs.r-pkg.org/badges/grand-total/diemr)](https://cran.r-project.org/package=diemr)\r\n[![Monthly downloads](https://cranlogs.r-pkg.org/badges/last-month/diemr)](https://cran.r-project.org/package=diemr)\r\n\u003c!-- badges: end --\u003e\r\n\r\n\u003cimg src=\"man/figures/logo.png\" align=\"right\" width=\"120\" /\u003e\r\n\r\n\r\n\r\n_diemr_ implements the **Diagnostic Index Expectation Maximization (*diem*) algorithm**\r\nfor **genome polarization** in `R`. It estimates which alleles of single nucleotide\r\nvariant (SNV) sites belong to\r\neither side of a barrier to gene flow, co-estimates individual assignment, \r\nand infers barrier strength and divergence. These tools are designed for studies\r\nof **hybridization**, **speciation**, and population divergence, and extend the \r\nmethods described in Baird et al. (2023) Genome polarisation for detecting barriers to \r\ngeneflow. _Methods in Ecology and Evolution 14_, 512-528 \u003cdoi:10.1111/2041-210X.14010\u003e. \r\nFor the original algorithm description and implementations in `Python` and \r\n`Mathematica`, see the _diem_ repository at https://github.com/StuartJEBaird/diem. For a \r\nstep-by-step explanation of the functions and their outputs, see the [documentation](https://nmartinkova.github.io/genome-polarisation/) for the `diemr` package.\r\n\r\n## Installation\r\n\r\nTo start using _diemr_, load the package or install it from CRAN if it is not yet available:\r\n\r\n``` {r, eval = FALSE}\r\nif(!require(\"diemr\", character.only = TRUE)){\r\n    install.packages(\"diemr\", dependencies = TRUE)\r\n    library(\"diemr\", character.only = TRUE)\r\n}\r\n# Loading required package: diemr\r\n```\r\n\r\nThe developer version can be installed directly from this repository using package `devtools`.\r\n```{r, eval = FALSE}\r\ndevtools::install_github(\"https://github.com/nmartinkova/diemr\")\r\n```\r\n\r\n\r\nSet working directory to a location with read and write privileges.\r\n\r\n## Check data format and polarise genotypes\r\n\r\nNext, assemble paths to all files containing the data to be used by _diemr_. Here, we will use a tiny example dataset for illustration that is included in the package. A good practice is to check that all files contain data in correct format for all individuals and markers.\r\n\r\n```{r, eval = FALSE}\r\nfilepaths \u003c- system.file(\"extdata\", \"data7x3.txt\",\r\n                         package = \"diemr\")\r\nCheckDiemFormat(filepaths, ploidy = list(rep(2, 6)), ChosenInds = 1:6)\r\n# File check passed: TRUE\r\n# Ploidy check passed: TRUE\r\n```\r\n\r\nIf the `CheckDiemFormat()` function fails, work through the error messages and fix the stored input files accordingly. The algorithm repeatedly accesses data from the harddisk, so seeing the passed file check prior to analysis is critical.\r\n\r\n```{r, eval = FALSE}\r\ndiem.res \u003c- diem(files = filepaths,\r\n\t\t\t\t ploidy = list(rep(2, 6)), \r\n\t\t\t\t ChosenInds = 1:6,\r\n                 nCores = 1)\r\n```\r\n\r\nThe results including marker polarisation, marker diagnostic index and its support will be included in the list element `diem.res$DI`. Additional elements in the results list contain basic tracking information about the expectation maximisation iterations. The key results are saved in a file *MarkerDiagnosticsWithOptimalPolarities.txt* in the working directory. Check the the `diemr` [documentation](https://nmartinkova.github.io/genome-polarisation/) for further information.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmartinkova%2Fdiemr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmartinkova%2Fdiemr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmartinkova%2Fdiemr/lists"}