{% set version = '1.4-12' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-ebayesthresh
  version: {{ version|replace("-", "_") }}

source:
  fn: EbayesThresh_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/EbayesThresh_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/EbayesThresh/EbayesThresh_{{ version }}.tar.gz
  sha256: 28850348aa0752a75e0c8f1ae20ef7e352a6493abe8b6a6c40ac09f5476b421d

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-wavethresh

  run:
    - r-base
    - r-wavethresh

test:
  commands:
    - $R -e "library('EbayesThresh')"  # [not win]
    - "\"%R%\" -e \"library('EbayesThresh')\""  # [win]

about:
  home: https://github.com/stephenslab/EbayesThresh
  license: GPL (>= 2)
  summary: Empirical Bayes thresholding using the methods developed by I. M. Johnstone and B.
    W. Silverman. The basic problem is to estimate a mean vector given a vector of observations
    of the mean vector plus white noise, taking advantage of possible sparsity in the
    mean vector. Within a Bayesian formulation, the elements of the mean vector are
    modelled as having, independently, a distribution that is a mixture of an atom of
    probability at zero and a suitable heavy-tailed distribution. The mixing parameter
    can be estimated by a marginal maximum likelihood approach. This leads to an adaptive
    thresholding approach on the original data. Extensions of the basic method, in particular
    to wavelet thresholding, are also implemented within the package.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
