plotAlleleByPosition {cancerTiming}R Documentation

Plot allele frequencies by position

Description

Plot observed allele frequencies from sequencing data against their location on the chromosome.

Usage

plotAlleleByPosition(mutData, segmentData = NULL, 
	whChr = 1:22, chromosomeId = "chr", 
	sampleName = NULL, sample = FALSE, tumorAFId, positionId, type = "mutation", 
	startId = "start", endId = "end", segFactorId, tCNId, MarkId, segColors, 
	normCont = NULL,  addData = NULL, addColor="red",col="black",pch=1,lwd=2,
	xlim,ylab="Allele Frequency",...)

Arguments

mutData

data.frame with mutation data set to be plotted

segmentData

(optional) segmentation data

whChr

which chromosome to plot

chromosomeId

column name for chromosome (must be same in all data.frames)

sampleName

id printed on the plot to identify the sample

sample

logical. If true, take only a random sample of 10,000 locations for the chromosome. Can speed up for plotting SNPs.

tumorAFId

column name for the allele frequency in mutData

positionId

column name for the allele location in mutData

type

type of allele frequency plotted (passed to ‘allAF’ in order to create the lines for the expected AF)

startId

column name for the start of the segmentation (in segData)

endId

column name for the end of the segmentation (in segData)

segFactorId

column name for the factor for segmentations (in segData).

tCNId

column name that gives the total copy number for the segmentation (in segData); needed if give normCont to calculated expected AF

MarkId

column name of a column with logical values that identifies segments that should be marked up with hash marks.

segColors

vector of colors for the segmentations. Should be as long as the number of levels of segFactorId

normCont

percent normal contamination. If missing, then lines for the expected AF will not be calculated.

addData

data.frame with another set (example germline SNPs) to be plotted in red

addColor

color for the additional data

lwd

line width of the lines for the expected AF

ylab

label for y-axis

xlim

xlim boundaries. If missing, will be calculated.

col

col for the mutData points

pch

pch for the mutData points

...

arguments passed to initial plotting command.

Value

returns invisibly the vector of colors for the segmentations, useful for making legends (see the example)

Author(s)

Elizabeth Purdom

Examples

data(mutData)
 #only mutations in the CNLOH region
onlyMuts<-subset(mutData,is.na(rsID) & position <= 1.8E7)
	snps<-subset(mutData,!is.na(rsID) )
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))
out<-plotAlleleByPosition(onlyMuts,whChr=17, segmentData=segData,
	tCNId="totalCpy",normCont=0.22, addData=snps,pch=19,
	addColor="grey",MarkId="markRegion",
	segColors="pink",xaxt="n",xlab="Position", segFactorId="totalCpy",
	chromosomeId = "chromosome",tumorAFId="allelefreq", 
	positionId="position",type="mutation") 
axis(1,line=1,tick=FALSE)
legend("topright",legend=c(names(out),"unknown"),fill=c(out,NA),
	title="Total Copy Number")


[Package cancerTiming version 3.1.8 Index]