Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-04 Thread Uwe Ligges




On 03.05.2023 23:00, Simon Urbanek wrote:




On May 4, 2023, at 3:36 AM, Martin Morgan  wrote:

CRAN is fine with Bioconductor Depends: and Imports: dependencies, as 
previously mentioned. This is because the CRAN maintainers explicitly configure 
their system to know about Bioconductor package repositories.



That is not exactly true (at least not for all maintainers ;)). Bioconductor 
packages are installed on as-needed (best-effort) basis and it is a manual 
process.


Apparently for MacOS.
On Fedora/Debian/WIndows we auto install from BioC. (actually, on 
Windows all BioC software packages are preinstalled).


Best,
Uwe Ligges


Ideally, Bioconductor packages would be in Suggests, because if they are not, 
the package binary will be effectively broken for most users as they cannot 
install it without additional steps (and no stable state can be guaranteed, 
either). That's why I believe someone was suggesting a pre-flight check that 
alerts the user to such situation and prints instructions to remedy it (e.g., 
to use setRepositories()) as the majority of users will have no idea what's 
going on.

Cheers,
Simon




Users face a different challenge -- many users will not have identified (e.g., 
via `setRepositories()` a Bioconductor repository, so when they try to install 
your package it will fail in a way that you have no control over -- a generic 
message saying that the Bioconductor dependencies was not found.

You could mitigate this by advertising that your CRAN package should be installed via 
`BiocManager::install("")`, which defines appropriate 
repositories for both CRAN and Bioconductor, but there is no way to unambiguously communicate 
this to users.

Martin

From: R-package-devel  on behalf of Ruff, 
Sergej 
Date: Wednesday, May 3, 2023 at 11:13 AM
To: Dirk Eddelbuettel 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package
Thank you, Dirk.


I see your dependencies are Suggested. I know that Suggested dependencies 
should be conditional.


Do you know if Non-Cran (Bioconductor) packages need to be conditional?  Do you 
have any experiece regarding Non-CRAN Dependencies

and how to handle them?


I believe Duncan Murdoch's experience and opinion regarding that topic, but i 
take any second and third opinion to be sure.


Thank you for your help.


Sergej


Von: Dirk Eddelbuettel 
Gesendet: Mittwoch, 3. Mai 2023 16:22:09
An: Ruff, Sergej
Cc: Duncan Murdoch; Ivan Krylov; r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package


Sergej,

Please consider:

  - there are nearly 20k CRAN packages

  - all of them are mirrored at https://github.com/cran so you can browse

  - pick any one 'heavy' package you like, Seurat is a good example; there
are other examples in geospatial or bioinformatics etc

  - you can browse _and search_ these to your hearts content

Here is an example of mine. In RcppArmadillo, years ago we (thanks to fine
Google Summer of Code work by Binxiang Ni) added extended support for sparse
matrices pass-through / conversione from R to C++ / Armadillo and back. That
is clearly an optional feature as most uses of (Rcpp)Armadillo use dense
matrices. So all code and test code is _conditional_.  File DESCRIPTION has

   Suggests: [...], Matrix (>= 1.3.0), [...], reticulate, slam

mostly for tests. I.e. We have very little R code: in one single file
R/SciPy2R.R we switched to doing this via reticulate and opee the function
with

if (!requireNamespace("reticulate", quietly=TRUE)) {
stop("You must install the 'reticulate' package (and have SciPy).", 
call.=FALSE)
}

after an actual deprecation warning (as there was scipy converter once).

Similarly, the testsuites in inst/tinytests/* have several

if (!requireNamespace("Matrix", quietly=TRUE)) exit_file("No Matrix 
package")

as well as

if (!requireNamespace("reticulate", quietly=TRUE)) exit_file("Package reticulate 
missing")

if (!packageVersion("reticulate") >= package_version("1.14"))
exit_file("SciPy not needed on newer reticulate")

and tests for slam (another sparse matrix package besides the functionality
in Matrix).

Hopefully this brief snapshot gives you an idea.  There are (likely!!)
thousandss of examples you can browse, and I am sure you will find something.
If you have further (concrete) questions please do not hesitate to use the
resource of this list.

Cheers (or I should say "mit Braunschweiger Gruessen nach Hannover),

Dirk

--
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
htt

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Dirk Eddelbuettel


On 4 May 2023 at 09:00, Simon Urbanek wrote:
| > On May 4, 2023, at 3:36 AM, Martin Morgan  wrote:
| > CRAN is fine with Bioconductor Depends: and Imports: dependencies, as 
previously mentioned. This is because the CRAN maintainers explicitly configure 
their system to know about Bioconductor package repositories.
| 
| That is not exactly true (at least not for all maintainers ;)). Bioconductor 
packages are installed on as-needed (best-effort) basis and it is a manual 
process. Ideally, Bioconductor packages would be in Suggests, because if they 
are not, the package binary will be effectively broken for most users as they 
cannot install it without additional steps (and no stable state can be 
guaranteed, either). That's why I believe someone was suggesting a pre-flight 
check that alerts the user to such situation and prints instructions to remedy 
it (e.g., to use setRepositories()) as the majority of users will have no idea 
what's going on.

That is not exactly true either.

Everything depends on the repository you look at, and have set. In the
command below (broken over two lines for legibility)
 
  $ docker run --rm -ti rocker/r2u:jammy \
  Rscript -e 'system.time(install.packages("Seurat", 
"SingleCellExperiment"))'

we see it takes 35 seconds to download and install 138 binary packages
implied by this particular pair of CRAN and BioConductor packages.

Now, this works because r2u is 'joint' repo with (essentially all of) CRAN
and (a decent chunk of) BioConductor. We also not that we do not need
Martin's suggestion of a bioc wrapper to the installation as the packages are
known (and are _effectively_ in an apt repo, but that is a r2u [1] story).

That said, _in general_ it can be dicey to depends on BioConductor as not
every user may have it set.  So this thread is slowly meandering in the right
direction.

Dirk

[1] https://eddelbuettel.github.io/r2u/

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Simon Urbanek



> On May 4, 2023, at 3:36 AM, Martin Morgan  wrote:
> 
> CRAN is fine with Bioconductor Depends: and Imports: dependencies, as 
> previously mentioned. This is because the CRAN maintainers explicitly 
> configure their system to know about Bioconductor package repositories.
> 

That is not exactly true (at least not for all maintainers ;)). Bioconductor 
packages are installed on as-needed (best-effort) basis and it is a manual 
process. Ideally, Bioconductor packages would be in Suggests, because if they 
are not, the package binary will be effectively broken for most users as they 
cannot install it without additional steps (and no stable state can be 
guaranteed, either). That's why I believe someone was suggesting a pre-flight 
check that alerts the user to such situation and prints instructions to remedy 
it (e.g., to use setRepositories()) as the majority of users will have no idea 
what's going on.

Cheers,
Simon



> Users face a different challenge -- many users will not have identified 
> (e.g., via `setRepositories()` a Bioconductor repository, so when they try to 
> install your package it will fail in a way that you have no control over -- a 
> generic message saying that the Bioconductor dependencies was not found.
> 
> You could mitigate this by advertising that your CRAN package should be 
> installed via `BiocManager::install("")`, which defines 
> appropriate repositories for both CRAN and Bioconductor, but there is no way 
> to unambiguously communicate this to users.
> 
> Martin
> 
> From: R-package-devel  on behalf of 
> Ruff, Sergej 
> Date: Wednesday, May 3, 2023 at 11:13 AM
> To: Dirk Eddelbuettel 
> Cc: r-package-devel@r-project.org 
> Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
> Description File of my R Package
> Thank you, Dirk.
> 
> 
> I see your dependencies are Suggested. I know that Suggested dependencies 
> should be conditional.
> 
> 
> Do you know if Non-Cran (Bioconductor) packages need to be conditional?  Do 
> you have any experiece regarding Non-CRAN Dependencies
> 
> and how to handle them?
> 
> 
> I believe Duncan Murdoch's experience and opinion regarding that topic, but i 
> take any second and third opinion to be sure.
> 
> 
> Thank you for your help.
> 
> 
> Sergej
> 
> ____
> Von: Dirk Eddelbuettel 
> Gesendet: Mittwoch, 3. Mai 2023 16:22:09
> An: Ruff, Sergej
> Cc: Duncan Murdoch; Ivan Krylov; r-package-devel@r-project.org
> Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
> Description File of my R Package
> 
> 
> Sergej,
> 
> Please consider:
> 
>  - there are nearly 20k CRAN packages
> 
>  - all of them are mirrored at https://github.com/cran so you can browse
> 
>  - pick any one 'heavy' package you like, Seurat is a good example; there
>are other examples in geospatial or bioinformatics etc
> 
>  - you can browse _and search_ these to your hearts content
> 
> Here is an example of mine. In RcppArmadillo, years ago we (thanks to fine
> Google Summer of Code work by Binxiang Ni) added extended support for sparse
> matrices pass-through / conversione from R to C++ / Armadillo and back. That
> is clearly an optional feature as most uses of (Rcpp)Armadillo use dense
> matrices. So all code and test code is _conditional_.  File DESCRIPTION has
> 
>   Suggests: [...], Matrix (>= 1.3.0), [...], reticulate, slam
> 
> mostly for tests. I.e. We have very little R code: in one single file
> R/SciPy2R.R we switched to doing this via reticulate and opee the function
> with
> 
>if (!requireNamespace("reticulate", quietly=TRUE)) {
>stop("You must install the 'reticulate' package (and have SciPy).", 
> call.=FALSE)
>}
> 
> after an actual deprecation warning (as there was scipy converter once).
> 
> Similarly, the testsuites in inst/tinytests/* have several
> 
>if (!requireNamespace("Matrix", quietly=TRUE)) exit_file("No Matrix 
> package")
> 
> as well as
> 
>if (!requireNamespace("reticulate", quietly=TRUE)) exit_file("Package 
> reticulate missing")
> 
>if (!packageVersion("reticulate") >= package_version("1.14"))
>exit_file("SciPy not needed on newer reticulate")
> 
> and tests for slam (another sparse matrix package besides the functionality
> in Matrix).
> 
> Hopefully this brief snapshot gives you an idea.  There are (likely!!)
> thousandss of examples you can browse, and I am sure you will find something.
> If you have further (concrete) ques

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Martin Morgan
CRAN is fine with Bioconductor Depends: and Imports: dependencies, as 
previously mentioned. This is because the CRAN maintainers explicitly configure 
their system to know about Bioconductor package repositories.

Users face a different challenge -- many users will not have identified (e.g., 
via `setRepositories()` a Bioconductor repository, so when they try to install 
your package it will fail in a way that you have no control over -- a generic 
message saying that the Bioconductor dependencies was not found.

You could mitigate this by advertising that your CRAN package should be 
installed via `BiocManager::install("")`, which defines 
appropriate repositories for both CRAN and Bioconductor, but there is no way to 
unambiguously communicate this to users.

Martin

From: R-package-devel  on behalf of 
Ruff, Sergej 
Date: Wednesday, May 3, 2023 at 11:13 AM
To: Dirk Eddelbuettel 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package
Thank you, Dirk.


I see your dependencies are Suggested. I know that Suggested dependencies 
should be conditional.


Do you know if Non-Cran (Bioconductor) packages need to be conditional?  Do you 
have any experiece regarding Non-CRAN Dependencies

and how to handle them?


I believe Duncan Murdoch's experience and opinion regarding that topic, but i 
take any second and third opinion to be sure.


Thank you for your help.


Sergej


Von: Dirk Eddelbuettel 
Gesendet: Mittwoch, 3. Mai 2023 16:22:09
An: Ruff, Sergej
Cc: Duncan Murdoch; Ivan Krylov; r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package


Sergej,

Please consider:

  - there are nearly 20k CRAN packages

  - all of them are mirrored at https://github.com/cran so you can browse

  - pick any one 'heavy' package you like, Seurat is a good example; there
are other examples in geospatial or bioinformatics etc

  - you can browse _and search_ these to your hearts content

Here is an example of mine. In RcppArmadillo, years ago we (thanks to fine
Google Summer of Code work by Binxiang Ni) added extended support for sparse
matrices pass-through / conversione from R to C++ / Armadillo and back. That
is clearly an optional feature as most uses of (Rcpp)Armadillo use dense
matrices. So all code and test code is _conditional_.  File DESCRIPTION has

   Suggests: [...], Matrix (>= 1.3.0), [...], reticulate, slam

mostly for tests. I.e. We have very little R code: in one single file
R/SciPy2R.R we switched to doing this via reticulate and opee the function
with

if (!requireNamespace("reticulate", quietly=TRUE)) {
stop("You must install the 'reticulate' package (and have SciPy).", 
call.=FALSE)
}

after an actual deprecation warning (as there was scipy converter once).

Similarly, the testsuites in inst/tinytests/* have several

if (!requireNamespace("Matrix", quietly=TRUE)) exit_file("No Matrix 
package")

as well as

if (!requireNamespace("reticulate", quietly=TRUE)) exit_file("Package 
reticulate missing")

if (!packageVersion("reticulate") >= package_version("1.14"))
exit_file("SciPy not needed on newer reticulate")

and tests for slam (another sparse matrix package besides the functionality
in Matrix).

Hopefully this brief snapshot gives you an idea.  There are (likely!!)
thousandss of examples you can browse, and I am sure you will find something.
If you have further (concrete) questions please do not hesitate to use the
resource of this list.

Cheers (or I should say "mit Braunschweiger Gruessen nach Hannover),

Dirk

--
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Ruff, Sergej
my bad,


I looked at the DESCRIPTIOn fiel again. I assumed that Cluster was a 
Bioconductor package.

I also didn�t see that DeSeq2 was in Suggests.


I will follow your advice and try using Bioconductor packages without a 
conditional function.


Sergej


Von: Duncan Murdoch 
Gesendet: Mittwoch, 3. Mai 2023 17:25:15
An: Ruff, Sergej; Ivan Krylov
Cc: r-package-devel@r-project.org
Betreff: Re: AW: AW: [R-pkg-devel] How to declare Bioconductor Dependencies in 
the Description File of my R Package

On 03/05/2023 9:50 a.m., Ruff, Sergej wrote:
> I took the Seurat package as an example, because it both lists the
> Bioconductor Dependencies under Imports in the DESCRIPTION-File

Which packages are you talking about?  I don't see any BioConductor
dependencies in the Imports list for the current Seurat version.

Duncan Murdoch

>
> and it uses conditional functions to check if those dependencies are
> pre-installed.
>
>
> "No, it is a requirement if the package is used but is not listed in
> Depends or Imports.
>
> If the package is in Depends or Imports it is a waste of time to make
> the check:  it will always succeed."
>
>
> that's what I also thought but I am confused why a package like Seurat
> then lists the dependencies in the DESCRIPTION-File and on top of that uses
>
> conditional functions to check if the package is pre-installed or not.
> Wouldn't that make the packagecheck function used by Seurat redundant?
>
> Sergej Ruff
>
> 
> *Von:* Duncan Murdoch 
> *Gesendet:* Mittwoch, 3. Mai 2023 15:29:34
> *An:* Ruff, Sergej; Ivan Krylov
> *Cc:* r-package-devel@r-project.org
> *Betreff:* Re: AW: [R-pkg-devel] How to declare Bioconductor
> Dependencies in the Description File of my R Package
> On 03/05/2023 9:17 a.m., Ruff, Sergej wrote:
>> Thanks,
>>
>>
>> So is it just necessary for suggested packages.
>
> Those and "Enhances" packages, but hardly anyone uses "Enhances".
>>
>>
>> So, is it just good practice to make a conditional check?
>
> No, it is a requirement if the package is used but is not listed in
> Depends or Imports.
>
> If the package is in Depends or Imports it is a waste of time to make
> the check:  it will always succeed.
>
>> I saw some packages still include it.
>>
>>
>> For example the Seurat package.
>>
> I don't understand your question here.
>
> Duncan Murdoch
>
>>
>> Under Utils.R (line 349-379) of the SeuratObject-Package
>> (https://cran.r-project.org/src/contrib/Archive/SeuratObject/
>> <https://cran.r-project.org/src/contrib/Archive/SeuratObject/
> <https://cran.r-project.org/src/contrib/Archive/SeuratObject/>>) you will
>> find the PackageCheck-function
>>
>> which used by the Seurat-Package
>> (https://cran.r-project.org/src/contrib/Archive/Seurat/
>> <https://cran.r-project.org/src/contrib/Archive/Seurat/
> <https://cran.r-project.org/src/contrib/Archive/Seurat/>>) to check if
>> packages are alredy installed.
>>
>>
>> You can find examples for DEseq2 under differential_expression.R
>> (starting line 1314 or you cntr+f for packagecheck) in
>> the Seurat.package
>> (https://cran.r-project.org/src/contrib/Archive/Seurat/
>> <https://cran.r-project.org/src/contrib/Archive/Seurat/
> <https://cran.r-project.org/src/contrib/Archive/Seurat/>>)
>>
>> or for limma (starting line 2292).
>>
>>
>>
>> 
>> *Von:* Duncan Murdoch 
>> *Gesendet:* Mittwoch, 3. Mai 2023 14:25:56
>> *An:* Ruff, Sergej; Ivan Krylov
>> *Cc:* r-package-devel@r-project.org
>> *Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in
>> the Description File of my R Package
>>
>>
>> On 03/05/2023 8:00 a.m., Ruff, Sergej wrote:
>> ... [ lines about current solution deleted ]
>>
>>> Also for the future - how Do i provide Bioconductor dependencies as 
>>> "Imports" for a package that I want to submit to CRAN?
>>
>> Just list it as you would a CRAN package.  The CRAN docs talk about
>> "mainstream repositories"; I forget what the definition is of that
>> (maybe repositories listed in `file.path(R.home(),
>> "etc/repositories")`?), but definitely BioConductor is included.
>>
>>> Do I need to make that also conditional? I know I should provide 
>>> Installation description in a readme fiel but how do I make sure
>>
>> No, you don't need to check.  If any imported package is not available,
>> your package will not load, so errors will happen before you ever get to
>> running examples.
>>
>>> that the Bioconductor dependencies dont cause a rejection from CRAN?
>>
>> Just make sure they exist on BioC and your code works with them.
>>
>> Duncan Murdoch
>>
>


[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Duncan Murdoch

On 03/05/2023 9:50 a.m., Ruff, Sergej wrote:
I took the Seurat package as an example, because it both lists the 
Bioconductor Dependencies under Imports in the DESCRIPTION-File


Which packages are you talking about?  I don't see any BioConductor 
dependencies in the Imports list for the current Seurat version.


Duncan Murdoch



and it uses conditional functions to check if those dependencies are 
pre-installed.



"No, it is a requirement if the package is used but is not listed in
Depends or Imports.

If the package is in Depends or Imports it is a waste of time to make
the check:  it will always succeed."


that's what I also thought but I am confused why a package like Seurat 
then lists the dependencies in the DESCRIPTION-File and on top of that uses


conditional functions to check if the package is pre-installed or not. 
Wouldn't that make the packagecheck function used by Seurat redundant?


Sergej Ruff


*Von:* Duncan Murdoch 
*Gesendet:* Mittwoch, 3. Mai 2023 15:29:34
*An:* Ruff, Sergej; Ivan Krylov
*Cc:* r-package-devel@r-project.org
*Betreff:* Re: AW: [R-pkg-devel] How to declare Bioconductor 
Dependencies in the Description File of my R Package

On 03/05/2023 9:17 a.m., Ruff, Sergej wrote:

Thanks,


So is it just necessary for suggested packages.


Those and "Enhances" packages, but hardly anyone uses "Enhances".



So, is it just good practice to make a conditional check?


No, it is a requirement if the package is used but is not listed in
Depends or Imports.

If the package is in Depends or Imports it is a waste of time to make
the check:  it will always succeed.


I saw some packages still include it.


For example the Seurat package.


I don't understand your question here.

Duncan Murdoch



Under Utils.R (line 349-379) of the SeuratObject-Package 
(https://cran.r-project.org/src/contrib/Archive/SeuratObject/
<https://cran.r-project.org/src/contrib/Archive/SeuratObject/ 

<https://cran.r-project.org/src/contrib/Archive/SeuratObject/>>) you will

find the PackageCheck-function

which used by the Seurat-Package 
(https://cran.r-project.org/src/contrib/Archive/Seurat/
<https://cran.r-project.org/src/contrib/Archive/Seurat/ 

<https://cran.r-project.org/src/contrib/Archive/Seurat/>>) to check if

packages are alredy installed.


You can find examples for DEseq2 under differential_expression.R 
(starting line 1314 or you cntr+f for packagecheck) in 
the Seurat.package 
(https://cran.r-project.org/src/contrib/Archive/Seurat/
<https://cran.r-project.org/src/contrib/Archive/Seurat/ 

<https://cran.r-project.org/src/contrib/Archive/Seurat/>>)


or for limma (starting line 2292).




*Von:* Duncan Murdoch 
*Gesendet:* Mittwoch, 3. Mai 2023 14:25:56
*An:* Ruff, Sergej; Ivan Krylov
*Cc:* r-package-devel@r-project.org
*Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in 
the Description File of my R Package



On 03/05/2023 8:00 a.m., Ruff, Sergej wrote:
... [ lines about current solution deleted ]


Also for the future - how Do i provide Bioconductor dependencies as "Imports" 
for a package that I want to submit to CRAN?


Just list it as you would a CRAN package.  The CRAN docs talk about
"mainstream repositories"; I forget what the definition is of that
(maybe repositories listed in `file.path(R.home(),
"etc/repositories")`?), but definitely BioConductor is included.


Do I need to make that also conditional? I know I should provide Installation 
description in a readme fiel but how do I make sure


No, you don't need to check.  If any imported package is not available,
your package will not load, so errors will happen before you ever get to
running examples.


that the Bioconductor dependencies dont cause a rejection from CRAN?


Just make sure they exist on BioC and your code works with them.

Duncan Murdoch





__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Ruff, Sergej
Thank you, Dirk.


I see your dependencies are Suggested. I know that Suggested dependencies 
should be conditional.


Do you know if Non-Cran (Bioconductor) packages need to be conditional?  Do you 
have any experiece regarding Non-CRAN Dependencies

and how to handle them?


I believe Duncan Murdoch's experience and opinion regarding that topic, but i 
take any second and third opinion to be sure.


Thank you for your help.


Sergej


Von: Dirk Eddelbuettel 
Gesendet: Mittwoch, 3. Mai 2023 16:22:09
An: Ruff, Sergej
Cc: Duncan Murdoch; Ivan Krylov; r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package


Sergej,

Please consider:

  - there are nearly 20k CRAN packages

  - all of them are mirrored at https://github.com/cran so you can browse

  - pick any one 'heavy' package you like, Seurat is a good example; there
are other examples in geospatial or bioinformatics etc

  - you can browse _and search_ these to your hearts content

Here is an example of mine. In RcppArmadillo, years ago we (thanks to fine
Google Summer of Code work by Binxiang Ni) added extended support for sparse
matrices pass-through / conversione from R to C++ / Armadillo and back. That
is clearly an optional feature as most uses of (Rcpp)Armadillo use dense
matrices. So all code and test code is _conditional_.  File DESCRIPTION has

   Suggests: [...], Matrix (>= 1.3.0), [...], reticulate, slam

mostly for tests. I.e. We have very little R code: in one single file
R/SciPy2R.R we switched to doing this via reticulate and opee the function
with

if (!requireNamespace("reticulate", quietly=TRUE)) {
stop("You must install the 'reticulate' package (and have SciPy).", 
call.=FALSE)
}

after an actual deprecation warning (as there was scipy converter once).

Similarly, the testsuites in inst/tinytests/* have several

if (!requireNamespace("Matrix", quietly=TRUE)) exit_file("No Matrix 
package")

as well as

if (!requireNamespace("reticulate", quietly=TRUE)) exit_file("Package 
reticulate missing")

if (!packageVersion("reticulate") >= package_version("1.14"))
exit_file("SciPy not needed on newer reticulate")

and tests for slam (another sparse matrix package besides the functionality
in Matrix).

Hopefully this brief snapshot gives you an idea.  There are (likely!!)
thousandss of examples you can browse, and I am sure you will find something.
If you have further (concrete) questions please do not hesitate to use the
resource of this list.

Cheers (or I should say "mit Braunschweiger Gruessen nach Hannover),

Dirk

--
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Dirk Eddelbuettel


Sergej,

Please consider:

  - there are nearly 20k CRAN packages
  
  - all of them are mirrored at https://github.com/cran so you can browse

  - pick any one 'heavy' package you like, Seurat is a good example; there
are other examples in geospatial or bioinformatics etc

  - you can browse _and search_ these to your hearts content

Here is an example of mine. In RcppArmadillo, years ago we (thanks to fine
Google Summer of Code work by Binxiang Ni) added extended support for sparse
matrices pass-through / conversione from R to C++ / Armadillo and back. That
is clearly an optional feature as most uses of (Rcpp)Armadillo use dense
matrices. So all code and test code is _conditional_.  File DESCRIPTION has

   Suggests: [...], Matrix (>= 1.3.0), [...], reticulate, slam

mostly for tests. I.e. We have very little R code: in one single file
R/SciPy2R.R we switched to doing this via reticulate and opee the function
with

if (!requireNamespace("reticulate", quietly=TRUE)) {
stop("You must install the 'reticulate' package (and have SciPy).", 
call.=FALSE)
}

after an actual deprecation warning (as there was scipy converter once).

Similarly, the testsuites in inst/tinytests/* have several

if (!requireNamespace("Matrix", quietly=TRUE)) exit_file("No Matrix 
package")

as well as

if (!requireNamespace("reticulate", quietly=TRUE)) exit_file("Package 
reticulate missing")

if (!packageVersion("reticulate") >= package_version("1.14"))
exit_file("SciPy not needed on newer reticulate")

and tests for slam (another sparse matrix package besides the functionality
in Matrix).

Hopefully this brief snapshot gives you an idea.  There are (likely!!)
thousandss of examples you can browse, and I am sure you will find something.
If you have further (concrete) questions please do not hesitate to use the
resource of this list.

Cheers (or I should say "mit Braunschweiger Gruessen nach Hannover),

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Ruff, Sergej
I took the Seurat package as an example, because it both lists the Bioconductor 
Dependencies under Imports in the DESCRIPTION-File

and it uses conditional functions to check if those dependencies are 
pre-installed.


"No, it is a requirement if the package is used but is not listed in
Depends or Imports.

If the package is in Depends or Imports it is a waste of time to make
the check:  it will always succeed."


that's what I also thought but I am confused why a package like Seurat then 
lists the dependencies in the DESCRIPTION-File and on top of that uses

conditional functions to check if the package is pre-installed or not. Wouldn't 
that make the packagecheck function used by Seurat redundant?

Sergej Ruff


Von: Duncan Murdoch 
Gesendet: Mittwoch, 3. Mai 2023 15:29:34
An: Ruff, Sergej; Ivan Krylov
Cc: r-package-devel@r-project.org
Betreff: Re: AW: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

On 03/05/2023 9:17 a.m., Ruff, Sergej wrote:
> Thanks,
>
>
> So is it just necessary for suggested packages.

Those and "Enhances" packages, but hardly anyone uses "Enhances".
>
>
> So, is it just good practice to make a conditional check?

No, it is a requirement if the package is used but is not listed in
Depends or Imports.

If the package is in Depends or Imports it is a waste of time to make
the check:  it will always succeed.

> I saw some packages still include it.
>
>
> For example the Seurat package.
>
I don't understand your question here.

Duncan Murdoch

>
> Under Utils.R (line 349-379) of the SeuratObject-Package
> (https://cran.r-project.org/src/contrib/Archive/SeuratObject/
> <https://cran.r-project.org/src/contrib/Archive/SeuratObject/>) you will
> find the PackageCheck-function
>
> which used by the Seurat-Package
> (https://cran.r-project.org/src/contrib/Archive/Seurat/
> <https://cran.r-project.org/src/contrib/Archive/Seurat/>) to check if
> packages are alredy installed.
>
>
> You can find examples for DEseq2 under differential_expression.R
> (starting line 1314 or you cntr+f for packagecheck) in
> the Seurat.package
> (https://cran.r-project.org/src/contrib/Archive/Seurat/
> <https://cran.r-project.org/src/contrib/Archive/Seurat/>)
>
> or for limma (starting line 2292).
>
>
>
> ------------
> *Von:* Duncan Murdoch 
> *Gesendet:* Mittwoch, 3. Mai 2023 14:25:56
> *An:* Ruff, Sergej; Ivan Krylov
> *Cc:* r-package-devel@r-project.org
> *Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in
> the Description File of my R Package
>
>
> On 03/05/2023 8:00 a.m., Ruff, Sergej wrote:
> ... [ lines about current solution deleted ]
>
>> Also for the future - how Do i provide Bioconductor dependencies as 
>> "Imports" for a package that I want to submit to CRAN?
>
> Just list it as you would a CRAN package.  The CRAN docs talk about
> "mainstream repositories"; I forget what the definition is of that
> (maybe repositories listed in `file.path(R.home(),
> "etc/repositories")`?), but definitely BioConductor is included.
>
>> Do I need to make that also conditional? I know I should provide 
>> Installation description in a readme fiel but how do I make sure
>
> No, you don't need to check.  If any imported package is not available,
> your package will not load, so errors will happen before you ever get to
> running examples.
>
>> that the Bioconductor dependencies dont cause a rejection from CRAN?
>
> Just make sure they exist on BioC and your code works with them.
>
> Duncan Murdoch
>


[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Duncan Murdoch

On 03/05/2023 9:17 a.m., Ruff, Sergej wrote:

Thanks,


So is it just necessary for suggested packages.


Those and "Enhances" packages, but hardly anyone uses "Enhances".



So, is it just good practice to make a conditional check?


No, it is a requirement if the package is used but is not listed in 
Depends or Imports.


If the package is in Depends or Imports it is a waste of time to make 
the check:  it will always succeed.



I saw some packages still include it.


For example the Seurat package.


I don't understand your question here.

Duncan Murdoch



Under Utils.R (line 349-379) of the SeuratObject-Package 
(https://cran.r-project.org/src/contrib/Archive/SeuratObject/ 
<https://cran.r-project.org/src/contrib/Archive/SeuratObject/>) you will 
find the PackageCheck-function


which used by the Seurat-Package 
(https://cran.r-project.org/src/contrib/Archive/Seurat/ 
<https://cran.r-project.org/src/contrib/Archive/Seurat/>) to check if 
packages are alredy installed.



You can find examples for DEseq2 under differential_expression.R 
(starting line 1314 or you cntr+f for packagecheck) in 
the Seurat.package 
(https://cran.r-project.org/src/contrib/Archive/Seurat/ 
<https://cran.r-project.org/src/contrib/Archive/Seurat/>)


or for limma (starting line 2292).




*Von:* Duncan Murdoch 
*Gesendet:* Mittwoch, 3. Mai 2023 14:25:56
*An:* Ruff, Sergej; Ivan Krylov
*Cc:* r-package-devel@r-project.org
*Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in 
the Description File of my R Package



On 03/05/2023 8:00 a.m., Ruff, Sergej wrote:
... [ lines about current solution deleted ]


Also for the future - how Do i provide Bioconductor dependencies as "Imports" 
for a package that I want to submit to CRAN?


Just list it as you would a CRAN package.  The CRAN docs talk about
"mainstream repositories"; I forget what the definition is of that
(maybe repositories listed in `file.path(R.home(),
"etc/repositories")`?), but definitely BioConductor is included.


Do I need to make that also conditional? I know I should provide Installation 
description in a readme fiel but how do I make sure


No, you don't need to check.  If any imported package is not available,
your package will not load, so errors will happen before you ever get to
running examples.


that the Bioconductor dependencies dont cause a rejection from CRAN?


Just make sure they exist on BioC and your code works with them.

Duncan Murdoch



__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Ruff, Sergej
Thanks,


So is it just necessary for suggested packages.


So, is it just good practice to make a conditional check?

I saw some packages still include it.


For example the Seurat package.


Under Utils.R (line 349-379) of the SeuratObject-Package 
(https://cran.r-project.org/src/contrib/Archive/SeuratObject/) you will find 
the PackageCheck-function

which used by the Seurat-Package 
(https://cran.r-project.org/src/contrib/Archive/Seurat/) to check if packages 
are alredy installed.

You can find examples for DEseq2 under differential_expression.R (starting line 
1314 or you cntr+f for packagecheck) in the Seurat.package 
(https://cran.r-project.org/src/contrib/Archive/Seurat/)

or for limma (starting line 2292).




Von: Duncan Murdoch 
Gesendet: Mittwoch, 3. Mai 2023 14:25:56
An: Ruff, Sergej; Ivan Krylov
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package



On 03/05/2023 8:00 a.m., Ruff, Sergej wrote:
... [ lines about current solution deleted ]

> Also for the future - how Do i provide Bioconductor dependencies as "Imports" 
> for a package that I want to submit to CRAN?

Just list it as you would a CRAN package.  The CRAN docs talk about
"mainstream repositories"; I forget what the definition is of that
(maybe repositories listed in `file.path(R.home(),
"etc/repositories")`?), but definitely BioConductor is included.

> Do I need to make that also conditional? I know I should provide Installation 
> description in a readme fiel but how do I make sure

No, you don't need to check.  If any imported package is not available,
your package will not load, so errors will happen before you ever get to
running examples.

> that the Bioconductor dependencies dont cause a rejection from CRAN?

Just make sure they exist on BioC and your code works with them.

Duncan Murdoch


[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Duncan Murdoch




On 03/05/2023 8:00 a.m., Ruff, Sergej wrote:
... [ lines about current solution deleted ]


Also for the future - how Do i provide Bioconductor dependencies as "Imports" 
for a package that I want to submit to CRAN?


Just list it as you would a CRAN package.  The CRAN docs talk about 
"mainstream repositories"; I forget what the definition is of that 
(maybe repositories listed in `file.path(R.home(), 
"etc/repositories")`?), but definitely BioConductor is included.



Do I need to make that also conditional? I know I should provide Installation 
description in a readme fiel but how do I make sure


No, you don't need to check.  If any imported package is not available, 
your package will not load, so errors will happen before you ever get to 
running examples.



that the Bioconductor dependencies dont cause a rejection from CRAN?


Just make sure they exist on BioC and your code works with them.

Duncan Murdoch

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-05-03 Thread Ruff, Sergej
I implemented teh limma Bioconductor dependency into the Suggests file and made 
it conditionally


Meaning I provided the Description File with


Suggests:
BiocManager,
limma


and created a short function which checks if limma is available


#' Check for package dependency
#'
#' @title Check for 'limma' availability
#' @description checks if the 'limma' package is installed. If not already 
installed,
#' limma will be installed automatically.
#' @author Sergej Ruff
#' @importFrom utils install.packages menu
#' @export
#' @keywords internal
check_limma <- function() # Returns TRUE if available, FALSE otherwise
{
  if(requireNamespace("limma", quietly=TRUE)) return(TRUE)
  if(!interactive()) return(FALSE)
  inst <- menu(c("Yes", "No"), title="Package {limma} required but not 
installed.\nDo you want to install it now?")
  if(inst != 1)
  {
message("To run this example, first install {limma} following the 
directions at 'https://bioconductor.org/packages/limma'")
return(FALSE)
  }
  # the following could be wrapped in try and conditionally return TRUE / FALSE
  if(!requireNamespace("BiocManager", quietly=TRUE)) 
install.packages("BiocManager", quiet=TRUE)
  BiocManager::install("limma", update=FALSE, ask=FALSE, quiet=TRUE)
  return(TRUE)
}

In the example field which uses the limma functions I then implemented the 
check-function:


if(check_limma()){
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)

### Calculation of confidence intervals
CI = fc_ci(fit=fit, alpha=0.05, method="raw")
head(CI)
CI = fc_ci(fit=fit, alpha=0.05, method="BH")
head(CI)
CI = fc_ci(fit=fit, alpha=0.05, method="BY")
head(CI)

fc_plot(CI, xlim=c(-0.5, 3), ylim=-log10(c(1, 0.0001)), updown="up")
fc_plot(CI, xlim=c(-3, 0.5), ylim=-log10(c(1, 0.0001)), updown="down")
fc_plot(CI, xlim=c(-3, 3), ylim=-log10(c(1, 0.0001)), updown="all")
}



I don�t get any Errors. Thank you R mailing list for providing the tips.


I just wanted to ask, if theres any other way to implement it, since I have 
never seen an example field

which has a check-if dependency is available function.


Is there any Improvments i could make or better methods.


Also for the future - how Do i provide Bioconductor dependencies as "Imports" 
for a package that I want to submit to CRAN?

Do I need to make that also conditional? I know I should provide Installation 
description in a readme fiel but how do I make sure

that the Bioconductor dependencies dont cause a rejection from CRAN?


Best Regards,

Sergej

____________
Von: Ivan Krylov 
Gesendet: Montag, 20. M�rz 2023 21:08:38
An: Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

On Mon, 20 Mar 2023 19:32:03 +
"Ruff, Sergej"  wrote:

> but I thought Notes will also cause rejection when submitting a
> package to CRAN. Won�t that be a problem?

True, a NOTE during an automatic check may cause a rejection, but you
won't get this NOTE there. Automatic CRAN pre-tests are done with a
full package set: anything from CRAN and BioConductor that runs on a
given operating system can be loaded.

(This differentiates CRAN from, say, PyPI or NPM: the two latter
ecosystems are much larger and are expected to handle conflicting
dependency requirements. CRAN is small enough to be able to enforce the
rule that every package must play well with the latest version of
everything else.)

There's an additional CRAN check called noSuggests
<https://www.stats.ox.ac.uk/pub/bdr/noSuggests/README.txt>. You will
get a NOTE there, but it's expected and won't count against you. The
only way avoid this NOTE there is to not have any packages in Suggests:
(or Enhances:).

--
Best regards,
Ivan

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-20 Thread Ivan Krylov
On Mon, 20 Mar 2023 19:32:03 +
"Ruff, Sergej"  wrote:

> but I thought Notes will also cause rejection when submitting a
> package to CRAN. Won´t that be a problem?

True, a NOTE during an automatic check may cause a rejection, but you
won't get this NOTE there. Automatic CRAN pre-tests are done with a
full package set: anything from CRAN and BioConductor that runs on a
given operating system can be loaded.

(This differentiates CRAN from, say, PyPI or NPM: the two latter
ecosystems are much larger and are expected to handle conflicting
dependency requirements. CRAN is small enough to be able to enforce the
rule that every package must play well with the latest version of
everything else.)

There's an additional CRAN check called noSuggests
. You will
get a NOTE there, but it's expected and won't count against you. The
only way avoid this NOTE there is to not have any packages in Suggests:
(or Enhances:).

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-20 Thread Ruff, Sergej
thanks,


but I thought Notes will also cause rejection when submitting a package to 
CRAN. Won´t that be a problem?

My package isn´t new, so it will most likely only be checked by CRAN´s 
automatic system.


Von: Ivan Krylov 
Gesendet: Montag, 20. März 2023 12:55:58
An: Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

В Mon, 20 Mar 2023 08:38:41 +
"Ruff, Sergej"  пишет:

> When Limma is üre-installed, I get the following Note:
>
>
> "Package suggested but not available for checking: 'limma'".
>
>
> Seems like the functions isnt installing limma.
>
> Is there something I am missing?

No, this is exactly how it's supposed to behave under R CMD check. The
CRAN policy forbids packages to install other packages ("Packages
should not write in the user’s home filespace <...> nor anywhere else
on the file system") except when the user gives permission to do so
("Limited exceptions may be allowed in interactive sessions if the
package obtains confirmation from the user").

Under R CMD check, interactive() is FALSE because there is no user to
ask permission from, so the function correctly decides not to install
the package. The resulting NOTE is the expected result here. The
important part is that your example doesn't crash because it's unable
to load the limma namespace.

--
Best regards,
Ivan

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-20 Thread Ivan Krylov
В Mon, 20 Mar 2023 08:38:41 +
"Ruff, Sergej"  пишет:

> When Limma is üre-installed, I get the following Note:
> 
> 
> "Package suggested but not available for checking: 'limma'".
> 
> 
> Seems like the functions isnt installing limma.
> 
> Is there something I am missing?

No, this is exactly how it's supposed to behave under R CMD check. The
CRAN policy forbids packages to install other packages ("Packages
should not write in the user’s home filespace <...> nor anywhere else
on the file system") except when the user gives permission to do so
("Limited exceptions may be allowed in interactive sessions if the
package obtains confirmation from the user").

Under R CMD check, interactive() is FALSE because there is no user to
ask permission from, so the function correctly decides not to install
the package. The resulting NOTE is the expected result here. The
important part is that your example doesn't crash because it's unable
to load the limma namespace.

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-20 Thread Ruff, Sergej
I implemented a function to check if limma is available as suggested by Berry 
and Tiago.

It works fine when limma is pre-installed.
When Limma is not pre-installed, I get the following Note:

"Package suggested but not available for checking: 'limma'".

Seems like the functions isn't installing limma.
Is there something I am missing? I added BiocManager and limma to the suggests 
and utils to Imports.

check_limma <- function() # Returns TRUE if available, FALSE otherwise
{
  if(requireNamespace("limma", quietly=TRUE)) return(TRUE)
  if(!interactive()) return(FALSE)
  inst <- menu(c("Yes", "No"), title="Package {limma} required but not 
installed.\nDo you want to install it now?")
  if(inst != 1)
  {
message("To run this example, first install {limma} following the 
directions at 'https://bioconductor.org/packages/limma'")
return(FALSE)
  }
  # the following could be wrapped in try and conditionally return TRUE / FALSE
  if(!requireNamespace("BiocManager", quietly=TRUE)) 
install.packages("BiocManager", quiet=TRUE)
  BiocManager::install("limma", update=FALSE, ask=FALSE, quiet=TRUE)
  return(TRUE)
}

The check also never brings up the menu to ask me, if limma should be 
installed. Is that normal or should I change something about the
function.

Regards,
Sergej



Von: Tiago Olivoto 
Gesendet: Donnerstag, 16. M�rz 2023 17:36:47
An: Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

Hi,
My package pliman depends on EBImage which is in Bioconductor. I have created a 
function check_ebi() 
<https://github.com/TiagoOlivoto/pliman/blob/e6efc4b6a2396600939e308c235aeb9ab47af375/R/utilities.R#L534>
 that is called in .onAttach() 
<https://github.com/TiagoOlivoto/pliman/blob/master/R/zzz.R#L36>  and checks if 
EBImage is installed. If not, the function asks the user to install it. Both 
EBImage and BiocManager are listed as suggests 
<https://github.com/TiagoOlivoto/pliman/blob/master/DESCRIPTION#L22>

I believe that this could be a possible solution
Best regards,
Olivoto


Em qui., 16 de mar. de 2023 �s 11:18, Ruff, Sergej 
mailto:sergej.r...@tiho-hannover.de>> escreveu:
I am currently building a package which uses the "limma"-package as a 
dependency.

I want to submit my package to CRAN.

Do I need to declare Bioconductor-dependencies such as Limma differently in the 
Description-File of my Package?

The Check-Function in R shows no Notes, Warnings or Errors, but I am not sure 
if that means that limma will install when installing my package from CRAN.

Currently I am declaring limma like this:

Suggests:

limma



Can CRAN identify that limma is a Bioconductor-Package and will it Limma 
install, when installing my package from CRAN?

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org<mailto:R-package-devel@r-project.org> mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-20 Thread Ruff, Sergej
I implemented Berrys function.


I works fine when limma is pre-installed.

When Limma is üre-installed, I get the following Note:


"Package suggested but not available for checking: 'limma'".


Seems like the functions isnt installing limma.

Is there something I am missing? I added BiocManager and limma to the suggests 
and utils to Imports.


Regards,

Sergej


Von: Ruff, Sergej
Gesendet: Samstag, 18. März 2023 09:56:55
An: Berry Boessenkool; Simon Urbanek
Cc: r-package-devel@r-project.org
Betreff: AW: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package


thank you, berry for your idea.


Von: Berry Boessenkool 
Gesendet: Samstag, 18. März 2023 09:54:45
An: Ruff, Sergej; Simon Urbanek
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package


I would use conditional returns to make the code more readable (see below) and 
then run the examples conditionally.

check_limma <- function() # Returns TRUE if available, FALSE otherwise
{
  if(requireNamespace("limma", quietly=TRUE)) return(TRUE)
  if(!interactive()) return(FALSE)
  inst <- menu(c("Yes", "No"), title="Package {limma} required but not 
installed.\nDo you want to install it now?")
  if(inst != 1)
{
message("To run this example, first install {limma} following the 
directions at 'https://bioconductor.org/packages/limma'")
return(FALSE)
}
  # the following could be wrapped in try and conditionally return TRUE / FALSE
  if(!requireNamespace("BiocManager", quietly=TRUE)) 
install.packages("BiocManager", quiet=TRUE)
  BiocManager::install("limma", update=FALSE, ask=FALSE, quiet=TRUE)
  return(TRUE)
}

# In the examples:
if(check_limma()){
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)
}

My 2 cents 🙂

Berry

-


From: R-package-devel  on behalf of 
Ruff, Sergej 
Sent: Friday, March 17, 2023 22:29
To: Simon Urbanek 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

thank,


I was wondering if my idea regarding the implementation is correct.


I took the idea from Tiago Olivoto and wrote an additional function that checks 
if limma is installed.


Here is a mockup based on Tiago�s package:


check_limma<- function(){
  if(!requireNamespace("limma", quietly = TRUE)) {
if(interactive() == TRUE){
  inst <-
switch(menu(c("Yes", "No"), title = "Package {limma} required but not 
installed.\nDo you want to install it now?"),
   "yes", "no")
  if(inst == "yes"){
if(!requireNamespace("BiocManager", quietly = TRUE)) {
  install.packages("BiocManager", quiet = TRUE)
}
BiocManager::install("limma",
 update = FALSE,
 ask = FALSE,
 quiet = TRUE)
  } else{
message("To run this example}, first install {limma} following the 
directions at 'https://bioconductor.org/packages/limma'")
  }
}
  }
}

I would add the check in my example before limma functions are used.


### Differential expression analysis with limma

check_limma()
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)

I tried running the R CMD Check but I keep getting 1 error and note.
Is the implementation incorrect?

regards, Sergej


____________
Von: Simon Urbanek 
Gesendet: Freitag, 17. M�rz 2023 22:05:00
An: Ruff, Sergej
Cc: Duncan Murdoch; Martin Morgan; Ivan Krylov; r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

Packages can only be installed from the repositories listed and only CRAN is 
the default so only CRAN package are guaranteed to work. I'd like to add that 
the issue below is exactly why, personally, I would not recommend using 
Bioconductor package as strong dependency (imports/depends), because that makes 
the package unusable for most users, as it cannot be installed (without extra 
steps they don't know about) since the dependency doesn't exist on CRAN.

If your users are already Bioconductor users by the virtue of the package 
application then they already know so it's fine, but then you are probably 
better off to have your package on Bioconductor as part of the ecosystem which 
is much more streamlined and coordinated.

If it is only suggested (weak dependency) for some opt

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-18 Thread Ruff, Sergej
thank you, berry for your idea.


Von: Berry Boessenkool 
Gesendet: Samstag, 18. März 2023 09:54:45
An: Ruff, Sergej; Simon Urbanek
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package


I would use conditional returns to make the code more readable (see below) and 
then run the examples conditionally.

check_limma <- function() # Returns TRUE if available, FALSE otherwise
{
  if(requireNamespace("limma", quietly=TRUE)) return(TRUE)
  if(!interactive()) return(FALSE)
  inst <- menu(c("Yes", "No"), title="Package {limma} required but not 
installed.\nDo you want to install it now?")
  if(inst != 1)
{
message("To run this example, first install {limma} following the 
directions at 'https://bioconductor.org/packages/limma'")
return(FALSE)
}
  # the following could be wrapped in try and conditionally return TRUE / FALSE
  if(!requireNamespace("BiocManager", quietly=TRUE)) 
install.packages("BiocManager", quiet=TRUE)
  BiocManager::install("limma", update=FALSE, ask=FALSE, quiet=TRUE)
  return(TRUE)
}

# In the examples:
if(check_limma()){
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)
}

My 2 cents 🙂

Berry

-


From: R-package-devel  on behalf of 
Ruff, Sergej 
Sent: Friday, March 17, 2023 22:29
To: Simon Urbanek 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

thank,


I was wondering if my idea regarding the implementation is correct.


I took the idea from Tiago Olivoto and wrote an additional function that checks 
if limma is installed.


Here is a mockup based on Tiago�s package:


check_limma<- function(){
  if(!requireNamespace("limma", quietly = TRUE)) {
if(interactive() == TRUE){
  inst <-
switch(menu(c("Yes", "No"), title = "Package {limma} required but not 
installed.\nDo you want to install it now?"),
   "yes", "no")
  if(inst == "yes"){
if(!requireNamespace("BiocManager", quietly = TRUE)) {
  install.packages("BiocManager", quiet = TRUE)
}
BiocManager::install("limma",
 update = FALSE,
 ask = FALSE,
 quiet = TRUE)
  } else{
message("To run this example}, first install {limma} following the 
directions at 'https://bioconductor.org/packages/limma'")
  }
}
  }
}

I would add the check in my example before limma functions are used.


### Differential expression analysis with limma

check_limma()
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)

I tried running the R CMD Check but I keep getting 1 error and note.
Is the implementation incorrect?

regards, Sergej


________
Von: Simon Urbanek 
Gesendet: Freitag, 17. M�rz 2023 22:05:00
An: Ruff, Sergej
Cc: Duncan Murdoch; Martin Morgan; Ivan Krylov; r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

Packages can only be installed from the repositories listed and only CRAN is 
the default so only CRAN package are guaranteed to work. I'd like to add that 
the issue below is exactly why, personally, I would not recommend using 
Bioconductor package as strong dependency (imports/depends), because that makes 
the package unusable for most users, as it cannot be installed (without extra 
steps they don't know about) since the dependency doesn't exist on CRAN.

If your users are already Bioconductor users by the virtue of the package 
application then they already know so it's fine, but then you are probably 
better off to have your package on Bioconductor as part of the ecosystem which 
is much more streamlined and coordinated.

If it is only suggested (weak dependency) for some optional functionality, then 
your package will work even if the dependency is not installed so all is well. 
And if the optional Bioconductor functionality is used you can direct the user 
to instructions explaining that Bioconductor is required for that - but the 
package has to do that, it is not anything automatic in R.

Cheers,
Simon


> On Mar 18, 2023, at 1:29 AM, Ruff, Sergej  
> wrote:
>
> Really.Whats a problem i have when all dependencies arent prei installed. I 
> thought the problem would be solved once my package is available on CRAN.
>
>
> Here is a recent question I had regarding the same issue:
>
>
> I am curre

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-18 Thread Berry Boessenkool

I would use conditional returns to make the code more readable (see below) and 
then run the examples conditionally.

check_limma <- function() # Returns TRUE if available, FALSE otherwise
{
  if(requireNamespace("limma", quietly=TRUE)) return(TRUE)
  if(!interactive()) return(FALSE)
  inst <- menu(c("Yes", "No"), title="Package {limma} required but not 
installed.\nDo you want to install it now?")
  if(inst != 1)
{
message("To run this example, first install {limma} following the 
directions at 'https://bioconductor.org/packages/limma'")
return(FALSE)
}
  # the following could be wrapped in try and conditionally return TRUE / FALSE
  if(!requireNamespace("BiocManager", quietly=TRUE)) 
install.packages("BiocManager", quiet=TRUE)
  BiocManager::install("limma", update=FALSE, ask=FALSE, quiet=TRUE)
  return(TRUE)
}

# In the examples:
if(check_limma()){
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)
}

My 2 cents 🙂

Berry

-


From: R-package-devel  on behalf of 
Ruff, Sergej 
Sent: Friday, March 17, 2023 22:29
To: Simon Urbanek 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

thank,


I was wondering if my idea regarding the implementation is correct.


I took the idea from Tiago Olivoto and wrote an additional function that checks 
if limma is installed.


Here is a mockup based on Tiago�s package:


check_limma<- function(){
  if(!requireNamespace("limma", quietly = TRUE)) {
if(interactive() == TRUE){
  inst <-
switch(menu(c("Yes", "No"), title = "Package {limma} required but not 
installed.\nDo you want to install it now?"),
   "yes", "no")
  if(inst == "yes"){
if(!requireNamespace("BiocManager", quietly = TRUE)) {
  install.packages("BiocManager", quiet = TRUE)
}
BiocManager::install("limma",
 update = FALSE,
 ask = FALSE,
 quiet = TRUE)
  } else{
message("To run this example}, first install {limma} following the 
directions at 'https://bioconductor.org/packages/limma'")
  }
}
  }
}

I would add the check in my example before limma functions are used.


### Differential expression analysis with limma

check_limma()
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)

I tried running the R CMD Check but I keep getting 1 error and note.
Is the implementation incorrect?

regards, Sergej


________
Von: Simon Urbanek 
Gesendet: Freitag, 17. M�rz 2023 22:05:00
An: Ruff, Sergej
Cc: Duncan Murdoch; Martin Morgan; Ivan Krylov; r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

Packages can only be installed from the repositories listed and only CRAN is 
the default so only CRAN package are guaranteed to work. I'd like to add that 
the issue below is exactly why, personally, I would not recommend using 
Bioconductor package as strong dependency (imports/depends), because that makes 
the package unusable for most users, as it cannot be installed (without extra 
steps they don't know about) since the dependency doesn't exist on CRAN.

If your users are already Bioconductor users by the virtue of the package 
application then they already know so it's fine, but then you are probably 
better off to have your package on Bioconductor as part of the ecosystem which 
is much more streamlined and coordinated.

If it is only suggested (weak dependency) for some optional functionality, then 
your package will work even if the dependency is not installed so all is well. 
And if the optional Bioconductor functionality is used you can direct the user 
to instructions explaining that Bioconductor is required for that - but the 
package has to do that, it is not anything automatic in R.

Cheers,
Simon


> On Mar 18, 2023, at 1:29 AM, Ruff, Sergej  
> wrote:
>
> Really.Whats a problem i have when all dependencies arent prei installed. I 
> thought the problem would be solved once my package is available on CRAN.
>
>
> Here is a recent question I had regarding the same issue:
>
>
> I am currently working on a r-package. I would like to submit my r package to 
> CRAN, but I have a question regarding dependency installations on CRAN.
>
> I have almost finished my package, added the required dependencies to the 
> NAMESPACE and DESCRIPTION files as Imports, and get no errors or warnin

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ruff, Sergej
thank,


I was wondering if my idea regarding the implementation is correct.


I took the idea from Tiago Olivoto and wrote an additional function that checks 
if limma is installed.


Here is a mockup based on Tiago�s package:


check_limma<- function(){
  if(!requireNamespace("limma", quietly = TRUE)) {
if(interactive() == TRUE){
  inst <-
switch(menu(c("Yes", "No"), title = "Package {limma} required but not 
installed.\nDo you want to install it now?"),
   "yes", "no")
  if(inst == "yes"){
if(!requireNamespace("BiocManager", quietly = TRUE)) {
  install.packages("BiocManager", quiet = TRUE)
}
BiocManager::install("limma",
 update = FALSE,
 ask = FALSE,
 quiet = TRUE)
  } else{
message("To run this example}, first install {limma} following the 
directions at 'https://bioconductor.org/packages/limma'")
  }
}
  }
}

I would add the check in my example before limma functions are used.


### Differential expression analysis with limma

check_limma()
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)

I tried running the R CMD Check but I keep getting 1 error and note.
Is the implementation incorrect?

regards, Sergej



Von: Simon Urbanek 
Gesendet: Freitag, 17. M�rz 2023 22:05:00
An: Ruff, Sergej
Cc: Duncan Murdoch; Martin Morgan; Ivan Krylov; r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

Packages can only be installed from the repositories listed and only CRAN is 
the default so only CRAN package are guaranteed to work. I'd like to add that 
the issue below is exactly why, personally, I would not recommend using 
Bioconductor package as strong dependency (imports/depends), because that makes 
the package unusable for most users, as it cannot be installed (without extra 
steps they don't know about) since the dependency doesn't exist on CRAN.

If your users are already Bioconductor users by the virtue of the package 
application then they already know so it's fine, but then you are probably 
better off to have your package on Bioconductor as part of the ecosystem which 
is much more streamlined and coordinated.

If it is only suggested (weak dependency) for some optional functionality, then 
your package will work even if the dependency is not installed so all is well. 
And if the optional Bioconductor functionality is used you can direct the user 
to instructions explaining that Bioconductor is required for that - but the 
package has to do that, it is not anything automatic in R.

Cheers,
Simon


> On Mar 18, 2023, at 1:29 AM, Ruff, Sergej  
> wrote:
>
> Really.Whats a problem i have when all dependencies arent prei installed. I 
> thought the problem would be solved once my package is available on CRAN.
>
>
> Here is a recent question I had regarding the same issue:
>
>
> I am currently working on a r-package. I would like to submit my r package to 
> CRAN, but I have a question regarding dependency installations on CRAN.
>
> I have almost finished my package, added the required dependencies to the 
> NAMESPACE and DESCRIPTION files as Imports, and get no errors or warnings
>
> when running the check in Rstudio. The package runs on the pc, where I�ve 
> built the package, but when I install the package on a pc, where the 
> dependencies
>
> are not preinstalled, I get the following error:
>
> ERROR:
>
> dependencies 'depth', 'geometry' are not available for package 'packagename'
> * removing 
> 'C:/Users/156932/AppData/Local/Programs/R/R-4.2.1/library/packagename'
> Warning in install.packages : installation of package �packagename� had 
> non-zero exit status
>
>
> The problem is that a local installation of my package (via USB-stick for 
> example) can�t install the dependencies from CRAN.
>
> The package works perfectly fine, if the dependencies are preinstalled.
>
> Now I don�t want to submit my package to CRAN if the end user gets the same 
> error message when installing my package.
>
> Question: After I submit my package to CRAN, will CRAN install dependencies 
> automatically (via "install.packages()"), resolving the issue I have right 
> now?
>
> Or do I have to modify the R-package or the Description-file to make sure my 
> Package can install dependencies?
>
> I provided the dependencies to the NAMESPACE-file as @ImportFrom via the 
> devtools::document()-function. I added the dependencies to the 
> DESCRIPTION-f

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Simon Urbanek
Packages can only be installed from the repositories listed and only CRAN is 
the default so only CRAN package are guaranteed to work. I'd like to add that 
the issue below is exactly why, personally, I would not recommend using 
Bioconductor package as strong dependency (imports/depends), because that makes 
the package unusable for most users, as it cannot be installed (without extra 
steps they don't know about) since the dependency doesn't exist on CRAN.

If your users are already Bioconductor users by the virtue of the package 
application then they already know so it's fine, but then you are probably 
better off to have your package on Bioconductor as part of the ecosystem which 
is much more streamlined and coordinated.

If it is only suggested (weak dependency) for some optional functionality, then 
your package will work even if the dependency is not installed so all is well. 
And if the optional Bioconductor functionality is used you can direct the user 
to instructions explaining that Bioconductor is required for that - but the 
package has to do that, it is not anything automatic in R.

Cheers,
Simon


> On Mar 18, 2023, at 1:29 AM, Ruff, Sergej  
> wrote:
> 
> Really.Whats a problem i have when all dependencies arent prei installed. I 
> thought the problem would be solved once my package is available on CRAN.
> 
> 
> Here is a recent question I had regarding the same issue:
> 
> 
> I am currently working on a r-package. I would like to submit my r package to 
> CRAN, but I have a question regarding dependency installations on CRAN.
> 
> I have almost finished my package, added the required dependencies to the 
> NAMESPACE and DESCRIPTION files as Imports, and get no errors or warnings
> 
> when running the check in Rstudio. The package runs on the pc, where I´ve 
> built the package, but when I install the package on a pc, where the 
> dependencies
> 
> are not preinstalled, I get the following error:
> 
> ERROR:
> 
> dependencies 'depth', 'geometry' are not available for package 'packagename'
> * removing 
> 'C:/Users/156932/AppData/Local/Programs/R/R-4.2.1/library/packagename'
> Warning in install.packages : installation of package ‘packagename’ had 
> non-zero exit status
> 
> 
> The problem is that a local installation of my package (via USB-stick for 
> example) can´t install the dependencies from CRAN.
> 
> The package works perfectly fine, if the dependencies are preinstalled.
> 
> Now I don´t want to submit my package to CRAN if the end user gets the same 
> error message when installing my package.
> 
> Question: After I submit my package to CRAN, will CRAN install dependencies 
> automatically (via "install.packages()"), resolving the issue I have right 
> now?
> 
> Or do I have to modify the R-package or the Description-file to make sure my 
> Package can install dependencies?
> 
> I provided the dependencies to the NAMESPACE-file as @ImportFrom via the 
> devtools::document()-function. I added the dependencies to the 
> DESCRIPTION-file via usethis::use_package("x",type="Imports"). The 
> Description looks like this:
> 
> License: GPL (>= 3)
> Encoding: UTF-8
> LazyData: true
> RoxygenNote: 7.2.3
> Imports:
>depth,
>geometry,
>graphics,
>grDevices,
>MASS,
>mvtnorm,
>nlme,
>rgl,
>stats
> 
> 
> 
> So I thought all dependencies would install automatically from CRAN? Is that 
> not the case?
> 

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ruff, Sergej
CRIPTION file.  Here's a note
> I received recently when I submitted a new package (RmdConcord):
>
> 
> The Description field is intended to be a (one paragraph) description of
> what the package does and why it may be useful. Please add more details
> about the package functionality and implemented methods in your
> Description text.
>
> Please always write package names, software names and API (application
> programming interface) names in single quotes in title and description.
> e.g: --> 'R Markdown'
> Please note that package names are case sensitive.
>
> Please do not start the description with "This package", "Functions
> for", package name, title or similar.
> -------
>
>
> Duncan Murdoch
>
>>
>>
>> Thats the source of my worries. Will the same error appear when CRAN
>> checks the examples of my package? Or should I not be worried?
>>
>>
>> With regards,
>>
>>
>> Sergej
>>
>> 
>> *Von:* Duncan Murdoch 
>> *Gesendet:* Freitag, 17. März 2023 11:14:25
>> *An:* Ruff, Sergej; Martin Morgan; Ivan Krylov
>> *Cc:* r-package-devel@r-project.org
>> *Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in
>> the Description File of my R Package
>> On 17/03/2023 6:06 a.m., Ruff, Sergej wrote:
>>> I was wondering how CRAN will handle Limma when running the automatic check.
>>>
>>>
>>> I am worried that my package will be rejected if Limma won�t install from 
>>> Bioconductor on a clean version of R. Leading to an Error and Note during 
>>> the check.
>>>
>>>
>>> I am using Limma only for an example in my functions description, not 
>>> inside my actual function.
>>>
>>>
>>> How would CRAN�s System handle that when checking my package for submission?
>>
>> If you have it in the Suggests list you should have written your code to
>> work (i.e. not trigger an error) whether it is installed or not, so you
>> shouldn't worry about it.
>>
>> Duncan Murdoch
>>
>>>
>>>
>>> with regards,
>>>
>>>
>>> Sergej
>>>
>>> 
>>> Von: Martin Morgan 
>>> Gesendet: Donnerstag, 16. M�rz 2023 20:12:51
>>> An: Ivan Krylov; Ruff, Sergej
>>> Cc: r-package-devel@r-project.org
>>> Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
>>> Description File of my R Package
>>>
>>> I would not follow the instructions in RTIGER�s README for installing 
>>> Bioconductor packages.
>>>
>>> BiocManager::install(�RTIGER�) would install both CRAN and Bioconductor 
>>> dependencies of RTIGER, and would be my preferred instruction in a README 
>>> or INSTALL file. A complete instruction might be to install your package as 
>>> if it were on Bioconductor �
>>>
>>> If (!requireNamepace(�BiocManager�, quietly = TRUE))
>>>  install.packages(�BiocManager�)
>>> BiocManager::install(��)
>>>
>>> It does not make sense to me to have instructions in .onAttach / .onLoad or 
>>> in each function for the user to install a �Suggests:� package, when 
>>> actually the package is required for use and belongs in Imports: or perhaps 
>>> Depends:.
>>>
>>> The instruction to use �version = �3.14�� of Bioconductor in the RTIGER 
>>> document is not universally correct, since different Bioconductor versions 
>>> are tied to specific R versions (see 
>>> https://bioconductor.org/about/release-announcements/
> <https://bioconductor.org/about/release-announcements/>
>> <https://bioconductor.org/about/release-announcements/
> <https://bioconductor.org/about/release-announcements/>> ). On one
>> version of R I am currently using, I get
>>>
>>>> BiocManager::install(version = "3.14")
>>> Error: Bioconductor version '3.14' requires R version '4.1'; use
>>>`BiocManager::install(version = '3.17')` with R version 4.3; see
>>>https://bioconductor.org/install <https://bioconductor.org/install>
> <https://bioconductor.org/install <https://bioconductor.org/install>>
>>>
>>> The instruction to install a vector of Bioconductor packages is also 
>>> unnecessary for Bioconductor packages in the Imports: or Depends: field of 
>>> , or if one were 

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Duncan Murdoch
 Ivan Krylov
*Cc:* r-package-devel@r-project.org
*Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in 
the Description File of my R Package

On 17/03/2023 6:06 a.m., Ruff, Sergej wrote:

I was wondering how CRAN will handle Limma when running the automatic check.


I am worried that my package will be rejected if Limma won�t install from 
Bioconductor on a clean version of R. Leading to an Error and Note during the 
check.


I am using Limma only for an example in my functions description, not inside my 
actual function.


How would CRAN�s System handle that when checking my package for submission?


If you have it in the Suggests list you should have written your code to
work (i.e. not trigger an error) whether it is installed or not, so you
shouldn't worry about it.

Duncan Murdoch




with regards,


Sergej

____________
Von: Martin Morgan 
Gesendet: Donnerstag, 16. M�rz 2023 20:12:51
An: Ivan Krylov; Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

I would not follow the instructions in RTIGER�s README for installing 
Bioconductor packages.

BiocManager::install(�RTIGER�) would install both CRAN and Bioconductor 
dependencies of RTIGER, and would be my preferred instruction in a README or 
INSTALL file. A complete instruction might be to install your package as if it 
were on Bioconductor �

If (!requireNamepace(�BiocManager�, quietly = TRUE))
  install.packages(�BiocManager�)
BiocManager::install(��)

It does not make sense to me to have instructions in .onAttach / .onLoad or in 
each function for the user to install a �Suggests:� package, when actually the 
package is required for use and belongs in Imports: or perhaps Depends:.

The instruction to use �version = �3.14�� of Bioconductor in the RTIGER document is not universally correct, since different Bioconductor versions are tied to specific R versions (see https://bioconductor.org/about/release-announcements/ 

<https://bioconductor.org/about/release-announcements/>
<https://bioconductor.org/about/release-announcements/ 

<https://bioconductor.org/about/release-announcements/>> ). On one

version of R I am currently using, I get



BiocManager::install(version = "3.14")

Error: Bioconductor version '3.14' requires R version '4.1'; use
    `BiocManager::install(version = '3.17')` with R version 4.3; see
   https://bioconductor.org/install <https://bioconductor.org/install> 

<https://bioconductor.org/install <https://bioconductor.org/install>>


The instruction to install a vector of Bioconductor packages is also unnecessary for Bioconductor packages in the Imports: or Depends: field of , or if one were to pass the argument `dependencies = TRUE` to either BiocManager::install() or  install.packages()  (to get the Suggests: packages of  

to be installed, as

well as Depends:, Imports: and LinkingTo:).


Briefly, installation requires R to know the correct repositories. The command

BiocManager::repositories()

Returns a vector of Bioconductor and CRAN repositories relevant to your version 
of R. If one is averse to using BiocManager::install(�RTIGER�), a reasonable 
alternative, though still requiring that the BiocManager package is installed, 
is

install.packages(�RTIGER�, repos = BiocManager::repositories())

Base R also provides a mechanism for specifying Bioconductor repositories, via 
`setRepositories()` called before install.packages(). However, this is not 
recommended because, as can be seen on the web page mentioned above, there are 
two versions of Bioconductor for each version of R � one always gets the �old� 
Bioconductor

version, even when a newer version is available.


From: R-package-devel  on behalf of Ivan 
Krylov 
Date: Thursday, March 16, 2023 at 2:15 PM
To: Ruff, Sergej 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package
On Thu, 16 Mar 2023 17:01:55 +
"Ruff, Sergej"  wrote:


Last question: How does CRAN work with Bioconductor Dependencies?
Will CRAN accept limma as a dependency or will my submission be
rejected?


It's not explicitly spelled out in the CRAN policy
<https://cran.r-project.org/web/packages/policies.html
<https://cran.r-project.org/web/packages/policies.html 

<https://cran.r-project.org/web/packages/policies.html>>>, but

Bioconductor and CRAN are the "mainstream repositories" for the
purposes of the following rule:


Packages on which a CRAN package depends should be available from a
mainstream repository


(Even non-mainstream repositories are allowed for optional dependencies
if you follow a few additional rules.)

Here's an example of a CRAN package with a strong dependency on a
Bioconductor package: <https://CRAN.R-project.org/packa

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ivan Krylov
В Fri, 17 Mar 2023 12:29:51 +
"Ruff, Sergej"  пишет:

> The problem is that a local installation of my package (via USB-stick
> for example) can´t install the dependencies from CRAN.
> 
> The package works perfectly fine, if the dependencies are
> preinstalled.

This is a similar, but different problem. It is indeed solved by having
your package with its dependencies in a repository.

> So I thought all dependencies would install automatically from CRAN?

The user is allowed to install your package with dependencies = NA
(which means not installing packages listed under Suggests). The
Depends, Imports and LinkingTo will be installed, but not Suggests. The
user will have to pass dependencies = TRUE in order to install the
packages listed under Suggests.

Your package is required to work (in particular, run the examples and
vignettes and pass the tests without errors) without having the
suggested packages installed:
.
You can check whether limma can be loaded and raise an error otherwise,
but your tests, examples and vignettes shouldn't raise errors or
otherwise crash. This is checked by CRAN here:
https://www.stats.ox.ac.uk/pub/bdr/noSuggests/README.txt

If your package can't be meaningfully used without limma, do list it as
a strong dependency.

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Uwe Ligges
The user should set the CRAN+BioC via setRepositories() and then run 
install.packages() will install all dependencies automatically.
Of course, if you install from a local repository without the required 
packages or from a USB drive, R cannot resolve dependencies.


Best,
Uwe Ligges



On 17.03.2023 13:29, Ruff, Sergej wrote:

Really.Whats a problem i have when all dependencies arent prei installed. I 
thought the problem would be solved once my package is available on CRAN.


Here is a recent question I had regarding the same issue:


I am currently working on a r-package. I would like to submit my r package to 
CRAN, but I have a question regarding dependency installations on CRAN.

I have almost finished my package, added the required dependencies to the 
NAMESPACE and DESCRIPTION files as Imports, and get no errors or warnings

when running the check in Rstudio. The package runs on the pc, where I´ve built 
the package, but when I install the package on a pc, where the dependencies

are not preinstalled, I get the following error:

ERROR:

dependencies 'depth', 'geometry' are not available for package 'packagename'
* removing 
'C:/Users/156932/AppData/Local/Programs/R/R-4.2.1/library/packagename'
Warning in install.packages : installation of package ‘packagename’ had 
non-zero exit status


The problem is that a local installation of my package (via USB-stick for 
example) can´t install the dependencies from CRAN.

The package works perfectly fine, if the dependencies are preinstalled.

Now I don´t want to submit my package to CRAN if the end user gets the same 
error message when installing my package.

Question: After I submit my package to CRAN, will CRAN install dependencies automatically 
(via "install.packages()"), resolving the issue I have right now?

Or do I have to modify the R-package or the Description-file to make sure my 
Package can install dependencies?

I provided the dependencies to the NAMESPACE-file as @ImportFrom via the 
devtools::document()-function. I added the dependencies to the DESCRIPTION-file via 
usethis::use_package("x",type="Imports"). The Description looks like this:

License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
Imports:
 depth,
 geometry,
 graphics,
 grDevices,
 MASS,
 mvtnorm,
 nlme,
 rgl,
 stats



So I thought all dependencies would install automatically from CRAN? Is that 
not the case?



Von: Duncan Murdoch 
Gesendet: Freitag, 17. März 2023 13:15:28
An: Ruff, Sergej; Martin Morgan; Ivan Krylov
Cc: r-package-devel@r-project.org
Betreff: Re: AW: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

On 17/03/2023 6:19 a.m., Ruff, Sergej wrote:

In my example I have the following lines:


### Differential expression analysis with limma
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)

The R CMD Check returns no Errors or Notes if Limma is pre-installed. If
limma is not pre-installed I get an error, reminding me that Limma is
not available.


That's a problem, and will cause your package to be rejected.  It should
not raise an error during the tests when a suggested package is missing.
Ivan gave you good advice on how to fix this.

I'd recommend testing your package a few times on Winbuilder and fixing
things until you get clean results.  That won't guarantee acceptance on
CRAN; new packages get a manual inspection as well, and they'll often
find some problem that the automatic tests don't find, e.g. stylistic
issues in the Description field of the DESCRIPTION file.  Here's a note
I received recently when I submitted a new package (RmdConcord):


The Description field is intended to be a (one paragraph) description of
what the package does and why it may be useful. Please add more details
about the package functionality and implemented methods in your
Description text.

Please always write package names, software names and API (application
programming interface) names in single quotes in title and description.
e.g: --> 'R Markdown'
Please note that package names are case sensitive.

Please do not start the description with "This package", "Functions
for", package name, title or similar.
---


Duncan Murdoch




Thats the source of my worries. Will the same error appear when CRAN
checks the examples of my package? Or should I not be worried?


With regards,


Sergej


*Von:* Duncan Murdoch 
*Gesendet:* Freitag, 17. März 2023 11:14:25
*An:* Ruff, Sergej; Martin Morgan; Ivan Krylov
*Cc:* r-package-devel@r-project.org
*Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in
the Description File of my R Package
On 17/03/2023 6:06 a.m

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ruff, Sergej
Really.Whats a problem i have when all dependencies arent prei installed. I 
thought the problem would be solved once my package is available on CRAN.


Here is a recent question I had regarding the same issue:


I am currently working on a r-package. I would like to submit my r package to 
CRAN, but I have a question regarding dependency installations on CRAN.

I have almost finished my package, added the required dependencies to the 
NAMESPACE and DESCRIPTION files as Imports, and get no errors or warnings

when running the check in Rstudio. The package runs on the pc, where I´ve built 
the package, but when I install the package on a pc, where the dependencies

are not preinstalled, I get the following error:

ERROR:

dependencies 'depth', 'geometry' are not available for package 'packagename'
* removing 
'C:/Users/156932/AppData/Local/Programs/R/R-4.2.1/library/packagename'
Warning in install.packages : installation of package ‘packagename’ had 
non-zero exit status


The problem is that a local installation of my package (via USB-stick for 
example) can´t install the dependencies from CRAN.

The package works perfectly fine, if the dependencies are preinstalled.

Now I don´t want to submit my package to CRAN if the end user gets the same 
error message when installing my package.

Question: After I submit my package to CRAN, will CRAN install dependencies 
automatically (via "install.packages()"), resolving the issue I have right now?

Or do I have to modify the R-package or the Description-file to make sure my 
Package can install dependencies?

I provided the dependencies to the NAMESPACE-file as @ImportFrom via the 
devtools::document()-function. I added the dependencies to the DESCRIPTION-file 
via usethis::use_package("x",type="Imports"). The Description looks like this:

License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
Imports:
depth,
geometry,
graphics,
grDevices,
MASS,
mvtnorm,
nlme,
rgl,
stats



So I thought all dependencies would install automatically from CRAN? Is that 
not the case?



Von: Duncan Murdoch 
Gesendet: Freitag, 17. März 2023 13:15:28
An: Ruff, Sergej; Martin Morgan; Ivan Krylov
Cc: r-package-devel@r-project.org
Betreff: Re: AW: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

On 17/03/2023 6:19 a.m., Ruff, Sergej wrote:
> In my example I have the following lines:
>
>
> ### Differential expression analysis with limma
> group = gl(2, n)
> design = model.matrix(~ group)
> fit1 = limma::lmFit(X, design)
> fit = limma::eBayes(fit1)
>
> The R CMD Check returns no Errors or Notes if Limma is pre-installed. If
> limma is not pre-installed I get an error, reminding me that Limma is
> not available.

That's a problem, and will cause your package to be rejected.  It should
not raise an error during the tests when a suggested package is missing.
Ivan gave you good advice on how to fix this.

I'd recommend testing your package a few times on Winbuilder and fixing
things until you get clean results.  That won't guarantee acceptance on
CRAN; new packages get a manual inspection as well, and they'll often
find some problem that the automatic tests don't find, e.g. stylistic
issues in the Description field of the DESCRIPTION file.  Here's a note
I received recently when I submitted a new package (RmdConcord):


The Description field is intended to be a (one paragraph) description of
what the package does and why it may be useful. Please add more details
about the package functionality and implemented methods in your
Description text.

Please always write package names, software names and API (application
programming interface) names in single quotes in title and description.
e.g: --> 'R Markdown'
Please note that package names are case sensitive.

Please do not start the description with "This package", "Functions
for", package name, title or similar.
---


Duncan Murdoch

>
>
> Thats the source of my worries. Will the same error appear when CRAN
> checks the examples of my package? Or should I not be worried?
>
>
> With regards,
>
>
> Sergej
>
> ----------------------------
> *Von:* Duncan Murdoch 
> *Gesendet:* Freitag, 17. März 2023 11:14:25
> *An:* Ruff, Sergej; Martin Morgan; Ivan Krylov
> *Cc:* r-package-devel@r-project.org
> *Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in
> the Description File of my R Package
> On 17/03/2023 6:06 a.m., Ruff, Sergej wrote:
>> I was wondering how CRAN will handle Limma when running the automatic check.
>>
>>
>> I am worried that my package will be rejected if Limma won�t in

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Uwe Ligges




On 17.03.2023 13:09, Ruff, Sergej wrote:

Thanks,


I thought about changing it to "Imports", but will it cause any issues when 
CRAN runs checks on my package and limma isn´t available on CRAN?


No, BioC is a mainstream repository.

Best,
Uwe Ligges







Von: Ivan Krylov 
Gesendet: Freitag, 17. März 2023 12:31:23
An: Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

В Fri, 17 Mar 2023 11:02:18 +
"Ruff, Sergej"  пишет:


I would like to ask, if I need to add something to the
DESCRIPTION-file when declaring Bioconductor dependencies for CRAn
Submission.


Strictly speaking, no. Once you list limma under Suggests, it's
possible and proper to install your package using
BiocManager::install('YOUR_PACKAGE', dependencies = TRUE) and have
limma installed too, as Martin Morgan said above in the thread.


Some recommend adding biocViews:


This field is required on Bioconductor, not CRAN:
https://contributions.bioconductor.org/description.html?q=biocViews#description-biocviews


some recommend adding Remotes: bioc::limma


Not a standard R/CRAN field, only used by the remotes package:
https://remotes.r-lib.org/articles/dependencies.html


Others add Biocmanager to the suggests file


I suppose it could help a user who doesn't initially know to use
BiocManager in order to install your package, and could also be used to
install limma on behalf of your users (with their permission!), but
it's additional work, may be hard to get right (see the CRAN policy
about installing packages and touching user files), and is not required
at all.


What should I add to my Description File to make sure that limma gets
installed from Bioconductor when needed?


See Martin Morgan's e-mail above in the thread. In short, tell your
users to install your package using BiocManager::install(...,
dependencies = TRUE) if they want limma to work. They are still free to
install.packages() if they don't want limma or can set things up
themselves.

Move limma to Imports (better) or Depends (may be worse)
if you want limma to be always available, at the cost of always
requiring Bioconductor to be set up to have your package installed.
There are other ways besides BiocManager::install(), but they all
depend on the user having set up Bioconductor repos in their R session
somehow, be it BiocManager::repositories() or setRepositories().

--
Best regards,
Ivan

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Duncan Murdoch

On 17/03/2023 6:19 a.m., Ruff, Sergej wrote:

In my example I have the following lines:


### Differential expression analysis with limma
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)

The R CMD Check returns no Errors or Notes if Limma is pre-installed. If 
limma is not pre-installed I get an error, reminding me that Limma is 
not available.


That's a problem, and will cause your package to be rejected.  It should 
not raise an error during the tests when a suggested package is missing. 
Ivan gave you good advice on how to fix this.


I'd recommend testing your package a few times on Winbuilder and fixing 
things until you get clean results.  That won't guarantee acceptance on 
CRAN; new packages get a manual inspection as well, and they'll often 
find some problem that the automatic tests don't find, e.g. stylistic 
issues in the Description field of the DESCRIPTION file.  Here's a note 
I received recently when I submitted a new package (RmdConcord):



The Description field is intended to be a (one paragraph) description of
what the package does and why it may be useful. Please add more details
about the package functionality and implemented methods in your
Description text.

Please always write package names, software names and API (application
programming interface) names in single quotes in title and description.
e.g: --> 'R Markdown'
Please note that package names are case sensitive.

Please do not start the description with "This package", "Functions
for", package name, title or similar.
---


Duncan Murdoch




Thats the source of my worries. Will the same error appear when CRAN 
checks the examples of my package? Or should I not be worried?



With regards,


Sergej


*Von:* Duncan Murdoch 
*Gesendet:* Freitag, 17. März 2023 11:14:25
*An:* Ruff, Sergej; Martin Morgan; Ivan Krylov
*Cc:* r-package-devel@r-project.org
*Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in 
the Description File of my R Package

On 17/03/2023 6:06 a.m., Ruff, Sergej wrote:

I was wondering how CRAN will handle Limma when running the automatic check.


I am worried that my package will be rejected if Limma won�t install from 
Bioconductor on a clean version of R. Leading to an Error and Note during the 
check.


I am using Limma only for an example in my functions description, not inside my 
actual function.


How would CRAN�s System handle that when checking my package for submission?


If you have it in the Suggests list you should have written your code to
work (i.e. not trigger an error) whether it is installed or not, so you
shouldn't worry about it.

Duncan Murdoch




with regards,


Sergej


Von: Martin Morgan 
Gesendet: Donnerstag, 16. M�rz 2023 20:12:51
An: Ivan Krylov; Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

I would not follow the instructions in RTIGER�s README for installing 
Bioconductor packages.

BiocManager::install(�RTIGER�) would install both CRAN and Bioconductor 
dependencies of RTIGER, and would be my preferred instruction in a README or 
INSTALL file. A complete instruction might be to install your package as if it 
were on Bioconductor �

If (!requireNamepace(�BiocManager�, quietly = TRUE))
  install.packages(�BiocManager�)
BiocManager::install(��)

It does not make sense to me to have instructions in .onAttach / .onLoad or in 
each function for the user to install a �Suggests:� package, when actually the 
package is required for use and belongs in Imports: or perhaps Depends:.

The instruction to use �version = �3.14�� of Bioconductor in the RTIGER document is not universally correct, since different Bioconductor versions are tied to specific R versions (see  https://bioconductor.org/about/release-announcements/ 
<https://bioconductor.org/about/release-announcements/> ). On one 
version of R I am currently using, I get



BiocManager::install(version = "3.14")

Error: Bioconductor version '3.14' requires R version '4.1'; use
    `BiocManager::install(version = '3.17')` with R version 4.3; see
   https://bioconductor.org/install <https://bioconductor.org/install>

The instruction to install a vector of Bioconductor packages is also unnecessary for Bioconductor packages in the Imports: or Depends: field of , or if one were to pass the argument `dependencies = TRUE` to either BiocManager::install() or install.packages()  (to get the Suggests: packages of  to be installed, as 

well as Depends:, Imports: and LinkingTo:).


Briefly, installation requires R to know the correct repositories. The command

BiocManager::repositories()

Returns a vector of B

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ruff, Sergej
Thanks,


I thought about changing it to "Imports", but will it cause any issues when 
CRAN runs checks on my package and limma isn´t available on CRAN?




Von: Ivan Krylov 
Gesendet: Freitag, 17. März 2023 12:31:23
An: Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

В Fri, 17 Mar 2023 11:02:18 +
"Ruff, Sergej"  пишет:

> I would like to ask, if I need to add something to the
> DESCRIPTION-file when declaring Bioconductor dependencies for CRAn
> Submission.

Strictly speaking, no. Once you list limma under Suggests, it's
possible and proper to install your package using
BiocManager::install('YOUR_PACKAGE', dependencies = TRUE) and have
limma installed too, as Martin Morgan said above in the thread.

> Some recommend adding biocViews:

This field is required on Bioconductor, not CRAN:
https://contributions.bioconductor.org/description.html?q=biocViews#description-biocviews

> some recommend adding Remotes: bioc::limma

Not a standard R/CRAN field, only used by the remotes package:
https://remotes.r-lib.org/articles/dependencies.html

> Others add Biocmanager to the suggests file

I suppose it could help a user who doesn't initially know to use
BiocManager in order to install your package, and could also be used to
install limma on behalf of your users (with their permission!), but
it's additional work, may be hard to get right (see the CRAN policy
about installing packages and touching user files), and is not required
at all.

> What should I add to my Description File to make sure that limma gets
> installed from Bioconductor when needed?

See Martin Morgan's e-mail above in the thread. In short, tell your
users to install your package using BiocManager::install(...,
dependencies = TRUE) if they want limma to work. They are still free to
install.packages() if they don't want limma or can set things up
themselves.

Move limma to Imports (better) or Depends (may be worse)
if you want limma to be always available, at the cost of always
requiring Bioconductor to be set up to have your package installed.
There are other ways besides BiocManager::install(), but they all
depend on the user having set up Bioconductor repos in their R session
somehow, be it BiocManager::repositories() or setRepositories().

--
Best regards,
Ivan

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ivan Krylov
В Fri, 17 Mar 2023 11:02:18 +
"Ruff, Sergej"  пишет:

> I would like to ask, if I need to add something to the
> DESCRIPTION-file when declaring Bioconductor dependencies for CRAn
> Submission.

Strictly speaking, no. Once you list limma under Suggests, it's
possible and proper to install your package using
BiocManager::install('YOUR_PACKAGE', dependencies = TRUE) and have
limma installed too, as Martin Morgan said above in the thread.

> Some recommend adding biocViews:

This field is required on Bioconductor, not CRAN:
https://contributions.bioconductor.org/description.html?q=biocViews#description-biocviews

> some recommend adding Remotes: bioc::limma

Not a standard R/CRAN field, only used by the remotes package:
https://remotes.r-lib.org/articles/dependencies.html

> Others add Biocmanager to the suggests file

I suppose it could help a user who doesn't initially know to use
BiocManager in order to install your package, and could also be used to
install limma on behalf of your users (with their permission!), but
it's additional work, may be hard to get right (see the CRAN policy
about installing packages and touching user files), and is not required
at all.

> What should I add to my Description File to make sure that limma gets
> installed from Bioconductor when needed?

See Martin Morgan's e-mail above in the thread. In short, tell your
users to install your package using BiocManager::install(...,
dependencies = TRUE) if they want limma to work. They are still free to
install.packages() if they don't want limma or can set things up
themselves.

Move limma to Imports (better) or Depends (may be worse)
if you want limma to be always available, at the cost of always
requiring Bioconductor to be set up to have your package installed.
There are other ways besides BiocManager::install(), but they all
depend on the user having set up Bioconductor repos in their R session
somehow, be it BiocManager::repositories() or setRepositories().

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ruff, Sergej
Thanks.


I would like to ask, if I need to add something to the DESCRIPTION-file when 
declaring Bioconductor dependencies for CRAn Submission.


Right now I only listed limma under "suggests".


I asked online and get conflicting answers. Some recommend adding biocViews: 
above suggests and some recommend adding

Remotes: bioc::limma


Others add Biocmanager to the suggests file in Addition to limma.


Is that necessary? What should I add to my Description File to make sure that 
limma gets installed from Bioconductor when needed?




Von: Ivan Krylov 
Gesendet: Freitag, 17. März 2023 11:45:57
An: Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

В Fri, 17 Mar 2023 10:19:37 +
"Ruff, Sergej"  пишет:

> Thats the source of my worries. Will the same error appear when CRAN
> checks the examples of my package? Or should I not be worried?

Yes, part of CRAN checks is running your package without the packages
listed under Suggests:
https://www.stats.ox.ac.uk/pub/bdr/noSuggests/README.txt [*]

See WRE 1.1.3.1 for the official guidance on how to handle optional
dependencies that might not be installed:
https://cran.r-project.org/doc/manuals/R-exts.html#Suggested-packages

In short, your code should check the return value of
requireNamespace('limma', quietly = TRUE) before trying to run code
from it. Your code can (and probably should) raise an error if asked to
do something using limma when it's not available, but then in your
tests/vignettes/examples you should check whether limma is available
before trying to run that code.

--
Best regards,
Ivan

[*] See also:
https://cran.r-project.org/web/checks/check_issue_kinds.html

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ivan Krylov
В Fri, 17 Mar 2023 10:19:37 +
"Ruff, Sergej"  пишет:

> Thats the source of my worries. Will the same error appear when CRAN
> checks the examples of my package? Or should I not be worried?

Yes, part of CRAN checks is running your package without the packages
listed under Suggests:
https://www.stats.ox.ac.uk/pub/bdr/noSuggests/README.txt [*]

See WRE 1.1.3.1 for the official guidance on how to handle optional
dependencies that might not be installed:
https://cran.r-project.org/doc/manuals/R-exts.html#Suggested-packages

In short, your code should check the return value of
requireNamespace('limma', quietly = TRUE) before trying to run code
from it. Your code can (and probably should) raise an error if asked to
do something using limma when it's not available, but then in your
tests/vignettes/examples you should check whether limma is available
before trying to run that code.

-- 
Best regards,
Ivan

[*] See also:
https://cran.r-project.org/web/checks/check_issue_kinds.html

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ruff, Sergej
In my example I have the following lines:


### Differential expression analysis with limma
group = gl(2, n)
design = model.matrix(~ group)
fit1 = limma::lmFit(X, design)
fit = limma::eBayes(fit1)

The R CMD Check returns no Errors or Notes if Limma is pre-installed. If limma 
is not pre-installed I get an error, reminding me that Limma is not available.


Thats the source of my worries. Will the same error appear when CRAN checks the 
examples of my package? Or should I not be worried?


With regards,


Sergej


Von: Duncan Murdoch 
Gesendet: Freitag, 17. März 2023 11:14:25
An: Ruff, Sergej; Martin Morgan; Ivan Krylov
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

On 17/03/2023 6:06 a.m., Ruff, Sergej wrote:
> I was wondering how CRAN will handle Limma when running the automatic check.
>
>
> I am worried that my package will be rejected if Limma won�t install from 
> Bioconductor on a clean version of R. Leading to an Error and Note during the 
> check.
>
>
> I am using Limma only for an example in my functions description, not inside 
> my actual function.
>
>
> How would CRAN�s System handle that when checking my package for submission?

If you have it in the Suggests list you should have written your code to
work (i.e. not trigger an error) whether it is installed or not, so you
shouldn't worry about it.

Duncan Murdoch

>
>
> with regards,
>
>
> Sergej
>
> 
> Von: Martin Morgan 
> Gesendet: Donnerstag, 16. M�rz 2023 20:12:51
> An: Ivan Krylov; Ruff, Sergej
> Cc: r-package-devel@r-project.org
> Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
> Description File of my R Package
>
> I would not follow the instructions in RTIGER�s README for installing 
> Bioconductor packages.
>
> BiocManager::install(�RTIGER�) would install both CRAN and Bioconductor 
> dependencies of RTIGER, and would be my preferred instruction in a README or 
> INSTALL file. A complete instruction might be to install your package as if 
> it were on Bioconductor �
>
> If (!requireNamepace(�BiocManager�, quietly = TRUE))
>  install.packages(�BiocManager�)
> BiocManager::install(��)
>
> It does not make sense to me to have instructions in .onAttach / .onLoad or 
> in each function for the user to install a �Suggests:� package, when actually 
> the package is required for use and belongs in Imports: or perhaps Depends:.
>
> The instruction to use �version = �3.14�� of Bioconductor in the RTIGER 
> document is not universally correct, since different Bioconductor versions 
> are tied to specific R versions (see 
> https://bioconductor.org/about/release-announcements/ ). On one version of R 
> I am currently using, I get
>
>> BiocManager::install(version = "3.14")
> Error: Bioconductor version '3.14' requires R version '4.1'; use
>`BiocManager::install(version = '3.17')` with R version 4.3; see
>https://bioconductor.org/install
>
> The instruction to install a vector of Bioconductor packages is also 
> unnecessary for Bioconductor packages in the Imports: or Depends: field of 
> , or if one were to pass the argument `dependencies = TRUE` to 
> either BiocManager::install() or install.packages() (to get the Suggests: 
> packages of  to be installed, as well as Depends:, Imports: and 
> LinkingTo:).
>
> Briefly, installation requires R to know the correct repositories. The command
>
> BiocManager::repositories()
>
> Returns a vector of Bioconductor and CRAN repositories relevant to your 
> version of R. If one is averse to using BiocManager::install(�RTIGER�), a 
> reasonable alternative, though still requiring that the BiocManager package 
> is installed, is
>
> install.packages(�RTIGER�, repos = BiocManager::repositories())
>
> Base R also provides a mechanism for specifying Bioconductor repositories, 
> via `setRepositories()` called before install.packages(). However, this is 
> not recommended because, as can be seen on the web page mentioned above, 
> there are two versions of Bioconductor for each version of R � one always 
> gets the �old� Bioconductor version, even when a newer version is available.
>
> From: R-package-devel  on behalf of 
> Ivan Krylov 
> Date: Thursday, March 16, 2023 at 2:15 PM
> To: Ruff, Sergej 
> Cc: r-package-devel@r-project.org 
> Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
> Description File of my R Package
> On Thu, 16 Mar 2023 17:01:55 +
> "Ruff, Sergej"  wrote:
>
>> Last question: How does CRAN work with Bioconductor Dependencies?
>> Will

Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Duncan Murdoch

On 17/03/2023 6:06 a.m., Ruff, Sergej wrote:

I was wondering how CRAN will handle Limma when running the automatic check.


I am worried that my package will be rejected if Limma won�t install from 
Bioconductor on a clean version of R. Leading to an Error and Note during the 
check.


I am using Limma only for an example in my functions description, not inside my 
actual function.


How would CRAN�s System handle that when checking my package for submission?


If you have it in the Suggests list you should have written your code to 
work (i.e. not trigger an error) whether it is installed or not, so you 
shouldn't worry about it.


Duncan Murdoch




with regards,


Sergej


Von: Martin Morgan 
Gesendet: Donnerstag, 16. M�rz 2023 20:12:51
An: Ivan Krylov; Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

I would not follow the instructions in RTIGER�s README for installing 
Bioconductor packages.

BiocManager::install(�RTIGER�) would install both CRAN and Bioconductor 
dependencies of RTIGER, and would be my preferred instruction in a README or 
INSTALL file. A complete instruction might be to install your package as if it 
were on Bioconductor �

If (!requireNamepace(�BiocManager�, quietly = TRUE))
 install.packages(�BiocManager�)
BiocManager::install(��)

It does not make sense to me to have instructions in .onAttach / .onLoad or in 
each function for the user to install a �Suggests:� package, when actually the 
package is required for use and belongs in Imports: or perhaps Depends:.

The instruction to use �version = �3.14�� of Bioconductor in the RTIGER 
document is not universally correct, since different Bioconductor versions are 
tied to specific R versions (see 
https://bioconductor.org/about/release-announcements/ ). On one version of R I 
am currently using, I get


BiocManager::install(version = "3.14")

Error: Bioconductor version '3.14' requires R version '4.1'; use
   `BiocManager::install(version = '3.17')` with R version 4.3; see
   https://bioconductor.org/install

The instruction to install a vector of Bioconductor packages is also unnecessary for 
Bioconductor packages in the Imports: or Depends: field of , or if one 
were to pass the argument `dependencies = TRUE` to either BiocManager::install() or 
install.packages() (to get the Suggests: packages of  to be installed, 
as well as Depends:, Imports: and LinkingTo:).

Briefly, installation requires R to know the correct repositories. The command

BiocManager::repositories()

Returns a vector of Bioconductor and CRAN repositories relevant to your version 
of R. If one is averse to using BiocManager::install(�RTIGER�), a reasonable 
alternative, though still requiring that the BiocManager package is installed, 
is

install.packages(�RTIGER�, repos = BiocManager::repositories())

Base R also provides a mechanism for specifying Bioconductor repositories, via 
`setRepositories()` called before install.packages(). However, this is not 
recommended because, as can be seen on the web page mentioned above, there are 
two versions of Bioconductor for each version of R � one always gets the �old� 
Bioconductor version, even when a newer version is available.

From: R-package-devel  on behalf of Ivan 
Krylov 
Date: Thursday, March 16, 2023 at 2:15 PM
To: Ruff, Sergej 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package
On Thu, 16 Mar 2023 17:01:55 +
"Ruff, Sergej"  wrote:


Last question: How does CRAN work with Bioconductor Dependencies?
Will CRAN accept limma as a dependency or will my submission be
rejected?


It's not explicitly spelled out in the CRAN policy
<https://cran.r-project.org/web/packages/policies.html>, but
Bioconductor and CRAN are the "mainstream repositories" for the
purposes of the following rule:


Packages on which a CRAN package depends should be available from a
mainstream repository


(Even non-mainstream repositories are allowed for optional dependencies
if you follow a few additional rules.)

Here's an example of a CRAN package with a strong dependency on a
Bioconductor package: <https://CRAN.R-project.org/package=RTIGER>. You
can see the extra instructions for installing the Bioconductor
dependencies in its README.

--
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-17 Thread Ruff, Sergej
I was wondering how CRAN will handle Limma when running the automatic check.


I am worried that my package will be rejected if Limma won�t install from 
Bioconductor on a clean version of R. Leading to an Error and Note during the 
check.


I am using Limma only for an example in my functions description, not inside my 
actual function.


How would CRAN�s System handle that when checking my package for submission?


with regards,


Sergej


Von: Martin Morgan 
Gesendet: Donnerstag, 16. M�rz 2023 20:12:51
An: Ivan Krylov; Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

I would not follow the instructions in RTIGER�s README for installing 
Bioconductor packages.

BiocManager::install(�RTIGER�) would install both CRAN and Bioconductor 
dependencies of RTIGER, and would be my preferred instruction in a README or 
INSTALL file. A complete instruction might be to install your package as if it 
were on Bioconductor �

If (!requireNamepace(�BiocManager�, quietly = TRUE))
install.packages(�BiocManager�)
BiocManager::install(��)

It does not make sense to me to have instructions in .onAttach / .onLoad or in 
each function for the user to install a �Suggests:� package, when actually the 
package is required for use and belongs in Imports: or perhaps Depends:.

The instruction to use �version = �3.14�� of Bioconductor in the RTIGER 
document is not universally correct, since different Bioconductor versions are 
tied to specific R versions (see 
https://bioconductor.org/about/release-announcements/ ). On one version of R I 
am currently using, I get

> BiocManager::install(version = "3.14")
Error: Bioconductor version '3.14' requires R version '4.1'; use
  `BiocManager::install(version = '3.17')` with R version 4.3; see
  https://bioconductor.org/install

The instruction to install a vector of Bioconductor packages is also 
unnecessary for Bioconductor packages in the Imports: or Depends: field of 
, or if one were to pass the argument `dependencies = TRUE` to 
either BiocManager::install() or install.packages() (to get the Suggests: 
packages of  to be installed, as well as Depends:, Imports: and 
LinkingTo:).

Briefly, installation requires R to know the correct repositories. The command

BiocManager::repositories()

Returns a vector of Bioconductor and CRAN repositories relevant to your version 
of R. If one is averse to using BiocManager::install(�RTIGER�), a reasonable 
alternative, though still requiring that the BiocManager package is installed, 
is

install.packages(�RTIGER�, repos = BiocManager::repositories())

Base R also provides a mechanism for specifying Bioconductor repositories, via 
`setRepositories()` called before install.packages(). However, this is not 
recommended because, as can be seen on the web page mentioned above, there are 
two versions of Bioconductor for each version of R � one always gets the �old� 
Bioconductor version, even when a newer version is available.

From: R-package-devel  on behalf of Ivan 
Krylov 
Date: Thursday, March 16, 2023 at 2:15 PM
To: Ruff, Sergej 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package
On Thu, 16 Mar 2023 17:01:55 +
"Ruff, Sergej"  wrote:

> Last question: How does CRAN work with Bioconductor Dependencies?
> Will CRAN accept limma as a dependency or will my submission be
> rejected?

It's not explicitly spelled out in the CRAN policy
<https://cran.r-project.org/web/packages/policies.html>, but
Bioconductor and CRAN are the "mainstream repositories" for the
purposes of the following rule:

>> Packages on which a CRAN package depends should be available from a
>> mainstream repository

(Even non-mainstream repositories are allowed for optional dependencies
if you follow a few additional rules.)

Here's an example of a CRAN package with a strong dependency on a
Bioconductor package: <https://CRAN.R-project.org/package=RTIGER>. You
can see the extra instructions for installing the Bioconductor
dependencies in its README.

--
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-16 Thread Martin Morgan
I would not follow the instructions in RTIGER�s README for installing 
Bioconductor packages.

BiocManager::install(�RTIGER�) would install both CRAN and Bioconductor 
dependencies of RTIGER, and would be my preferred instruction in a README or 
INSTALL file. A complete instruction might be to install your package as if it 
were on Bioconductor �

If (!requireNamepace(�BiocManager�, quietly = TRUE))
install.packages(�BiocManager�)
BiocManager::install(��)

It does not make sense to me to have instructions in .onAttach / .onLoad or in 
each function for the user to install a �Suggests:� package, when actually the 
package is required for use and belongs in Imports: or perhaps Depends:.

The instruction to use �version = �3.14�� of Bioconductor in the RTIGER 
document is not universally correct, since different Bioconductor versions are 
tied to specific R versions (see 
https://bioconductor.org/about/release-announcements/ ). On one version of R I 
am currently using, I get

> BiocManager::install(version = "3.14")
Error: Bioconductor version '3.14' requires R version '4.1'; use
  `BiocManager::install(version = '3.17')` with R version 4.3; see
  https://bioconductor.org/install

The instruction to install a vector of Bioconductor packages is also 
unnecessary for Bioconductor packages in the Imports: or Depends: field of 
, or if one were to pass the argument `dependencies = TRUE` to 
either BiocManager::install() or install.packages() (to get the Suggests: 
packages of  to be installed, as well as Depends:, Imports: and 
LinkingTo:).

Briefly, installation requires R to know the correct repositories. The command

BiocManager::repositories()

Returns a vector of Bioconductor and CRAN repositories relevant to your version 
of R. If one is averse to using BiocManager::install(�RTIGER�), a reasonable 
alternative, though still requiring that the BiocManager package is installed, 
is

install.packages(�RTIGER�, repos = BiocManager::repositories())

Base R also provides a mechanism for specifying Bioconductor repositories, via 
`setRepositories()` called before install.packages(). However, this is not 
recommended because, as can be seen on the web page mentioned above, there are 
two versions of Bioconductor for each version of R � one always gets the �old� 
Bioconductor version, even when a newer version is available.

From: R-package-devel  on behalf of Ivan 
Krylov 
Date: Thursday, March 16, 2023 at 2:15 PM
To: Ruff, Sergej 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package
On Thu, 16 Mar 2023 17:01:55 +
"Ruff, Sergej"  wrote:

> Last question: How does CRAN work with Bioconductor Dependencies?
> Will CRAN accept limma as a dependency or will my submission be
> rejected?

It's not explicitly spelled out in the CRAN policy
<https://cran.r-project.org/web/packages/policies.html>, but
Bioconductor and CRAN are the "mainstream repositories" for the
purposes of the following rule:

>> Packages on which a CRAN package depends should be available from a
>> mainstream repository

(Even non-mainstream repositories are allowed for optional dependencies
if you follow a few additional rules.)

Here's an example of a CRAN package with a strong dependency on a
Bioconductor package: <https://CRAN.R-project.org/package=RTIGER>. You
can see the extra instructions for installing the Bioconductor
dependencies in its README.

--
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-16 Thread Ivan Krylov
On Thu, 16 Mar 2023 17:01:55 +
"Ruff, Sergej"  wrote:

> Last question: How does CRAN work with Bioconductor Dependencies?
> Will CRAN accept limma as a dependency or will my submission be
> rejected?

It's not explicitly spelled out in the CRAN policy
, but
Bioconductor and CRAN are the "mainstream repositories" for the
purposes of the following rule:

>> Packages on which a CRAN package depends should be available from a
>> mainstream repository

(Even non-mainstream repositories are allowed for optional dependencies
if you follow a few additional rules.)

Here's an example of a CRAN package with a strong dependency on a
Bioconductor package: . You
can see the extra instructions for installing the Bioconductor
dependencies in its README.

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-16 Thread Tiago Olivoto
Thanks Duncan,
I'm in the way of a new CRAN submission and I will make sure to call
check_ebi() in the body of each function. This should ensure that the check
for EBImage will be called even with pliman::object_edge( ... ), for
example.

Best regards,
Olivoto

Em qui., 16 de mar. de 2023 às 14:15, Duncan Murdoch <
murdoch.dun...@gmail.com> escreveu:

> On 16/03/2023 12:36 p.m., Tiago Olivoto wrote:
> > Hi,
> > My package pliman depends on EBImage which is in Bioconductor. I have
> > created a function check_ebi() <
> >
> https://github.com/TiagoOlivoto/pliman/blob/e6efc4b6a2396600939e308c235aeb9ab47af375/R/utilities.R#L534
> >
> > that is called in .onAttach() <
> > https://github.com/TiagoOlivoto/pliman/blob/master/R/zzz.R#L36>  and
> checks
> > if EBImage is installed. If not, the function asks the user to install
> it.
>
> If some other package loads but doesn't attach pliman, and is missing
> EBImage, does it fail gracefully?  That's also important.  I'd test what
> happens if a user runs pliman::object_edge( ... ) .  (That function
> isn't in the CRAN version, just the Github version, so I haven't tried
> this.)
>
> Duncan Murdoch
>
>
> > Both EBImage and BiocManager are listed as suggests <
> > https://github.com/TiagoOlivoto/pliman/blob/master/DESCRIPTION#L22>
> >
> > I believe that this could be a possible solution
> > Best regards,
> > Olivoto
> >
> >
> > Em qui., 16 de mar. de 2023 às 11:18, Ruff, Sergej <
> > sergej.r...@tiho-hannover.de> escreveu:
> >
> >> I am currently building a package which uses the "limma"-package as a
> >> dependency.
> >>
> >> I want to submit my package to CRAN.
> >>
> >> Do I need to declare Bioconductor-dependencies such as Limma differently
> >> in the Description-File of my Package?
> >>
> >> The Check-Function in R shows no Notes, Warnings or Errors, but I am not
> >> sure if that means that limma will install when installing my package
> from
> >> CRAN.
> >>
> >> Currently I am declaring limma like this:
> >>
> >> Suggests:
> >>
> >>  limma
> >>
> >>
> >>
> >> Can CRAN identify that limma is a Bioconductor-Package and will it Limma
> >> install, when installing my package from CRAN?
> >>
> >>  [[alternative HTML version deleted]]
> >>
> >> __
> >> R-package-devel@r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >>
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-16 Thread Tiago Olivoto
Hi Sergej,

I sincerely don't know if the position of biocView really matters (I'll try
it when preparing for the new CRAN release of pliman). I believe that
biocView will not allow you to put limma in the imports field and
automatically install it from Bioconductor, as you can see here in this
discussion <
https://stackoverflow.com/questions/54411495/bioconductor-packages-not-installing-with-biocviews-specification-in-description
>

In my case, I had no errors when submitting pliman to CRAN using EBImage as
suggests (I haven't yet tried to use biocView: and EBImage in the Imports
section).

Best regards,
Olivoto

Em qui., 16 de mar. de 2023 às 14:01, Ruff, Sergej <
sergej.r...@tiho-hannover.de> escreveu:

> thank you.
>
>
> I see you added biocView: below your suggested Dependencies. Is it
> necessary for CRAN to identify Bioconductor Dependencies and if so, should
> I add it below or above the suggested packages? Do I also need BiocManager
> among my Suggests?
>
>
> Last question: How does CRAN work with Bioconductor Dependencies? Will
> CRAN accept limma as a dependency or will my submission be rejected?
>
>
> Best regards,
>
> Sergej
> --
> *Von:* Tiago Olivoto 
> *Gesendet:* Donnerstag, 16. März 2023 17:36:47
> *An:* Ruff, Sergej
> *Cc:* r-package-devel@r-project.org
> *Betreff:* Re: [R-pkg-devel] How to declare Bioconductor Dependencies in
> the Description File of my R Package
>
> Hi,
> My package pliman depends on EBImage which is in Bioconductor. I have
> created a function check_ebi() <
> https://github.com/TiagoOlivoto/pliman/blob/e6efc4b6a2396600939e308c235aeb9ab47af375/R/utilities.R#L534>
> that is called in .onAttach() <
> https://github.com/TiagoOlivoto/pliman/blob/master/R/zzz.R#L36>  and
> checks if EBImage is installed. If not, the function asks the user to
> install it. Both EBImage and BiocManager are listed as suggests <
> https://github.com/TiagoOlivoto/pliman/blob/master/DESCRIPTION#L22>
>
> I believe that this could be a possible solution
> Best regards,
> Olivoto
>
>
> Em qui., 16 de mar. de 2023 às 11:18, Ruff, Sergej <
> sergej.r...@tiho-hannover.de> escreveu:
>
>> I am currently building a package which uses the "limma"-package as a
>> dependency.
>>
>> I want to submit my package to CRAN.
>>
>> Do I need to declare Bioconductor-dependencies such as Limma differently
>> in the Description-File of my Package?
>>
>> The Check-Function in R shows no Notes, Warnings or Errors, but I am not
>> sure if that means that limma will install when installing my package from
>> CRAN.
>>
>> Currently I am declaring limma like this:
>>
>> Suggests:
>>
>> limma
>>
>>
>>
>> Can CRAN identify that limma is a Bioconductor-Package and will it Limma
>> install, when installing my package from CRAN?
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-16 Thread Duncan Murdoch

On 16/03/2023 12:36 p.m., Tiago Olivoto wrote:

Hi,
My package pliman depends on EBImage which is in Bioconductor. I have
created a function check_ebi() <
https://github.com/TiagoOlivoto/pliman/blob/e6efc4b6a2396600939e308c235aeb9ab47af375/R/utilities.R#L534>
that is called in .onAttach() <
https://github.com/TiagoOlivoto/pliman/blob/master/R/zzz.R#L36>  and checks
if EBImage is installed. If not, the function asks the user to install it.


If some other package loads but doesn't attach pliman, and is missing 
EBImage, does it fail gracefully?  That's also important.  I'd test what 
happens if a user runs pliman::object_edge( ... ) .  (That function 
isn't in the CRAN version, just the Github version, so I haven't tried 
this.)


Duncan Murdoch



Both EBImage and BiocManager are listed as suggests <
https://github.com/TiagoOlivoto/pliman/blob/master/DESCRIPTION#L22>

I believe that this could be a possible solution
Best regards,
Olivoto


Em qui., 16 de mar. de 2023 às 11:18, Ruff, Sergej <
sergej.r...@tiho-hannover.de> escreveu:


I am currently building a package which uses the "limma"-package as a
dependency.

I want to submit my package to CRAN.

Do I need to declare Bioconductor-dependencies such as Limma differently
in the Description-File of my Package?

The Check-Function in R shows no Notes, Warnings or Errors, but I am not
sure if that means that limma will install when installing my package from
CRAN.

Currently I am declaring limma like this:

Suggests:

 limma



Can CRAN identify that limma is a Bioconductor-Package and will it Limma
install, when installing my package from CRAN?

 [[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel



[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-16 Thread Ruff, Sergej
thank you.


I see you added biocView: below your suggested Dependencies. Is it necessary 
for CRAN to identify Bioconductor Dependencies and if so, should I add it below 
or above the suggested packages? Do I also need BiocManager among my Suggests?


Last question: How does CRAN work with Bioconductor Dependencies? Will CRAN 
accept limma as a dependency or will my submission be rejected?


Best regards,

Sergej


Von: Tiago Olivoto 
Gesendet: Donnerstag, 16. M�rz 2023 17:36:47
An: Ruff, Sergej
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the 
Description File of my R Package

Hi,
My package pliman depends on EBImage which is in Bioconductor. I have created a 
function check_ebi() 
<https://github.com/TiagoOlivoto/pliman/blob/e6efc4b6a2396600939e308c235aeb9ab47af375/R/utilities.R#L534>
 that is called in .onAttach() 
<https://github.com/TiagoOlivoto/pliman/blob/master/R/zzz.R#L36>  and checks if 
EBImage is installed. If not, the function asks the user to install it. Both 
EBImage and BiocManager are listed as suggests 
<https://github.com/TiagoOlivoto/pliman/blob/master/DESCRIPTION#L22>

I believe that this could be a possible solution
Best regards,
Olivoto


Em qui., 16 de mar. de 2023 �s 11:18, Ruff, Sergej 
mailto:sergej.r...@tiho-hannover.de>> escreveu:
I am currently building a package which uses the "limma"-package as a 
dependency.

I want to submit my package to CRAN.

Do I need to declare Bioconductor-dependencies such as Limma differently in the 
Description-File of my Package?

The Check-Function in R shows no Notes, Warnings or Errors, but I am not sure 
if that means that limma will install when installing my package from CRAN.

Currently I am declaring limma like this:

Suggests:

limma



Can CRAN identify that limma is a Bioconductor-Package and will it Limma 
install, when installing my package from CRAN?

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org<mailto:R-package-devel@r-project.org> mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-16 Thread Tiago Olivoto
Hi,
My package pliman depends on EBImage which is in Bioconductor. I have
created a function check_ebi() <
https://github.com/TiagoOlivoto/pliman/blob/e6efc4b6a2396600939e308c235aeb9ab47af375/R/utilities.R#L534>
that is called in .onAttach() <
https://github.com/TiagoOlivoto/pliman/blob/master/R/zzz.R#L36>  and checks
if EBImage is installed. If not, the function asks the user to install it.
Both EBImage and BiocManager are listed as suggests <
https://github.com/TiagoOlivoto/pliman/blob/master/DESCRIPTION#L22>

I believe that this could be a possible solution
Best regards,
Olivoto


Em qui., 16 de mar. de 2023 às 11:18, Ruff, Sergej <
sergej.r...@tiho-hannover.de> escreveu:

> I am currently building a package which uses the "limma"-package as a
> dependency.
>
> I want to submit my package to CRAN.
>
> Do I need to declare Bioconductor-dependencies such as Limma differently
> in the Description-File of my Package?
>
> The Check-Function in R shows no Notes, Warnings or Errors, but I am not
> sure if that means that limma will install when installing my package from
> CRAN.
>
> Currently I am declaring limma like this:
>
> Suggests:
>
> limma
>
>
>
> Can CRAN identify that limma is a Bioconductor-Package and will it Limma
> install, when installing my package from CRAN?
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

2023-03-16 Thread Ivan Krylov
В Thu, 16 Mar 2023 11:09:16 +
"Ruff, Sergej"  пишет:

> The Check-Function in R shows no Notes, Warnings or Errors, but I am
> not sure if that means that limma will install when installing my
> package from CRAN.

> Currently I am declaring limma like this:
> 
> Suggests:
> 
> limma

install.packages() doesn't install suggested packages by default: the
`dependencies` argument defaults to NA, which means c("Depends",
"Imports", "LinkingTo"), which doesn't include 'Suggests'.

What if you pass dependencies = TRUE? Given the fact that Bioconductor
is absent from getOption('repos') by default, the package will still
not be installed. BiocManager::install() is the supported way to
install packages from Bioconductor:
https://cran.r-project.org/package=BiocManager/vignettes/BiocManager.html#installing-bioconductor-cran-or-github-packages

I think that BiocManager::install('YOUR_PACKAGE', dependencies = TRUE)
will install both your package and limma. It's a bit hard to verify
because your package should live in a repository, but if you'd like to
be sure, spin up a drat  repo
on a local server and add it to options(repos = ...) before trying to
install your package.

> Do I need to declare Bioconductor-dependencies such as Limma
> differently in the Description-File of my Package?
 
No, this is the right way to declare Bioconductor dependencies for CRAN
packages.

> Can CRAN identify that limma is a Bioconductor-Package and will it
> Limma install, when installing my package from CRAN?

The CRAN website will detect the Bioconductor dependency and highlight
it with a different colour, making it a link to the Bioconductor
website. See, e.g., the BiocManager package and its reverse
dependencies: https://CRAN.R-project.org/package=BiocManager

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel