Add Description
extract_variants_from_vcf_file( vcf_file, id = NULL, rename = NULL, sample_field = NULL, filename_as_id = FALSE, strip_extension = c(".vcf", ".vcf.gz", ".gz"), filter = TRUE, multiallele = c("expand", "exclude"), extra_fields = NULL, fix_vcf_errors = TRUE )
vcf_file | Path to the vcf file |
---|---|
id | ID of the sample to select from VCF. If |
rename | Rename the sample to this value when extracting variants.
If |
sample_field | Some algoriths will save the name of the
sample in the ##SAMPLE portion of header in the VCF (e.g.
##SAMPLE=<ID=TUMOR,SampleName=TCGA-01-0001>). If the ID is specified via the
|
filename_as_id | If set to |
strip_extension | Only used if |
filter | Exclude variants that do not have a |
multiallele | Multialleles are when multiple alternative variants
are listed in the same row in the vcf. One of |
extra_fields | Optionally extract additional fields from the |
fix_vcf_errors | Attempt to automatically fix VCF file formatting errors. |
Returns a data.table of variants extracted from a vcf
vcf <- system.file("extdata", "public_LUAD_TCGA-97-7938.vcf", package = "musicatk") variants <- extract_variants_from_vcf_file(vcf_file = vcf)