{% set version = '4.0.0' %}

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

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

source:
  fn: preseqR_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/preseqR_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/preseqR/preseqR_{{ version }}.tar.gz
  sha256: 0143db473fb9a811f9cf582a348226a5763e62d9857ce3ef4ec41412abb559bc

build:
  merge_build_host: True  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]

  host:
    - r-base
    - r-polynom

  run:
    - r-base
    - r-polynom

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

about:
  home: https://CRAN.R-project.org/package=preseqR
  license: GPL-3
  summary: 'Originally as an R version of Preseq <doi:10.1038/nmeth.2375>, the package has extended
    its functionality to predict the r-species accumulation curve (r-SAC), which is
    the number of species represented at least r times as a function of the sampling
    effort. When r = 1, the curve is known as the species accumulation curve, or the
    library complexity curve in high-throughput genomic sequencing. The package includes
    both parametric and nonparametric methods, as described by Deng C, et al. (2018)
    <arXiv:1607.02804v3>. '

  license_family: GPL3

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