R/PeakML.Methods.getPhenoData.R

Defines functions PeakML.Methods.getPhenoData

Documented in PeakML.Methods.getPhenoData

PeakML.Methods.getPhenoData <- function(sampleGroups, sampleNames, peakDataMtx){
	# This function will return the sample groups (eg: BLK, BLK, BLK, CO, CO, CO etc)	
	# PRE: 
	#	sampleClasses: list of available sample classes
	#	sampleNames: sample names
	#	peakDataMtx: the peak data matrix
	
	getSampleClass <- function (x)
	{
		phenoData <- sampleGroups[sGroups[peakDataMtx[,9]==x][1]]
		phenoData
	}

	sGroups <- peakDataMtx[,11]
	phenoData <- unlist(lapply(1:length(sampleNames),getSampleClass)) 
	phenoData
}

Try the mzmatch.R package in your browser

Any scripts or data that you put into this service are public.

mzmatch.R documentation built on May 31, 2017, 4:31 a.m.