FSFHap same-tag SNP filter (whichSnpsAreFromSameTag), faithful port
Source:R/RcppExports.R
fsfhap_same_tag_keep_cpp.RdWithin a 64 bp window, consecutive SNPs whose presence-based R^2 to the
window's anchor is >= min_rsq are treated as coming from the same GBS tag
and dropped, keeping only the anchor; a SNP that is >= 64 bp away, or has
R^2 < min_rsq (or NaN), becomes the next kept anchor. One chromosome per
call (positions only; the chromosome-equality guard is implicit), markers
sorted by position.
Arguments
- G
Integer matrix, taxa x sites, canonical
gin{0,1,2,3}.- pos
Integer marker positions (bp), length = ncol(G), sorted ascending.
- major_is_ref
Logical, length = ncol(G): TRUE if REF is the major allele at that site (so allele presence is defined per the site's own major/minor, as TASSEL's
majorAllele/minorAlleledo).- min_rsq
R^2 threshold for "same tag" (TASSEL default 0.8).