{"id":19312457,"url":"https://github.com/exaexa/nougad","last_synced_at":"2026-03-11T19:07:56.295Z","repository":{"id":48455243,"uuid":"374460923","full_name":"exaexa/nougad","owner":"exaexa","description":"non-linear unmixing by gradient descent","archived":false,"fork":false,"pushed_at":"2023-01-22T21:57:02.000Z","size":1116,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-15T09:02:14.106Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exaexa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-06T20:48:49.000Z","updated_at":"2023-08-15T09:02:14.107Z","dependencies_parsed_at":"2023-02-12T18:31:27.264Z","dependency_job_id":null,"html_url":"https://github.com/exaexa/nougad","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exaexa%2Fnougad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exaexa%2Fnougad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exaexa%2Fnougad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exaexa%2Fnougad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exaexa","download_url":"https://codeload.github.com/exaexa/nougad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223900336,"owners_count":17222028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-10T00:34:54.373Z","updated_at":"2026-03-11T19:07:51.276Z","avatar_url":"https://github.com/exaexa.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nougad -- Non-linear unmixing by gradient descent\n\nThis is as a part of PanelBuildeR (https://github.com/exaexa/panelbuilder),\nimplementing fast variants of the gradient-descent based unmixing. With a bit\nof luck, you may be able to use the package standalone as well -- the package\nexports a single function `nougad` which has standard documentation.\n\nImportantly, this package has multiple versions with other fast\nimplementations. The default version with \"canonical\" C implementation of the\nunmixing is in branch `master`; you may install it with devtools as follows:\n\n```r\ndevtools::install_github(\"exaexa/nougad\")\n```\n\nAfter that, either use the function from PanelBuilder, or read the\ndocumentation using `?nougad`. A simple benchmarking and testing tool is ready\nin function `nougad.benchmark`.\n\n## Accelerated variants\n\n### Multi-core computation\n\nUtilization of multiple threads is enabled by default and requires no specific\nsetup. You can use parameter `threads=N` to precisely set up your desired\nnumber of threads to use for unmixing; default (`threads=0`) uses all available\nCPU threads as reported by `std::thread::hardware_concurrency()`.\n\nSetting `threads=1` disables all calls to threading libraries, which may be\nhelpful on legacy or embedded systems.\n\n### SIMD (SSE/AVX and others)\n\nThe CPU code is written so that it exposes many vectorization possibilities to\nthe compiler, enabling further speedups. The code typically benefits from\npresence of packed-single-float instructions like `vfmadd132ps` and\n`vfmadd213ps` available on CPUs with AVX FMA extension, or similar ones from\nthe SSE extensions. Depending on the platform, you may get additional speedup\nbetween 2× and 4× simply by enabling the vectorization for the CPU version.\n\nTo do that, you need to instruct `R` to compile C++ code with\narchitecture-specific optimization flags. The easiest way is to just set the\n\"native\" architecture by adding the following line to your `Makevars`\nconfiguration file:\n\n```make\nCXXFLAGS += -O3 -march=native\n```\n\nThe `Makevars` configuration typically resides in local user's configuration\ndirectory; on UNIX that is usually in `~/.R/Makevars`.\n\n### CUDA\n\nCUDA version is installed just as the Vulkan version, using the proper branch\nfrom the repository:\n\n```r\ndevtools::install_github('exaexa/nougad', ref='cuda')\n```\n\nYou will need a working CUDA compiler (`nvcc`) for the installation to work;\nusually it is sufficient to install the nVidia CUDA toolkit (on debians and\nubuntus, it is in the package `nvidia-cuda-toolkit`).\n\n### Vulkan\n\nYou may try a Vulkan variant of the function, which should be able to use your\nVulkan-compatible GPU. You need to have Vulkan C library and headers installed\n(usually from package like `libvulkan-dev`). You also need the ICD runtime for\nyour hardware (usually in packages such as `mesa-vulkan-drivers` or\n`nvidia-vulkan-icd`).\n\nInstall with:\n```r\ndevtools::install_github('exaexa/nougad', ref='vulkan')\n```\n\n## Why non-linear weighted unmixing?\n\nIn short, it can help you filter lots of unwanted noise from highly-expressed\nchannels, which vastly reduces the (induced) noise. The following examples show\nthe problem on a common use-case from cytometry. The data is generated using\nthe `nougad.benchmark` function; refer to the source for details.  Notably, the\noriginal cell expressions have a very precise expressions around zeroes\n(compare that with the very precise measurements from mass cytometry).\nIdeally, the expression is only disturbed by positive Poisson noise, and data\nnever get negative. OLS cannot handle this distinction easily, and produces\nproblems, mostly resulting in the infamous \"spillover spread\".\n\n#### Example: 5 markers in 10 channels\n\n![5markers-10channels](media/5m-10c.png)\n\n#### Example: 10 markers in 10 channels\n\n![10markers-10channels](media/10m-10c.png)\n\n#### Example: 30 markers in 30 channels\n\n![30markers-30channels](media/30m-30c.png)\n\n#### Example: 30 markers in 50 channels\n\n![30markers-50channels](media/30m-50c.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexaexa%2Fnougad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexaexa%2Fnougad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexaexa%2Fnougad/lists"}