## Cross entropy clustering

My kids love mickey mouse. ;-) If you have mickey mouse plot, can you cluster the data reasonably ? R package named gmum.r provides interesting solution to do it. The package has many features for data analysis. If reader who has interest it please use it. I used the package to cluster mickey mouse data!Continue reading “Cross entropy clustering”

Advertisement

## Draw radar chart with R

A radar chart is a graphical method of displaying multivariate data in the form of a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point. The relative position and angle of the axes is typically uninformative. (from wikipedia) It’s useful for visualize multi parameters in drug discovery. ForContinue reading “Draw radar chart with R”

## Find MCS in R

Find maximum common substructure is useful for finding core scaffold. I think that finding MCS, using commercially available tools is common (pipeline pilot ?). I often use RDkit. ;-) Today I found the library that search MCS in R, named fmcsR. That’s sounds nice, because if fmcsR works fine, I’ll implement the library to SpotfireContinue reading “Find MCS in R”

## make 3d PCA plot

I often use PCA(principal component analysis) to reduce dimension. I do PCA using Python sklearn or R language. Basic function of R “biplot” makes 2D chart. It’s easy way to make biplot. Today I found cool library of R, named “pca3d”. Install is easy! Just type following command. Now make chart. I used iris dataContinue reading “make 3d PCA plot”

## Array or sparse array ?

In a process of lead optimization, chemist often do SAR expansion around potent compound. If lead compound can be break down three parts A(head), B(core), C(tail), chemist(me…) often fix one part(e.g core B) and change two parts. After optimize A and C then, fix A, C and change B. This approach is called array synthesisContinue reading “Array or sparse array ?”

## Get distance matrix via tibco spotfire.

I often calculate molecular distance matrix or similarity matrix. Distance matrix is useful for visualise molecular similarity but some time it is bother to calculate it. Today I wrote data function that calculate distance matrix for molecular set. There are not native function to calculate that in Spotfire. And RCDK can not install TERR. So,Continue reading “Get distance matrix via tibco spotfire.”

## Calculate PK param. using TIBCO Spotfire?

Somedays ago,my colleague asked me how to calculate PK parameters in TIBCO Spotfire ? Hmm. That’s sounds difficult, because Spotfire is not tool for analyse DMPK data. But, there are some packages in CRAN for DMPK. So I thought that using TERR, some PK params could calculate. Let’s do it. ;-) At first I installedContinue reading “Calculate PK param. using TIBCO Spotfire?”

## Implementation of machine learning in Spotfire.

Today I coded for functions that predict molecular property using e1071. Following code is almost pure R, but the code get data from Spotifre. So, users don’t need to think about R coding. User can build model and predict data only using spotfire. At first I get sample data in from Bursi Mutagenicity Dataset(link). ConvertContinue reading “Implementation of machine learning in Spotfire.”

## ggplot with spotfire

ggplot2 is nice tool for visualise data in R. TIBCO Spotfire does not have density plot function. So, I implemented density plot in spotfire. I did it using RinR function and ggplot2. * This is simple sample. In spotfire data function, I wrote following… “idx” is column name which you want plot In Spotfire’s input tab,Continue reading “ggplot with spotfire”

## use RinR

TIBCO Spotfire is tool for data visualisation. I think that TERR “TIBCO Enterprise Runtime for R” is cool. This module allows us to develop in open source R. It can develop not only serve-side, but also client-side. So, I can use my local R environment to make data function. If I use RinR, I don’tContinue reading “use RinR”

## Interactive view in ggplot.

Somedays ago, I knew R package “shiny“. This package is good tool to make interactive view in R. There is a famous tool Spotfire. Use with ggplot, it will be cool. To use shiny, I wrote two scripts, server.R and ui.R. ui.R defines user interface, and server.R defines plot. I wrote interactive view about iris.Continue reading “Interactive view in ggplot.”

## Make biplot using ggplot.

Principal Component Analysis (PCA) is a statistical procedure that uses an orthogonal transformation to convert a set of observations of possibly correlated variables into set of values of linearly un correlated variables. (from wiki) R can preform PCA very simple command “prcomp”. The result can visualise using biplot function. ggplot2 is a plotting system forContinue reading “Make biplot using ggplot.”

## Rで勉強２

Rで非線形回帰、2コンパートメントモデル。 p176　１コンパートメントモデル、IV投与 Rでやってみる PKのパッケージにbiexp関数があるので これを使う。 Estimation of initial and terminal half-life by fitting a biexponential model. 傾きがα、βに相当するので α＝2.69h-1, β=0.15h-1, 切片の値からA=8.59 mg/L, B=1.40 mg/L k21 = (Aβ＋Bα) / (A+B) = 0.50 k10 = αβ/k21 = 0.80 k12 = α+β-k10-k21 = 1.54 で AUC = A/a + B/b = 12.5 より CL = S*F*D/AUC = 100 /Continue reading “Rで勉強２”

## メモ

Rで線形回帰 テキストはこれ webリンクもあってよいですね。 p151　１コンパートメントモデル、IV投与 Rでやってみる 　time <- c(0.1,0.2,0.5,1,1.5,2,3,5,7,10,12,15) 　conc<-c(2.45,2.40,2.26,2.04,1.85,1.67,1.37,0.92,0.61,0.33,0.22,0.12) 　lnc<-log(conc) 　test2<-cbind(lnc,time) 　 reg<-lm(lnc~time,data=data.frame(test2)) 　 reg Call: lm(formula = lnc ~ time, data = data.frame(test2)) Coefficients: (Intercept) time 0.9187 -0.2025 ということでk=0.20h-1 lnCp0 = 0.919 Cp0 = exp(0.919)=2.5mg/L となりました。 lm(formura, data)にて線形回帰を実行する