\HeaderA{addDerivedData}{Adding a  derived dataset to an existing MAGEML document}{addDerivedData}
\keyword{methods}{addDerivedData}
\begin{Description}\relax
This function adds a derived dataset to an existing MAGEML document.
\end{Description}
\begin{Usage}
\begin{verbatim}
addDerivedData(mageOM = NULL, data = NULL, outputDirectory = ".", externalDataFile = NULL, protocolID = NULL, protocol = "none", date="NA", qtIDs = NULL, qtNames = NULL, qtScales = NULL, qtDataTypes = NULL, qtDimID = NULL,transformationID=NULL, DED = "none", BAD = NULL, derivedBioAssayID = NULL, derivedBioAssayDataID = NULL, MBA = NULL )
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{data}] Numeric vector or martix in which the columns corresepond
to the derived data one wants to add and the rows correspond to one
DesignElementDimension present in the original MAGEML document
\item[\code{mageOM}] Reference to MAGE Object Model, generated by
importMAGEOM() method. 
\item[\code{outputDirectory}] Directory where updated MAGEML document will
be written to 
\item[\code{externalDataFile}] Name for external data file
associated with a DerivedBioAssayData object.  the filename should
end with .txt as this is the standard output file format
\item[\code{protocolID}] ID you want to give to the protocol, e.g. P-normalised-1
\item[\code{protocol}] Describiption of the used protocol
\item[\code{date}] Date when protocol was applied
\item[\code{qtIDs}] List of identifiers used for the QuantitationTypes. Order
should be the same as the columns of the data matrix
\item[\code{qtNames}] List of names for the QuantitationTypes. Order should
be the same as in the qtIDs list and as the columns of the data matrix.
\item[\code{qtScales}] Scales of the QuantitationType, e.g. linear. Order should
be the same as in the qtIDs list and as the columns of the data matrix.
\item[\code{qtDataTypes}] DataTypes of the QuantitationType e.g. scalar. Order should
be the same as in the qtIDs list and as the columns of the data matrix.
\item[\code{qtDimID}] A new QuantitationTypeDimension will be generated
you'll have to specify it's identifier
\item[\code{transformationID}] Identifier for the applied transformation e.g.
TFM:1
\item[\code{DED}] DesignElementDimension selected during MAGEML import.  If only one dimension present
in original MAGEML file then this parameter should not be specified
\item[\code{BAD}] BioAssayData identifier
\item[\code{derivedBioAssayID}] Identifier for the DerivedBioAssay
e.g. DBA-1
\item[\code{derivedBioAssayDataID}] Identifier for the DerivedBioAssayData
\item[\code{MBA}] Location of the MeasuredBioAssays used to generate the
DerivedBioAssayData as present in the raw created by import from a
MAGEML document. e.g. if first and third hybridisation of a
marrayRaw or RGList object were dyeswaps and a combined measure from
these two observations was derived, MBA should be a list of length
two with values MBA<-c(1,3)
\end{ldescription}
\end{Arguments}
\begin{Author}\relax
Steffen Durinck, \url{http://www.esat.kuleuven.ac.be/~sdurinck}\\ 
Joke Allemeersch, \url{http://www.esat.kuleuven.ac.be/~jallemee}.
\end{Author}
\begin{References}\relax
Spellman PT, Miller M, Stewart J, Troup C, Sarkans U, Chervitz S, Bernhart D, Sherlock G, Ball C, Lepage M, Swiatek M, Marks WL, Goncalves J, Markel S, Iordan D, Shojatalab M, Pizarro A, White J, Hubley R, Deutsch E, Senger M, Aronow BJ, Robinson A, Bassett D, Stoeckert CJ Jr and Brazma A.
Design and implementation of microarray gene expression markup language (MAGE-ML).
Genome Biol. 2002 Aug 23;3(9):RESEARCH0046.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{importMAGEOM}{importMAGEOM}},\code{\LinkA{writeMAGEML}{writeMAGEML}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
#library(RMAGEML)
#mageom <- importMAGEOM(directory = "/home/steffen/data/MEXP-14")
#data1 <- rep(1, 960); #dummy dataset
#data <- cbind(data1, data1) #dummy dataset
#outputDirectory <- "/home/steffen/XMLout"
#magemlFile <- "RMAGEMLtest.xml"
#derivedFile <- "deriv_test.txt"
#protocolID <- "P-CAGE-test"
#protocol <- "This is a test protocol! Applied Anova to the raw signal intesities. Flags are set where foreground signal was below background"
#qtIDs <- c("esat.kuleuven.ac.be:quantT-1-test", "esat.kuleuven.ac.be:quantT-2-test")
#qtNames <- c("quantitation Name 1", "quantitation Name 2")
#qtScales <- c("linear","linear")
#qtDataTypes <- c("scalar","scalar")
#qtDimID <- "esat.kuleuven.ac.be:QTD-test"
#BAD <- "esat.kuleuven.ac.be:BAD-test"
#derivedBioAssayID <- "esat.kuleuven.ac.be:DBA-test"
#derivedBioAssayDataID <- "esat.kuleuven.ac.be:DBD-test"
#MBA <- c(0, 2)
#addDerivedData(mageOM = mageom, data = data, outputDirectory = outputDirectory, externalDataFile = externalDataFile, protocolID = protocolID, protocol = protocol,  qtIDs = qtIDs, qtNames = qtNames, qtScales = qtScales, qtDataTypes = qtDataTypes, qtDimID = qtDimID, DED = "none", BAD = BAD, derivedBioAssayID = derivedBioAssayID, derivedBioAssayDataID = derivedBioAssayDataID, MBA = MBA)

\end{ExampleCode}
\end{Examples}

