Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
38d822f
- fix links to fingerprint package and update the docs
zachcp Sep 11, 2025
1dfc6e5
Add Egon and bump version
zachcp Sep 11, 2025
020661b
Fix a few test fns and lints
zachcp Sep 11, 2025
10d4d25
update news file and Cran comments for submission
zachcp Sep 11, 2025
15089f1
update cache
zachcp Sep 11, 2025
120ec33
http->https URL Updates
zachcp Sep 12, 2025
8d1cde8
update description and Vignetter
zachcp Sep 12, 2025
ac5c6ea
ignore the vignette that uses depict, which is not on CRAN and is cau…
zachcp Sep 12, 2025
18debc3
add cran
zachcp Sep 12, 2025
53b9c34
Clean build
zachcp Sep 13, 2025
68dccfc
simplify examples for CRAN tests
zachcp Sep 13, 2025
470bd3e
Remove expensive tests when on CRAN
zachcp Sep 13, 2025
a25f70c
Using MACCs in our examples to speed calculation
zachcp Sep 13, 2025
1cc5a7c
update cran_comments
zachcp Sep 13, 2025
bf6352b
update the linux CRAN detection
zachcp Sep 13, 2025
9249775
fix one more URL
zachcp Sep 13, 2025
4ddbec8
update CRAN submission markdown
zachcp Sep 13, 2025
2e7d7c5
fix: URL moved permanently
zachcp Nov 28, 2025
7248e76
fix: set CPUs to 1 inside of CHECK environments
zachcp Nov 28, 2025
e770d6b
fix: run all tests during the check now that CPU usage has been limit…
zachcp Nov 28, 2025
07f09b5
fix update CRAN submission docs
zachcp Nov 28, 2025
74ef3b4
spelling
zachcp Nov 28, 2025
b3a945b
update the date
zachcp Nov 28, 2025
a6aa547
Correct first name
egonw Nov 29, 2025
28c58a4
Setup JAVA for single threaded testing to avoid triggering warning on…
zachcp Nov 30, 2025
6a2e141
prep for resubmission
zachcp Nov 30, 2025
e433643
rebuild docs
zachcp Nov 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ knitr::opts_chunk$set(
)
```

[![Build Status](https://api.travis-ci.org/CDK-R/cdkr.svg?branch=master)](https://travis-ci.org/CDK-R/cdkr)

[![CRAN Version](https://www.r-pkg.org/badges/version/rcdk?color=green)](https://cran.r-project.org/package=rcdk)
[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/rcdk?color=green)](https://cran.r-project.org/package=rcdk)
[![CRAN Downloads Monthyl](http://cranlogs.r-pkg.org/badges/last-month/rcdk?color=green)](https://cran.r-project.org/package=rcdk)
Expand Down
3 changes: 3 additions & 0 deletions rcdk/.Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
^pkgdown$
^revdep$
README.Rmd
vignettes/Features_29.Rmd
^doc$
^Meta$
4 changes: 3 additions & 1 deletion rcdk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ revdep/
.Rhistory
.Rproj
*.Rmd
*.png
*.png
/doc/
/Meta/
21 changes: 11 additions & 10 deletions rcdk/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
Package: rcdk
Version: 3.9.0
Date: 2024-03-02
Version: 3.8.2
Date: 2025-11-30
Title: Interface to the 'CDK' Libraries
Authors@R: c(
person('Rajarshi', 'Guha', ,'rajarshi.guha@gmail.com', role=c('aut',"cph"),
comment = c(ORCID = "0000-0001-7403-8819")),
person('Zachary', 'Charlop-Powers', ,'zach.charlop.powers@gmail.com',role=c('cre'),
person('Zachary', 'Charlop-Powers', ,'zach.charlop.powers@gmail.com',role=c('cre'),
comment = c(ORCID = "0000-0001-8816-4680")),
person('Emma', 'Schymanski', ,'schymane@gmail.com', role=c('ctb'),
comment = c(ORCID = "0000-0001-6868-8145")))
person('Emma', 'Schymanski', ,'schymane@gmail.com', role=c('ctb'),
comment = c(ORCID = "0000-0001-6868-8145")),
person('Egon', 'Willighagen', ,'egon.willighagen@maastrichtuniversity.nl', role=c('ctb'),
comment = c(ORCID = "0000-0001-7542-0286")))
Depends:
rcdklibs (>= 2.9)
Imports:
Expand All @@ -23,19 +25,18 @@ Suggests:
RUnit,
knitr,
rmarkdown,
devtools,
depict
devtools
License: LGPL
URL: https://github.com/CDK-R/cdkr
LazyLoad: yes
LazyData: true
SystemRequirements: Java (>= 8)
BugReports: https://github.com/CDK-R/cdkr/issues
Description: Allows the user to access functionality in the
'CDK', a Java framework for chemoinformatics. This allows the user to load
'CDK', a Java framework for cheminformatics. This allows the user to load
molecules, evaluate fingerprints, calculate molecular descriptors and so on.
In addition, the 'CDK' API allows the user to view structures in 2D.
RoxygenNote: 7.3.1
RoxygenNote: 7.3.3
VignetteBuilder: knitr
Encoding: UTF-8
Remotes: CDK-R/depict

10 changes: 6 additions & 4 deletions rcdk/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# rcdk 3.9.0
# rcdk 3.8.2

* Update rCDK to work with rcdklibs 2.9
* Update rCDK to work with rcdklibs 2.11

# rcdk 3.8.0

Expand All @@ -13,9 +13,11 @@
* Update rCDK to work with rcdklibs 2.8




# rcdk 3.6.0

* Fix code to handle changes to JDK17. Notably, I needed to reduce the use of the J notation in a nubmer of places in favor of direct calls.
* Fix code to handle changes to JDK17. Notably, I needed to reduce the use of the J notation in a number of places in favor of direct calls.
* formally deprecated `do.typing` in favor of `set.atom.types`
* Updated handling of atomic descriptors to resolve a name mismatch bug
* Added a test case for atomic descriptors (thanks to Francesca Di Cesare)
Expand All @@ -30,7 +32,7 @@

# rcdk 3.5.0

* update to RCDKlibs 2.3. This changes uderlying AtomContainer defualt to Atomcontainer2 and also has new support for mass spec mass functions. On the rcdk side we have moved to a tidyverse documentation and build system.
* update to RCDKlibs 2.3. This changes underlying AtomContainer default to Atomcontainer2 and also has new support for mass spec mass functions. On the rcdk side we have moved to a tidyverse documentation and build system.

# rcdk 3.4.7

Expand Down
11 changes: 5 additions & 6 deletions rcdk/R/deprecated_functions.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
################################################################################
#' Deprecated functions in the rcdk package.
#'
#'
#' These functions are provided for compatibility with older version of
#' the phyloseq package. They may eventually be completely
#' removed.
#'
#'
#' @usage deprecated_rcdk_function(x, value, ...)
#' @rdname rcdk-deprecated
#' @name rcdk-deprecated
#' @param x For assignment operators, the object that will undergo a replacement
#' (object inside parenthesis).
#' @param value For assignment operators, the value to replace with
#' @param value For assignment operators, the value to replace with
#' (the right side of the assignment).
#' @param ... For functions other than assignment operators,
#' @param ... For functions other than assignment operators,
#' parameters to be passed to the modern version of the function (see table).
#' @docType package
#' @export do.typing
#' @aliases deprecated_rcdk_function do.typing
#' @details
Expand All @@ -24,4 +23,4 @@
#'
deprecated_rcdk_function <- function(x, value, ...){return(NULL)}
do.typing <- function(...){.Deprecated("set.atom.types", package="rcdk");return(set.atom.types(...))}
################################################################################
################################################################################
64 changes: 31 additions & 33 deletions rcdk/R/fingerprint.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Generate molecular fingerprints
#'
#'
#' `get.fingerprint` returns a `fingerprint` object representing molecular fingerprint of
#' the input molecule.
#'
#'
#' @param molecule A \code{jobjRef} object to an \code{IAtomContaine}
#' @param type The type of fingerprint. Possible values are:
#' \itemize{
Expand All @@ -18,52 +18,50 @@
#' \item pubchem - 881 bit fingerprints defined by PubChem
#' \item kr - 4860 bit fingerprint defined by Klekota and Roth
#' \item shortestpath - A fingerprint based on the shortest paths between pairs of atoms and takes into account ring systems, charges etc.
#' \item signature - A feature,count type of fingerprint, similar in nature to circular fingerprints, but based on the signature
#' \item signature - A feature,count type of fingerprint, similar in nature to circular fingerprints, but based on the signature
#' descriptor
#' \item circular - An implementation of the ECFP6 (default) fingerprint. Other circular types can be chosen by modifying the \code{circular.type} parameter.
#' \item substructure - Fingerprint based on list of SMARTS pattern. By default a set of functional groups is tested.
#' }
#' @param fp.mode The style of fingerprint. Specifying "`bit`" will return a binary fingerprint,
#' "`raw`" returns the the original representation (usually sequence of integers) and
#' "`raw`" returns the the original representation (usually sequence of integers) and
#' "`count`" returns the fingerprint as a sequence of counts.
#' @param depth The search depth. This argument is ignored for the
#' `pubchem`, `maccs`, `kr` and `estate` fingerprints
#' @param size The final length of the fingerprint.
#' This argument is ignored for the `pubchem`, `maccs`, `kr`, `signature`, `circular` and
#' @param size The final length of the fingerprint.
#' This argument is ignored for the `pubchem`, `maccs`, `kr`, `signature`, `circular` and
#' `estate` fingerprints
#' @param substructure.pattern List of characters containing the SMARTS pattern to match. If the an empty list is provided (default) than the functional groups substructures (default in CDK) are used.
#' @param circular.type Name of the circular fingerprint type that should be computed given as string. Possible values are: 'ECFP0', 'ECFP2', 'ECFP4', 'ECFP6' (default), 'FCFP0', 'FCFP2', 'FCFP4' and 'FCFP6'.
#' @param verbose Verbose output if \code{TRUE}
#' @return an S4 object of class \code{\link{fingerprint-class}} or \code{\link{featvec-class}},
#' @return an S4 object of class \code{\link[fingerprint]{fingerprint-class}} or \code{\link[fingerprint]{featvec-class}},
#' which can be manipulated with the fingerprint package.
#' @export
#' @author Rajarshi Guha (\email{rajarshi.guha@@gmail.com})
#' @examples
#' @examples
#' ## get some molecules
#' sp <- get.smiles.parser()
#' smiles <- c('CCC', 'CCN', 'CCN(C)(C)', 'c1ccccc1Cc1ccccc1','C1CCC1CC(CN(C)(C))CC(=O)CC')
#' smiles <- c('CCC', 'CCN')
#' mols <- parse.smiles(smiles)
#'
#' ## get a single fingerprint using the standard
#' ## (hashed, path based) fingerprinter
#' fp <- get.fingerprint(mols[[1]])
#'
#' ## get MACCS keys for all the molecules
#'
#' ## get a single fingerprint using MACCS (fast)
#' fp <- get.fingerprint(mols[[1]], type='maccs')
#'
#' ## get MACCS keys for both molecules
#' fps <- lapply(mols, get.fingerprint, type='maccs')
#'
#'
#' ## get Signature fingerprint
#' ## feature, count fingerprinter
#' fps <- lapply(mols, get.fingerprint, type='signature', fp.mode='raw')
#' ## get Substructure fingerprint for functional group fragments
#' fps <- lapply(mols, get.fingerprint, type='substructure')
#'
#'
#' ## get Substructure count fingerprint for user defined fragments
#' mol1 <- parse.smiles("c1ccccc1CCC")[[1]]
#' smarts <- c("c1ccccc1", "[CX4H3][#6]", "[CX2]#[CX2]")
#' fps <- get.fingerprint(mol1, type='substructure', fp.mode='count',
#' substructure.pattern=smarts)
#'
#' ## get ECFP0 count fingerprints
#'
#' ## get ECFP0 count fingerprints
#' mol2 <- parse.smiles("C1=CC=CC(=C1)CCCC2=CC=CC=C2")[[1]]
#' fps <- get.fingerprint(mol2, type='circular', fp.mode='count', circular.type='ECFP0')
get.fingerprint <- function(molecule, type = 'standard', fp.mode = 'bit', depth=6, size=1024, substructure.pattern=character(), circular.type = "ECFP6", verbose=FALSE) {
Expand All @@ -75,17 +73,17 @@ get.fingerprint <- function(molecule, type = 'standard', fp.mode = 'bit', depth=

mode(size) <- 'integer'
mode(depth) <- 'integer'

# Determine integer ID for the circular fingerprint given its desired type.
# This allows us to use also ECFP4, ...
# This allows us to use also ECFP4, ...
if (type == 'circular') {
circular.type.id <- switch(circular.type,
circular.type.id <- switch(circular.type,
ECFP0 = 1, ECFP2 = 2, ECFP4 = 3, ECFP6 = 4,
FCFP0 = 5, FCFP2 = 6, FCFP4 = 7, FCFP6 = 8,
NULL)

if (is.null(circular.type.id)) stop(paste('Invalid circular fingerprint type: ', circular.type))

mode(circular.type.id) <- 'integer'
}

Expand All @@ -103,8 +101,8 @@ get.fingerprint <- function(molecule, type = 'standard', fp.mode = 'bit', depth=
shortestpath = .jnew('org/openscience/cdk/fingerprint/ShortestPathFingerprinter', size),
signature = .jnew('org/openscience/cdk/fingerprint/SignatureFingerprinter', depth),
circular = .jnew('org/openscience/cdk/fingerprint/CircularFingerprinter', circular.type.id),
substructure =
if (length(substructure.pattern) == 0)
substructure =
if (length(substructure.pattern) == 0)
# Loads the default group substructures
{ .jnew('org/openscience/cdk/fingerprint/SubstructureFingerprinter') }
else
Expand All @@ -125,11 +123,11 @@ get.fingerprint <- function(molecule, type = 'standard', fp.mode = 'bit', depth=
} else if (fp.mode == 'count') {
jfp <- .jcall(fingerprinter,
"Lorg/openscience/cdk/fingerprint/ICountFingerprint;",
"getCountFingerprint", molecule, check=FALSE)
"getCountFingerprint", molecule, check=FALSE)
}

e <- .jgetEx()
if (.jcheck(silent=TRUE)) {
if (.jcheck(silent=TRUE)) {
if (verbose) print(e)
return(NULL)
}
Expand All @@ -139,15 +137,15 @@ get.fingerprint <- function(molecule, type = 'standard', fp.mode = 'bit', depth=

if (fp.mode == 'bit') {
bitset <- .jcall(jfp, "Ljava/util/BitSet;", "asBitSet")

if (type == 'maccs') nbit <- 166
else if (type == 'estate') nbit <- 79
else if (type == 'pubchem') nbit <- 881
else if (type == 'kr') nbit <- 4860
else if (type == 'substructure') nbit <- .jcall(fingerprinter, "I", "getSize")
else if (type == 'circular') nbit <- .jcall(fingerprinter, "I", "getSize")
else nbit <- size

bitset <- .jcall(bitset, "S", "toString")
s <- gsub('[{}]','', bitset)
s <- strsplit(s, split=',')[[1]]
Expand All @@ -166,7 +164,7 @@ get.fingerprint <- function(molecule, type = 'standard', fp.mode = 'bit', depth=
tempkey <- .jsimplify(tempkey)
}
keys[[i]] <- tempkey

}

values <- list()
Expand Down
6 changes: 3 additions & 3 deletions rcdk/R/formula.R
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ generate.formula <- function(mass,
#' @param tol The tolerance
#' @return A \code{jobjRef} corresponding to an instance of \code{IsotopePatternSimilarity}
#' @seealso \code{\link{compare.isotope.pattern}}
#' @references \url{http://cdk.github.io/cdk/1.5/docs/api/org/openscience/cdk/formula/IsotopePatternSimilarity.html}
#' @references \url{https://cdk.github.io/cdk/2.10/docs/api/org/openscience/cdk/formula/IsotopePatternSimilarity.html}
#' @author Miguel Rojas Cherto
get.isotope.pattern.similarity <- function(tol = NULL) {
ips <- .jnew("org/openscience/cdk/formula/IsotopePatternSimilarity")
Expand All @@ -544,7 +544,7 @@ get.isotope.pattern.similarity <- function(tol = NULL) {
#'
#' @param minAbundance The minimum abundance
#' @return A \code{jobjRef} corresponding to an instance of \code{IsotopePatternGenerator}
#' @references \url{http://cdk.github.io/cdk/1.5/docs/api/org/openscience/cdk/formula/IsotopePatternGenerator.html}
#' @references \url{https://cdk.github.io/cdk/2.10/docs/api/org/openscience/cdk/formula/IsotopePatternGenerator.html}
#' @author Miguel Rojas Cherto
get.isotope.pattern.generator <- function(minAbundance = NULL) {
if (is.null(minAbundance))
Expand All @@ -564,7 +564,7 @@ get.isotope.pattern.generator <- function(minAbundance = NULL) {
#' @return A numeric value between 0 and 1 indicating the similarity between the two patterns
#' @seealso \code{\link{get.isotope.pattern.similarity}}
#' @export
#' @references \url{http://cdk.github.io/cdk/2.3/docs/api/org/openscience/cdk/formula/IsotopePatternSimilarity.html}
#' @references \url{https://cdk.github.io/cdk/2.10/docs/api/org/openscience/cdk/formula/IsotopePatternSimilarity.html}
#' @author Miguel Rojas Cherto
compare.isotope.pattern <- function(iso1, iso2, ips = NULL) {
cls <- unique(c(class(iso1), class(iso2)))
Expand Down
2 changes: 1 addition & 1 deletion rcdk/R/frags.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' `frameworks`. Each of these elements is either a character vector of SMILES strings or a list of
#' `IAtomContainer` objects.
#' @author Rajarshi Guha (\email{rajarshi.guha@@gmail.com})
#' @seealso [get.exhuastive.fragments()]
#' @seealso [get.exhaustive.fragments()]
#' @export
#' @examples
#' mol <- parse.smiles('c1ccc(cc1)CN(c2cc(ccc2[N+](=O)[O-])c3c(nc(nc3CC)N)N)C')[[1]]
Expand Down
2 changes: 1 addition & 1 deletion rcdk/R/props.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ get.properties <- function(molecule) {
#' Remove a property associated with a molecule.
#'
#' In this context a property is a value associated with a key and stored
#' with the molecule. This methd will remove the property defined by the key.
#' with the molecule. This method will remove the property defined by the key.
#' If there is such key, a warning is raised.
#'
#' @param molecule The molecule to query. Should be a `jobjRef` representing an `IAtomContainer`
Expand Down
Loading
Loading