Calculates overlap of variants in LD with BED files.
- GitHub repo: https://github.com/letaylor/variantBedOverlap
- Free software: MIT license
This package/script was designed to (1) get variants in LD with a tag variant and (2) see what chromatin states these variants fall in across cell/tissue types.
The package contains functions that are incorporated into an command line script that does the following:
-
Gets variants in LD with tag variant (via proxysnps).
-
Calculates the overlap of all variants with BED files in a directory.
-
Saves the overlaps data.frame.
-
Makes a plot the overlaps.
Install the R package:
# install the package in R
install.packages("devtools")
options(unzip = "internal") # sometimes this is needed, depending on the R install
devtools::install_github("letaylor/variantBedOverlap")
Run the core script from the command line:
# get the lib dir for variantBedOverlap
install_dir=$(R --slave -e 'cat(find.package("variantBedOverlap"))')
# get the dir for demo bed files
bed_dir="$install_dir/extdata"
# see help options of command line script
Rscript "$install_dir/exec/variant_bed_overlap.R" --help
# run the command line script
Rscript "$install_dir/exec/variant_bed_overlap.R" --rsid rs2072014 \
--dir $bed_dir --population FIN --col_itemRgb 5 \
--out_tag variant_bed_overlaps --rsids_line rs2072014,rs35045598 \
--varshney_chrhmm TRUE --save_data TRUE
# list output files
ls variant_bed_overlaps*
Example output plot:
See the vignettes for more usage examples.
This package uses bumpversion for automatic semantic versioning.
# bump the appropriate increment
bumpversion patch --verbose --dry-run
bumpversion minor --verbose --dry-run
bumpversion major --verbose --dry-run
# commit with tags
git push --tags