% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils-compare.r
\name{DetermineWeight_SimClust}
\alias{DetermineWeight_SimClust}
\title{Determines an optimal weight for weighted clustering by similarity weighted clustering.}
\usage{
DetermineWeight_SimClust(
  List,
  type = c("data", "dist", "clusters"),
  distmeasure = c("tanimoto", "tanimoto"),
  normalize = c(FALSE, FALSE),
  method = c(NULL, NULL),
  weight = seq(0, 1, by = 0.01),
  nrclusters = NULL,
  clust = "agnes",
  linkage = c("flexible", "flexible"),
  linkageF = "ward",
  alpha = 0.625,
  gap = FALSE,
  maxK = 15,
  names = NULL,
  StopRange = FALSE,
  plottype = "new",
  location = NULL
)
}
\arguments{
\item{List}{A list of matrices of the same type. It is assumed the rows are corresponding with the objects.}

\item{type}{indicates whether the provided matrices in "List" are either data matrices, distance
matrices or clustering results obtained from the data. Type should be one of "data", "dist" or "clusters".}

\item{distmeasure}{A vector of the distance measures to be used on each data matrix. Defaults to c("tanimoto","tanimoto").}

\item{normalize}{Logical. Indicates whether to normalize the distance matrices. Default is c(FALSE, FALSE).}

\item{method}{A method of normalization. Default is c(NULL,NULL).}

\item{weight}{Optional. A list of different weight combinations for the data sets in List. Defaults to seq(0,1,by=0.01).}

\item{nrclusters}{The number of clusters to cut the dendrogram in. Default is NULL.}

\item{clust}{Choice of clustering function (character). Defaults to "agnes".}

\item{linkage}{Choice of inter group dissimilarity for the individual clusterings. Defaults to c("flexible","flexible").}

\item{linkageF}{Choice of inter group dissimilarity for the final clustering. Defaults to "ward".}

\item{alpha}{The parameter alpha to be used in the "flexible" linkage of the agnes function. Defaults to 0.625.}

\item{gap}{Logical. Whether or not to calculate the gap statistic. Only if type="data". Default is FALSE.}

\item{maxK}{The maximal number of clusters to consider in calculating the gap statistic. Default is 15.}

\item{names}{The labels to give to the elements in List. Default is NULL.}

\item{StopRange}{Logical. Indicates whether the distance matrices with values not between zero and one
should be standardized to have so. Default is FALSE.}

\item{plottype}{Should be one of "pdf","new" or "sweave". Default is "new".}

\item{location}{If plottype is "pdf", a location should be provided here. Default is NULL.}
}
\value{
The returned value is a list with three elements: \item{ClustSep}{The result of \code{Cluster}
for each single element of List} \item{Result}{A data frame with the Jaccard coefficients and their
ratios for each weight} \item{Weight}{The optimal weight}.
}
\description{
The function \code{DetermineWeight_SimClust} determines an optimal weight
for performing weighted similarity clustering. For each given weight, each separate clustering
is compared to the clustering on a weighted dissimilarity matrix and a Jaccard coefficient is
calculated. The ratio of the Jaccard coefficients closest to one indicates an optimal weight.
}
\examples{
\dontrun{
data(fingerprintMat)
data(targetMat)

MCF7_F = Cluster(fingerprintMat,type="data",distmeasure="tanimoto",normalize=FALSE,
method=NULL,clust="agnes",linkage="flexible",alpha=0.625,gap=FALSE,maxK=55,StopRange=FALSE)
MCF7_T = Cluster(targetMat,type="data",distmeasure="tanimoto",normalize=FALSE,
method=NULL,clust="agnes",linkage="flexible",alpha=0.625,gap=FALSE,maxK=55,StopRange=FALSE)

L=list(MCF7_F,MCF7_T)

MCF7_Weight=DetermineWeight_SimClust(List=L,type="clusters",weight=seq(0,1,by=0.01),
nrclusters=c(7,7),distmeasure=c("tanimoto","tanimoto"),normalize=c(FALSE,FALSE),
method=c(NULL,NULL),clust="agnes",linkage=c("flexible","flexible"),linkageF="ward",
alpha=0.625,gap=FALSE,maxK=50,names=c("FP","TP"),StopRange=FALSE,plottype="new",location=NULL)
}
}
\references{
Perualila-Tan, N. et al. (2016). Weighted similarity-based clustering of chemical
structures and bioactivity data in early drug discovery. Journal of Bioinformatics and Computational Biology.
}
