Skip to content

Instantly share code, notes, and snippets.

@rajarshi
Created November 25, 2021 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajarshi/5b8d9244712e1733431bdc97826f230b to your computer and use it in GitHub Desktop.
Save rajarshi/5b8d9244712e1733431bdc97826f230b to your computer and use it in GitHub Desktop.
library(rcdk)
f <- function(mol) {
tmp <- get.murcko.fragments(list(mol), min.frag.size=3)[[1]]
cat("\rProcessed molregno",get.property(mol, 'cdk:Title'), 'which had',
length(tmp$rings), 'rings and', length(tmp$frameworks), 'frameworks')git
return(tmp)
}
miter <- iload.molecules('/Users/guha/chembl28_10k.smi', type='smi')
frags <- foreach(mol=miter) %do% f(mol)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment