filter_vcf: Filter VCF

View source: R/filter.R

filter_vcfR Documentation

Filter VCF

Description

filter VCF by GFF annotation or by position or both

Usage

filter_vcf(vcf, gff = gff,
           mode = c("POS", "type", "both"),
           Chr = Chr, start = start, end = end,
           type = c("CDS", "exon", "gene", "genome", "custom"),
           cusTyp = c("CDS", "five_prime_UTR", "three_prime_UTR"),
           geneID = geneID)

Arguments

vcf

object of vcfR class, VCF file imported by import_vcf()

gff

object of GRanges class, genome annotations imported by import_gff()

mode

filter mode, one of "POS", "type", "both"

Chr

chromosome name, needed if mode set to "POS" or "both"

start

start position, needed if mode set to "POS" or "both"

end

end position, needed if mode set to "POS" or "both"

type

filter type, needed if mode set to "type" or "both", one of "CDS", "exon", "gene", "genome", "custom", if type was set to "custom", then custom_type is needed.

cusTyp

character vector, custom filter type, needed if type set to "custom"

geneID

gene ID

Value

vcfR

Examples


# filtet vcf
data("geneHapR_test")
vcf_f1 <- filter_vcf(vcf, mode = "POS",
                    Chr = "scaffold_1",
                    start = 4300, end = 5890)

vcf_f2 <- filter_vcf(vcf, mode = "type",
                    gff = gff,
                    type = "CDS")
vcf_f3 <- filter_vcf(vcf, mode = "both",
                    Chr = "scaffold_1",
                    start = 4300, end = 5890,
                    gff = gff,
                    type = "CDS")


geneHapR documentation built on May 29, 2024, 11:59 a.m.