\HeaderA{fcor-methods}{Similarity measures for peak-list comparison}{fcor.Rdash.methods}
\aliasA{fcor,Massvector,Massvector-method}{fcor-methods}{fcor,Massvector,Massvector.Rdash.method}
\aliasA{fcor,Massvectorlist,Massvector-method}{fcor-methods}{fcor,Massvectorlist,Massvector.Rdash.method}
\aliasA{fcor,Massvectorlist,NULL-method}{fcor-methods}{fcor,Massvectorlist,NULL.Rdash.method}
\keyword{methods}{fcor-methods}
\begin{Description}\relax
Computes the:\\
\Itemize{
\item dotprod
\item covariance
\item sum of agreing intensities of two
Massvectors.
}
\end{Description}
\begin{Arguments}
\begin{ldescription}
\item[\code{obx}] see above
\item[\code{oby}] see above
\item[\code{error}] measurement error
\item[\code{ppm}] if \code{TRUE} then error in parts per million, in
arbitrary units otherwise
\item[\code{full}] if \code{TRUE} then compute for matching and not matching peaks
\item[\code{weight}] if \code{TRUE} weight differences between matching peaks.
\item[\code{uniq}] if \code{TRUE} compute the non-crossing matching
\item[\code{method}] type of dissimilarity:
\Itemize{
\item dotprod -- dotproduct of matching intensities.
\item cov -- covariance of matching intensities.
\item soai -- sum of agrein intensities of matching intensities.
}

\item[\code{norm}] how to scale the itensities
\Itemize{
\item vnorm -- l=2 norm, vector length normalization.
\item tic -- l=1 norm, total ion count normalization.
\item student -- root mean square normalization (see. \code{\LinkA{scale}{scale}}) 
\item zscore -- z-score normalization. (see. \code{\LinkA{scale}{scale}}) 
}

\item[\code{theta}] "numeric" how to weight the non-matching peaks.
\item[\code{N}] default 0 - total length of alinged peak-lists.
\item[\code{range}] experimental
\end{ldescription}
\end{Arguments}
\begin{Value}
The Dissimilarity.
\end{Value}
\begin{Section}{Methods}
\describe{
\item[obx = "Massvector", oby = "Massvector"] : returns similarity
\item[obx = "Massvectorlist", oby = "Massvector"] : returs numeric vector
\item[obx = "Massvectorlist", oby = "NULL"] : returns object of class \code{\LinkA{dist}{dist}}
}
\end{Section}
\begin{Author}\relax
Witold E. Wolski \email{witek96@users.sourceforge.net}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{fdist}{fdist}},\code{\LinkA{fbinary}{fbinary}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(pldata)
fcor(pldata[[1]],pldata[[2]],error=400,ppm=TRUE,theta=1,weight=FALSE,scale="no",method="dotprod")
fcor(pldata[[1]],pldata[[2]],error=400,ppm=TRUE,theta=1,weight=FALSE,scale="student",method="soai")
#search with one peak-list in a bunch of peak-lists
fcor(pldata,pldata[[1]],error=400,ppm=TRUE,theta=1,weight=FALSE,scale="student",method="soai")
#compute distance matrix of peak-lists and cluster
tmp<-fcor(pldata,NULL,error=400,ppm=TRUE,theta=1,weight=FALSE,scale="student",method="soai")
plot(hclust(tmp,method="average"))
\end{ExampleCode}
\end{Examples}

