Skip to content
Snippets Groups Projects
Commit b7e469d8 authored by thierry balliau's avatar thierry balliau
Browse files

change export data from mcq.get.compar to unlog value and mcq.get.dataframe

creation of rd file for mcq.write
parent b2d684b5
No related branches found
Tags 4.6.0
No related merge requests found
......@@ -102,6 +102,7 @@ na.rm="ANY", columnID="ANY"), function(object, flist, na.rm, columnID){
## method for cmcq.protq.xic
setMethod("mcq.get.compar", signature(object="cmcq.protq.xic", flist="ANY",
na.rm="ANY", columnID="ANY"), function(object, flist, na.rm, columnID){
object@protval$q = 10^object@protval$q
temp = mcq.get.compar(as(object, "cmcq.generic.protq"), flist, na.rm, columnID)
return(temp)
})
......
......@@ -51,10 +51,14 @@ setMethod("mcq.get.dataframe", signature(object="cmcq.protq.peakcounting", alpha
## method for cmcq.protq.xic
setMethod("mcq.get.dataframe", signature(object="cmcq.protq.xic", alpha="ANY"), function(object, alpha){
nb_pep = unique(object@protval[, c("accession", "q")])
colnames(nb_pep) = c("accession", "nb.pep")
nb_pep = unique(object@protval[, c("accession", "msrun", "count")])
colnames(nb_pep) = c("accession", "msrun", "nb.pep")
object@protval$count <- NULL
temp = mcq.get.dataframe(as(object, "cmcq.generic.protq"), alpha)
temp = merge(temp, nb_pep, by="accession")
temp = merge(temp, nb_pep, by=c("accession", "msrun"))
temp$temp_q = 10^temp$q
colnames(temp)[which(colnames(temp) == "q")] <- "log(q)"
colnames(temp)[which(colnames(temp) == "temp_q")] <- "q"
return(temp)
})
......
......@@ -22,7 +22,7 @@
\author{PAPPSO (pappso-projetsbioinfo@groupes.renater.fr)}
\seealso{'mcq.plot.tukey'}
\seealso{\code{\link{mcq.plot.tukey}}}
\examples{
\dontrun{
......
\name{mcq.write}
\alias{mcq.write}
\title{Write Dataframe to file}
\description{This function exports an ods or a flat file containing the data containing in a dataframe create by mcq.get.dataframe, mcq.get.metadata or mcq.get.compar.}
\usage{mcq.write(object, type="flat", sep="\t", dec=".", file="export")
}
\arguments{
\item{object}{a dataframe object.}
\item{type}{type of exported file : must be 'flat' for 'tsv'or 'csv' format or 'ods' for libreoffice spreadsheet format. Default value is 'flat'.}
\item{sep}{must be a valid column separator between ',', ';', '\\t'. Default value is '\\t'.}
\item{dec}{must be a valid decimal separator between ',', '.'. Default value is '.'.}
\item{file}{the name of the exported file without extension. Default value is 'export'.}
}
\details{This function is designed to facilitate export of data from MCQR package. It use the 'write.table' function from 'utils' packages for flat file or 'write_ods' from 'readODS' package for libreoffice spreadsheet.\\n This function does not write row names of dataframe. }
\author{PAPPSO (pappso-projetsbioinfo@groupes.renater.fr)}
\examples{
\dontrun{
data("xic_prot_imputed")
## retrieve data in dataframe format
quantification <- mcq.get.dataframe(xic_prot_imputed)
## save quantification result to 'tsv' file named quantification
mcq.write(quantification, type="flat", dec=".", sep="\t", file="quantification")
## retrieve metadata information
metadata = mcq.get.metadata(xic_prot_imputed)
## write metadata in libreoffice spreadsheet
mcq.write(quantification, type="ods", file="metadata")
}
}
\seealso{\code{\link{mcq.get.dataframe}}, \code{\link{mcq.get.metadata}}, \code{\link{mcq.get.compar}}, \code{\link{write_ods}}, \code{\link{write.table}}}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment