prepareHetero {MADSEQ} | R Documentation

## prepare heterozygous sites for aneuploidy detection

### Description

given the vcf file and bed file containing targeted region, generate processed heterozygous sites for furthur analysis

### Usage

    prepareHetero(vcffile, target_bed, genome = "hg19", writeToFile = TRUE,
      destination = NULL, plot = FALSE)

### Arguments

`vcffile` | A `character`, specify the path to the location of the vcf.gz file of your sample. Note: the vcf file need to be compressed by `bgzip`. The tool is part of `tabix` package, can be download from http://www.htslib.org/
`target_bed` | A `character`, specify the path to the location of bed file containing targeted regions.
`genome` | A `character`, specify the assembly of your genome. Default: hg19. To see available genome assembly, use `available.genomes` from BSgenome package
`writeToFile` | `Boolean` Default: `TRUE`. If `TRUE`, processed table containing heterozygous sites will be written to `destination` specified, the file will be named as "sample_filtered_heterozygous.txt". If set to `FALSE`, a `GRanges` object containing processed heterozygous sites will be returned
`destination` | A `character`, specify the path to the location where the processed heterozygous sites table will be written. Default: `NULL`, the file will be written to current working directory
`plot` | A `Boolean` Default: `FALSE`. If `TRUE`, A plot showing AAF before and after filtering for problematic regions will be generated

### Value

If `writeToFile` is set to TRUE, processed table will be written to the `destination`. Otherwise, a `GRanges` object containing each of input sample will be returned.

### Note

1. The vcf file you provided need to be compressed by bgzip
2. The vcf file should contain depth and allelic depth for variants in the FORMAT field

### Author(s)

Yu Kong

### See Also

`runMadSeq`

### Examples

    ## specify the path to the vcf.gz file for the aneuploidy sample
    aneuploidy_vcf=system.file("extdata","aneuploidy.vcf.gz",package="MADSEQ")
    target = system.file("extdata","target.bed",package="MADSEQ")
    ##------ if not write to file ------
    aneuploidy_hetero=prepareHetero(aneuploidy_vcf,target,writeToFile=FALSE)

    ##------ if write to file ------
    prepareHetero(aneuploidy_vcf, target,writeToFile=TRUE, destination=".")

[Package MADSEQ version 1.13.0 Index]