##This example takes a few minutes to run.
##To run it quickly, we advise the user to decrease
##the number of variants or to increase the number of cores used
#Import data in a bed matrix (example in build 37)
#x <- read.bed.matrix( system.file("extdata", "LCT.EUR.b37.bed", package="Ravages") )
#Remove the multi-allelic variants
#x <- select.snps(x, !grepl(A2, pattern = ",") & !grepl(A1, pattern = ","))
#Keep only the rare variants
#x <- select.snps(x, maf <= 0.01 & maf > 0)
#Select the indels and make a dataframe to be used for annotation
#x.vcf <- subset(x@snps, nchar(A1)>1 | nchar(A2)>1)[,c("chr", "pos", "id", "A1", "A2")]
#Export the file for annotation
#write.table(x.vcf, file = "indels.toannotate.vcf",
# col.names = F, row.names = F, quote = F, sep = "\t")
###############
#Annotate the file in on CADD website (https://cadd.gs.washington.edu/score)
#Please be careful here about which CADD version to use for annotation, here is v1.4 for b37
###############
#Download the results file, unzip it and load it in R
#x.indels <- read.table("indels.annotated.tsv")
#colnames(x.indels) <- c("chr", "pos", "A1", "A2", "CADD1.4", "PHRED_1.4")
#Set the NULL model for burden testing
#H0.burden <- NullObject.parameters(pheno = x@ped$population, ref.level = "CEU",
# RVAT = "burden", pheno.type = "categorical")
#Run RAVA-FIRST
#x.RAVAFIRST = RAVA.FIRST(x, indels.scores = x.indels, H0.burden = H0.burden, SKAT = F, cores = 1,
# path.data = "RAVA-FIRST/Package", maf.threshold = 1, build = "b37")
Run the code above in your browser using DataLab