Description Usage Arguments Details Value Examples
Keep (or discard) SNPs that overlap (or lie outside of) regions in a given BED file.
1 | filter_bed(data, bed, remove = FALSE, outfile = tempfile(fileext = ".snp"))
|
data |
EIGENSTRAT data object. |
bed |
Path to a BED file. |
remove |
Remove sites falling inside the BED file regions? By default, sites that do not overlap BED regions are removed. |
outfile |
Path to an output snp file with coordinates of excluded sites. |
This function requires a functioning bedtools installation! See:
- https://github.com/arq5x/bedtools2
- https://bedtools.readthedocs.io/
Updated S3 EIGENSTRAT data object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run: # download an example genomic data set
prefix <- download_data(dirname = tempdir())
# create an EIGENSTRAT R object from the downloaded data
snps <- eigenstrat(prefix)
# get the path to an example BED file
bed <- file.path(dirname(prefix), "regions.bed")
# BED file contains regions to keep in an analysis
snps_kept <- filter_bed(snps, bed)
# BED file contains regions to remove from an analysis
snps_removed <- filter_bed(snps, bed, remove = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.