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

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

source:
  url:
    - https://cran.r-project.org/src/contrib/PCIT_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/PCIT/PCIT_{{ version }}.tar.gz

  sha256: b2183d6d9ad6159004db272194a695837c7d285bea70a2a49a3781864544223e

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('fortran') }}        # [unix]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base
  run:
    - r-base

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

about:
  home: https://cran.r-project.org/web/packages/PCIT/index.html
  license: GPL-3
  summary: Apply Partial Correlation coefficient with Information Theory (PCIT) to a correlation
    matrix. The PCIT algorithm identifies meaningful correlations to define edges in
    a weighted network. The algorithm can be applied to any correlation-based network
    including but not limited to gene co-expression networks. To reduce compute time
    by making use of multiple compute cores, simply run PCIT on a computer with has
    multiple cores and also has the Rmpi package installed. PCIT will then auto-detect
    the multicore environment and run in parallel mode without the need to rewrite your
    scripts. This makes scripts, using PCIT, portable across single core (or no Rmpi
    package installed) computers which will run in serial mode and multicore (with Rmpi
    package installed) computers which will run in parallel mode.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'
extra:
   recipe-maintainers:
    - conda-forge/r
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
