totalReads=10000
mappedReads=8000
mappedTargetReads=6000
unmappedReads=totalReads-mappedReads
offtargetmappedReads=mappedReads-mappedTargetReads
data<-c(mappedReads,unmappedReads,mappedTargetReads,offtargetmappedReads)
round(data[1]/totalReads*100)->a
round(data[2]/totalReads*100)->b
round(data[3]/mappedReads*100)->c
round(data[4]/mappedReads*100)->d
pct<-c(a,b,c,d)
labels<-c("MappedReads","UnmappedReads","On-exon","Off-exon")
labels<-paste(labels,pct)
labels<-paste(labels,"%", sep="")
pie(c(mappedReads,unmappedReads,mappedTargetReads,offtargetmappedReads),labels=labels)
它基本上独立地绘制了所有四个切片。但是在这里mappedTargetReads
,offtargetmappedReads
是根据映射读取计算的,因此,我想细分mappedReads
切片并表示mappedTargetReads
,offtargetmappedReads
在 内mappedReads
。
或者是否可以在一个 Rplot 中绘制两个不同的饼图?