readXVcf: Read a vcf file to extract information relevant to XCI

Description Usage Arguments Value References Examples

View source: R/readXvcf.R

Description

Read a given vcf file and extract minimum information required for the estimation of the expression of inactivated X chromosome.

Usage

1
readXVcf(vcf_file, haps_file = NULL, rm_homo = TRUE)

Arguments

vcf_file

A character. The path to a vcf file.

haps_file

A character. The path to a .haps file, the output of the shapeit software.

rm_homo

A logical. If set to TRUE, homozygous sites will be removed from the output. Otherwise, they will be set to NA.

Value

A data.table object in long format of length sample*site.

References

O. Delaneau, B. Howie, A. Cox, J-F. Zagury, J. Marchini (2013) Haplotype estimation using sequence reads. American Journal of Human Genetics 93 (4) 787-696.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Example workflow for documentation

vcff <- system.file("extdata/AD_example.vcf", package = "XCIR")
# Reading functions
vcf <- readRNASNPs(vcff)
vcf <- readVCF4(vcff)

# Annotation functions
# Using seqminer (requires additional annotation files)

anno <- addAnno(vcf)

# Using biomaRt
anno <- annotateX(vcf, mirror = "useast")
# Do not remove SNPs with 0 count on minor allele
anno0 <- annotateX(vcf, het_cutoff = 0, mirror = "useast")

# Summarise read counts per gene
# Assuming data is phased, reads can be summed across genes.
genic <- getGenicDP(anno, highest_expr = FALSE)
# Unphased data, select SNP with highest overall expression.
genic <- getGenicDP(anno, highest_expr = TRUE)

SRenan/XCIR documentation built on Oct. 8, 2021, 3:11 a.m.