injectSNPsMAF {ramwas} | R Documentation

## Inject SNPs from VCF Count File into a DNA Sequence

### Description

Injects SNPs from a VCF count file into a DNA sequence.

### Usage

    injectSNPsMAF(gensequence, frqcount, MAF = 0.01)

### Arguments

`gensequence` | A string or `DNAString` of the DNA sequence.
`frqcount` | File name of the allele count file produced by `vcftools` with `--counts` parameter. Alternatively, the file content can be provided as a character vector (see `readLines`).
`MAF` | SNPs with minor allele frequency at or above `MAF` are injected.

### Value

Returns a string with the genome sequence with SNPs injected.

### Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

### See Also

See `injectSNPs` for the standard analog function without MAF filtering.

### Examples

    gensequence1 = "AAAACAAAA"
    frqcount = c(
        "CHROM\tPOS\tN_ALLELES\tN_CHR\t{ALLELE:COUNT}",
        "1\t6\t2\t1000\tA:400\tG:600",
        "1\t7\t2\t1000\tA:800\tC:200",
        "1\t9\t2\t1000\tA:900\tG:100")
    MAF = 0.01

    gensequence2 = injectSNPsMAF(gensequence1, frqcount, MAF)

    ### No CpGs without SNPs
    show(gensequence1)
    getCpGsetCG(gensequence1)

    ### SNPs create 1 CpG
    show(gensequence2)
    getCpGsetALL(gensequence2)

[Package ramwas version 1.18.0 Index]