# A short script used to quality check and filter the VCF file for 17-VLT002652 # Load the VCF file and define thresholds and ratios for filtering vcf_file <- "~/Path/to/project/folder/17VLT2652_var_called.vcf" vcf <- read.delim(vcf_file, skip = 29, stringsAsFactors = FALSE) min_QUAL <- 100 min_frac_qual <- 0.1 # Filter on read quality vcf_alt_1 <- subset(vcf, vcf$QUAL > min_QUAL) okrow <- rep(c(1), nrow(vcf_alt_1)) # Filter out samples with too similar likelihood values for each allele for (count in 1:nrow(vcf_alt_1)) { for (r in 10:ncol(vcf_alt_1)) { p <- as.numeric(strsplit(strsplit(vcf_alt_1[count,r],":")[[1]][2], ",")[[1]]) if (as.numeric(max(p))>=25 && as.numeric(min(p))