Movatterモバイル変換


[0]ホーム

URL:


BeviMed with VCFs

Daniel Greene

2025-08-22

TheBeviMed package comes with a script containingfunctions to simplify reading allele count matrices from VCF files. Thefunctions depend ontabix, but have the advantage ofallowing variants in local regions to be read in, reducing the amount ofmemory consumed at any one time. However, if you want to analyse manyregions, it may be more efficient to read in larger parts of the file -in which case, a package such asvcfR might be moreappropriate.

In order to make the functions available, we must source thescript:

library(BeviMed)source(paste0(system.file(package="BeviMed","/scripts/vcf.R")))

The script creates the functionvcf2matrix, whichdepends on the external programtabix (available fromhttp://www.htslib.org/download/) for reading allelecount matrices from VCF files. It uses arguments:

You can invoke the function simply to obtain the allele count matrixand pass straight tobevimed, along with phenotypelabel:

ac_matrix<-vcf2matrix("my-vcf.vcf.gz",chr="2",from=1,to=1e4)pheno<-read.table(file="my-phenotype-data.txt",header=TRUE)bevimed(y=pheno$disease_status,G=ac_matrix)

[8]ページ先頭

©2009-2025 Movatter.jp