Start with the lead SNP and keep expanding the window until you reach
the desired number of SNPs.
dat
should only contain one locus from one chromosome.
limit_snps(dat, max_snps = 500, verbose = TRUE)
A data.frame that contains at least the following columns:
RSID for each SNP.
Each SNP's genomic position (in basepairs).
The maximum number of SNPs to keep in the resulting data.table.
Print messages.
A filtered data.table.
Other SNP filters:
filter_snps()
,
gene_trimmer()
dat2 <- echodata::limit_snps(dat = echodata::BST1)
#> Limiting to only 500 SNPs.
#> + Reduced number of SNPs: 6,216 ==> 500