Skip to content

Instantly share code, notes, and snippets.

import selfies, random, sys
N = 1000
M = 500
selfies.set_semantic_constraints("octet_rule")
alphabet= list(selfies.get_semantic_robust_alphabet())
alphabet = list(filter(lambda x: '+' not in x and '-' not in x, alphabet))
rnd_smi = set()
while len(rnd_smi) < N:
library(rcdk)
library(fingerprint)
query_smi <- "CCCCCCCC"
hmdb <- load.molecules("smpdb_structures/compounds-1.sdf")
junk <- lapply(hmdb, function(x) set.title(x, get.property(x, "DATABASE_ID")))
query_fp <- get.fingerprint(parse.smiles(query_smi)[[1]])
hmdb_fp <- lapply(hmdb, get.fingerprint)
sm <- fp.sim.matrix(hmdb_fp, list(query_fp))
rownames(sm) <- sapply(hmdb, get.property, "DATABASE_ID")
sm[ which.max(sm[,1]), ]
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)
@rajarshi
rajarshi / foo.py
Created November 17, 2021 15:18
stripping chars in pandas
import pandas as pd
if __name__ == '__main__':
d = {'col1': [1, 2, 3],
'col2': ['{abc defg', '{xyz pqr}', '{nan, foo}']}
df = pd.DataFrame(d)
print(df)
df['col3'] = df['col2'].str.strip("{|}").astype('str')
https://mit.zoom.us/j/94364555006?pwd=bFBGeGlvY0cxV0lTRzZPMWZDdDJNQT09#success
from typing import List, Union
class Unit:
def __init__(self):
pass
class Result:
def __init__(self, value: float, unit: Unit):
https://zoom.us/w/94280441863?tk=FwYQPHrVQzCxdXDQjONgSnw7TnOH2IfrzqdF7Oae7Cg.DQIAAAAV841gBxZsakpEWVQtSFR4Q3NXb01CTzhNV2lRAAAAAAAAAAAAAAAAAAAAAAAAAAAA&pwd=dGVxZ2g3c01PNis5RGxxVVlRQks0Zz09
@rajarshi
rajarshi / fda_drug_cores.smi
Created February 10, 2020 13:57
Bemis Murcko scaffolds derived from FDA Approved Drugs using RDKit
C1=C2CCCCC2C2CCC3C(c4cccnc4)=CCC3C2C1
C1=C[C@H](N[C@H]2CC[C@@H](O[C@H]3CC[C@@H](O[C@H]4CCCOC4)OC3)OC2)CCC1
c1ccccc1
O=c1oc2ccccc2cc1Cc1ccccc1
c1ccc2c(c1)Nc1ccccc1S2
c1ccc2c(c1)Nc1ccccc1S2
c1ccccc1
c1nncs1
O=C(NC1CCCCC1)NS(=O)(=O)c1ccccc1
c1ccc2c(c1)Sc1ccccc1N2CCCN1CCNCC1
Associate Editors
As an Associate Editor you will receive manuscripts to handle from the Editors-in-Chief. The handling of manuscripts will involve inviting appropriate referees and making decisions on manuscripts based on referee reports and your own expertise. The final decision (to accept or reject a manuscript) will be sent to the Editors-in-Chief for approval. You would also be involved with the Editors-in-Chief and wider Editorial Board in guiding journal policy and development.
Your input is also welcomed to: