This function takes in input a (list of) VCF file name(s), reads and process them by setting UCSC style and allowed chromosome names.

readVcfFiles(vcfFiles, assembly)

Arguments

vcfFiles

list of one or more character strings corresponding to the vcf file names. Each element of the list should be named with the sample name. If no name is provided, the .vcf file name will be used.

assembly

human genome assembly: hg19 or hg38

Value

a (list of) CollapsedVCF object(s) containing variants

Author

Laura Fancello

Examples

# Read in input name of vcf files (provide them as a list even if you only have # one file) vcf_files <- list(Horizon5="Horizon5_ExamplePanel.vcf", HorizonFFPEmild="HorizonFFPEmild_ExamplePanel.vcf") # For each vcf file, get the absolute path vcf_files <- lapply(vcf_files, function(x) system.file("extdata", x, package = "TMBleR", mustWork = TRUE)) # Read in the files vcfs <- readVcfFiles(vcfFiles = vcf_files, assembly = "hg19")
#> Validate VCF input:
#> $Horizon5 #> $Horizon5$warnings #> [1] "line 141: The VCF file contains 2 samples. Only the first (1_20170317_01_i01_0_horizon_5) will be used" #> [2] "line 142: AF is described both in FORMAT and in INFO of this and possibly other variants. FORMAT's AF will be used" #> #> $Horizon5$errors #> NULL #> #> #> $HorizonFFPEmild #> $HorizonFFPEmild$warnings #> [1] "line 141: The VCF file contains 2 samples. Only the first (2_20170317_01_i01_0_horizon_ffpe_mild) will be used" #> [2] "line 142: AF is described both in FORMAT and in INFO of this and possibly other variants. FORMAT's AF will be used" #> #> $HorizonFFPEmild$errors #> NULL #> #>
#> Warnings and Errors exported to 'validator_check' variable