hecking that we have data from the same person

concord <- variantConcordance(tumor, normal)
concord


##now that we know we have tumor and normal data from the same sample we need one
##more bit of data before we get the tumor-specific variants

##Actually calling the sample-specific variants

TS<- tumorNormalCompare(tumor_gr=tumor,
                        normal_gr=normal, normal_raw=raw,
                        normal_cov=cov)


##Writing a vcf file

##Next we want to write out our tumor-specific varints out to a vcf file

cgpGr2vcf(TS, file = "~/temp_ts.vcf", sample_id="Test_sam", project = "SNVsOmuC_Vignette")

##annotaing variants and loading VCF files
library(VariantAnnotation)
fl <- "/home/jeremiah/temp_ts.vcf.gz"
vcf <- readVcf(fl, "hg19")
vcf
rowData(vcf)

#######################################################################
## We can also use VariantAnnotation to identify potentially functional
## using the GRanges objects generated by gmapR and SNVsOmuC directly
#######################################################################

seqlevels(TS) <- paste("chr", seqlevels(TS), sep = "")
genome(TS) <- "hg19"
seqlevels(TS)<-seqlevels(TS)[1:24]
strand(TS)<-"*"
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene

coding <- predictCoding(TS, varAllele=DNAStringSet(values(TS)$alt), txdb, seqSource=Hsapiens)
coding


##Making some plots

##Finally we want make some plots to check out our data.

##The first plot shows us the mutation transition/transversion rate matrix

plotTitv(variantsGR, main = "Single-sample SNVs")
plotTitv(TS, main = "tumor specific mutations")


##and finally we want to plot our variants on the genome

seqlevels(tumor) <- paste("chr", seqlevels(tumor), sep = "")
genome(tumor) <- "hg19"
seqlevels(tumor)<-seqlevels(tumor)[1:24]

plotTumor(tumor,TS)

\end{document}


