Learn R Programming

cancerTiming (version 1.0.0)

labelSeg: Helper functions for plotting

Description

Helper functions for plotting and working with chromsomes and segmentations

Usage

labelSeg(chr, start, end, pctOv = 0.1)
numChromosome(chr)

Arguments

chr
chromosome
start
start position of segment
end
end position of segment
pctOv
required amount of percent overlap needed in order to report

Value

  • vector of numerical values between 1:23

Details

labelSeg creates labels `p', `q', and `pq' for segmentations based on the overlap of the segment with the p/q portions of the human chromosome (hg19). It uses the data stored in hg19chromosomes. Uses the findOverlaps function of GenomicRanges

numChromosome takes character valued chromosome labels (``1'',``2'',...,``X'',``Y'') and converts them into values 1:23. This is useful for sorting chromosome values, for example.

See Also

hg19chromosomes,findOverlaps

Examples

Run this code
data(mutData)
	segData<-data.frame(chromosome="17",start=c(0,1.8e7+1),end=c(1.8e7,max(mutData$position)),totalCpy=c(2,NA),
		markRegion=c(FALSE,TRUE))
	labelSeg(chr=segData$chromosome,start=segData$start,end=segData$end)
	chr<-c("1","4","10","23","X")
	chr[order(chr)]
	chr[order(numChromosome(chr))]

Run the code above in your browser using DataLab