inst/examples/qplotPeaks.r

setGeneric('qplotPeaks', function(object,...) standardGeneric('qplotPeaks'))

setMethod('qplotPeaks', 'xcmsPeaks', function(object, 
                                              protocol, 
                                              raw, 
                                              sample=NULL, 
                                              residuals = TRUE, 
                                              island=TRUE){
  prof <- raw@env$profile
  quant <- quantile(prof, protocol@alpha, na.rm = TRUE)
  cutoff <- matrix(quant, nrow(prof), ncol(prof))
  if(!is.null(sample))
    peaks <- object@peaks[object@peaks[,'sample']==sample,]
  else
    peaks <- object@.Data
  peaks_df <- as.data.frame(peaks)
  rownames(peaks_df) <- seq_len(nrow(peaks_df))
  
  print(peaks_df)
})
mariev/chromatoplotsgui documentation built on May 21, 2019, 11:46 a.m.