\HeaderA{fitgene.nl}{Fits the optimal kinetic parameter values for a particular gene and model.}{fitgene.nl}
\keyword{ts}{fitgene.nl}
\begin{Description}\relax
This method fits the three kinetic parameter values for a particular gene. It returns a list containing the results.
\end{Description}
\begin{Usage}
\begin{verbatim}
fitgene.nl(eset,gene,tHVDM,transforms,firstguess,model)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{eset}] an ExpressionSet object (Biobase) 
\item[\code{gene}] the gene identifier in character format 
\item[\code{transforms}] a vector containing the kinetic parameter identifiers that have to be transformed during optimisation (optional) 
\item[\code{tHVDM}] the output of the training set 
\item[\code{firstguess}] first guess for the fitting (optional, see details)
\item[\code{model}] model specification of the production function in character format" MM (Michelis-Menten, default) or hill (hill function) 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
An exponential transform is set by default for both the basal (Bj), degradation (Dj) and Kj rates (through the transforms argument). This
forces the values for both these parameters to be positive. It also helps to reach a better fit. To turn this off let transforsm=c(). Even in this case the degradation rate will not be allowed to take non positive values as it causes problems with the
differential operator used internally. The value in the vector indicates the parameter to be transformed: "Bj": basal rate of transcription, "Vj": sensitivity, "Dj": degrdation rate.
The entry label indicates the transform to be applied.

This \code{fitgene.nl()} step can only be applied after a \code{training()} step. The output to the \code{training.nl()} step has to be fed through 
the \code{tHVDM} argument.

The \code{firstguess} argument is optional (a first guess is generated internally by default). 
However a first guess can be supplied by the user which can take several forms. 
It can either be a vector with three entries containing a first guess for the basal rate, 
the sensitivity, the degradation rate (in that order). 
Alternatively, another output from the \code{fitgene()} function (for example from a gene that
has a similar expression profile) can be supplied as a \code{firstguess} argument.

The \code{model} argument is only used to choose the model (MM: Michelis-Menten, hill: Hill function).
\end{Details}
\begin{Value}
a list containing the results (see documentation for more details).
\end{Value}
\begin{Note}\relax
Obviously, the expression set given as a \code{eset} argument has to be the same as the one used
for the training step.
\end{Note}
\begin{Author}\relax
Martino Barenco
\end{Author}
\begin{References}\relax
M. Barenco, D. Tomescu, D. Brewer, R. Callard, J. Stark, M. Hubank (2006) Ranked predictions
of p53 targets using Hidden Variable Dynamic Modelling. \emph{Genome Biology}, \bold{V7(3)}, R25.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{training}{training}},\code{\LinkA{screening}{screening}},\code{\LinkA{HVDMreport}{HVDMreport}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
#load data and fit a linear model
data(HVDMexample)
rm(fiveGyMAS5)
data(HVDMexample2)
tp532<-training(eset=twodosesMAS5,genes=p53traingenes,degrate=0.8)
#formulate constraints
CONSTRAINTS<-c(350,35)
names(CONSTRAINTS)<-c("trfact1.5Gy.1.4","trfact1.hGy.1.4")
#specify individual gene models
GENEMODELS<-rep("MM",5)
GENEMODELS[c(1,3)]<-"hill"
names(GENEMODELS)<-p53traingenes
#run the model
tp53hyb<-training.nl(inputHVDM=tp532,constraints=CONSTRAINTS,genemodels=GENEMODELS)

#fit an individual gene
sHVDMex<-fitgene.nl(eset=twodosesMAS5,gene="213293_s_at",tHVDM=tp53hyb)
\end{ExampleCode}
\end{Examples}

