% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/genesets.R
\name{computeGeneSetsOverlap}
\alias{computeGeneSetsOverlap}
\alias{computeGeneSetsOverlap,list,character-method}
\alias{computeGeneSetsOverlap,list,ExpressionSet-method}
\alias{computeGeneSetsOverlap,GeneSetCollection,character-method}
\alias{computeGeneSetsOverlap,GeneSetCollection,ExpressionSet-method}
\title{Compute gene-sets overlap}
\usage{
\S4method{computeGeneSetsOverlap}{list,character}(gSets, uniqGenes, minSize = 1, maxSize = Inf)

\S4method{computeGeneSetsOverlap}{list,ExpressionSet}(gSets, uniqGenes, minSize = 1, maxSize = Inf)

\S4method{computeGeneSetsOverlap}{GeneSetCollection,character}(gSets, uniqGenes, minSize = 1, maxSize = Inf)

\S4method{computeGeneSetsOverlap}{GeneSetCollection,ExpressionSet}(gSets, uniqGenes, minSize = 1, maxSize = Inf)
}
\arguments{
\item{gSets}{Gene sets given either as a \code{list} or a
\code{GeneSetCollection} object.}

\item{uniqGenes}{Vector of unique genes to be considered when calculating
the overlaps.}

\item{minSize}{Minimum size.}

\item{maxSize}{Maximum size.}
}
\value{
A gene-set by gene-set matrix of the overlap among every pair of
gene sets.
}
\description{
Calculates the overlap among every pair of gene-sets given as
input.

This function calculates the overlap between every pair of gene sets of the
input argument \code{gSets}. Before this calculation takes place, the gene
sets in \code{gSets} are firstly filtered to discard genes that do not match
to the identifiers in \code{uniqGenes}. Secondly, they are further filtered
to meet the minimum and/or maximum size specified with the arguments
\code{minSize} and \code{maxSize}. The overlap between two gene sets is
calculated as the number of common genes between the two gene sets divided
by the smallest size of the two gene sets.
}
\examples{
geneSets <- list(set1=as.character(1:4), set2=as.character(4:10))
computeGeneSetsOverlap(geneSets, unique(unlist(geneSets)))
}
\references{
Hänzelmann, S., Castelo, R. and Guinney, J. GSVA: Gene set
variation analysis for microarray and RNA-Seq data.
\emph{BMC Bioinformatics}, 14:7, 2013.
}
\seealso{
\code{\link{filterGeneSets}}
}
\author{
J. Guinney
}
\keyword{Gene}
\keyword{set}
