injectSNPsMAF: Inject SNPs from VCF Count File into a DNA Sequence

Description Usage Arguments Value Author(s) See Also Examples

View source: R/rwCpGset.r

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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)

andreyshabalin/ramwas documentation built on Sept. 27, 2021, 7:25 p.m.