R/getCValues.R

Defines functions getCValues

Documented in getCValues

#' Get C Value
#'
#' Get the FT-MS conversion parameter \code{C} for each scan in a given range
#'
#' @param filename a \code{.raw} file
#' @param scans a numeric vector of scan numbers to extract
#' @return a numeric vector of the C value for each scan
#' 
#' @author Tom Wilson \email{tpw2@@aber.ac.uk}
#' @export
#' @examples
#' \dontrun{
#'	getCValues(QC.raw, scans = c(2:24)	
#'	}
#'
getCValues <- function(filename, scans = c())
	{
	options(digits = 15)
	
	CVal <- sapply(scans, function(x)(shell(paste(system.file("bin/GetCValue.exe", package = "rawReadeR"), filename, x, sep = " "), intern = TRUE)))
	
	if(length(grep("::", CVal)) == length(CVal)){
		CVals <- gsub("Conversion Parameter C::", "", CVal)
	}else{
		CVals <- gsub("Conversion Parameter C:", "", CVal)
	}	
	
	return(as.numeric(CVals))
	}
 
wilsontom/rawReadeR documentation built on May 4, 2019, 6:31 a.m.