\HeaderA{getChipInfo}{Get Illumina Chip Information based on probe identifiers}{getChipInfo}
\keyword{methods}{getChipInfo}
\keyword{utilities}{getChipInfo}
\begin{Description}\relax
Retrieve the matched Illumina chip information by searching the provided probe identifiers through the Illumina identifiers in all manifest files.
\end{Description}
\begin{Usage}
\begin{verbatim}
getChipInfo(x, lib.mapping = NULL, species = c("Human", "Mouse", "Rat", "Unknown"), chipVersion = NULL, idMapping = FALSE, returnAllMatches = FALSE, verbose = TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a vector of probe identifiers, ExpressionSet object or a matrix with probe identifiers as row names 
\item[\code{lib.mapping}] the ID mapping library. If it is provided, the parameter "species" will be ignored. 
\item[\code{species}] species of the chip designed for. If users do not know it, it can be set as "Unknown". 
\item[\code{chipVersion}] chipVersion information returned by function \code{\LinkA{getChipInfo}{getChipInfo}} 
\item[\code{idMapping}] determine whether return the idMapping information (between Illumina ID and nuID) 
\item[\code{returnAllMatches}] determine whether return all matches or just the best match 
\item[\code{verbose}] determine whether print some warning information 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function searches the provided probe Identifiers (Illumina IDs or nuIDs) through all the manifest file ID information kept in the IDMapping libraries (lumiHumanIDMapping, lumiMouseIDMapping, lumiRatIDMapping). The Illumina IDs kept in the library include "Search\_key" ("Search\_Key"), "Target" ("ILMN\_Gene"), "Accession", "Symbol", "ProbeId" ("Probe\_Id"). To determine the best match, the function calculate the number of matched probes. The higher "matchedProbeNumber" is claimed as better. When the "matchedProbeNumber" is the same, the manifest file with fewer probes is claimed as better. If x is NULL and chipVersion is provided, it will return the entire mapping table of the chip.
\end{Details}
\begin{Value}
The function returns a list with following items:
\begin{ldescription}
\item[\code{chipVersion}] the file name of the manifest file for the corresponding version and release
\item[\code{species}] the species of the chip designed for
\item[\code{IDType}] the type of probe identifier
\item[\code{chipProbeNumber}] the number of probes in the manifest file
\item[\code{matchedProbeNumber}] the number of input probes matching the manifest file
\item[\code{idMapping}] id mapping information between Illumina ID and nuID
\end{ldescription}

When parameter "returnAllMatches" is TRUE, the items of "chipVersion", "IDType", "chipProbeNumber", "inputProbeNumber", "matchedProbeNumber" will be a vector corresponding to the matched manifest files, whose "matchedProbeNumber" is larger than zero, and the "idMapping" will be a matrix with each column corresponding to one matched manifest file. All of the items are sorted from the best match to worst (The higher "matchedProbeNumber" is claimed as better. When the "matchedProbeNumber" is the same, the manifest file with fewer probes is claimed as better.).
\end{Value}
\begin{Author}\relax
Pan Du
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{nuID2IlluminaID}{nuID2IlluminaID}}, \code{\LinkA{IlluminaID2nuID}{IlluminaID2nuID}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
        ## load example data
        data(example.lumi)
        if (require(lumiHumanIDMapping)) {
                chipInfo <- getChipInfo(example.lumi, species='Human')
                chipInfo
        }
\end{ExampleCode}
\end{Examples}

