getGCcontent {exomeCopy} | R Documentation |
A short function using scanFa from the Rsamtools package on a target GRanges and a reference FASTA file
getGCcontent(target, reference.file)
target |
GRanges object |
reference.file |
the path to the reference FASTA file |
Returns a vector of the ratio of G and C basepairs to total basepairs (not counting N's).
target.file <- system.file("extdata","targets.bed",package="exomeCopy") target.df <- read.delim(target.file,header=FALSE,col.names=c("seqname","start","end")) target <- GRanges(seqname=target.df$seqname,IRanges(start=target.df$start+1,end=target.df$end)) reference.file <- system.file("extdata","reference.fa",package="exomeCopy") GCcontent <- getGCcontent(target, reference.file)