utils.hamming.prepare: Validates arguments and prepares trimmed sequences for...

View source: R/utils.hamming.prepare.r

utils.hamming.prepareR Documentation

Validates arguments and prepares trimmed sequences for gl.filter.hamming and gl.report.hamming

Description

WARNING: UTILITY SCRIPTS ARE FOR INTERNAL USE ONLY AND SHOULD NOT BE USED BY END USERS AS THEIR USE OUT OF CONTEXT COULD LEAD TO UNPREDICTABLE OUTCOMES.

Usage

utils.hamming.prepare(x, threshold, rs, min.length)

Arguments

x

Name of the genlight object [required].

threshold

Maximum number of mismatching bases [required].

rs

Number of bases to skip from the start of the TrimmedSequence [required].

min.length

Length of the compared substring [required].

Details

Holds the one copy of the argument checks and sequence preparation shared by gl.filter.hamming and gl.report.hamming. The report simulates the filter exactly only if both prepare the sequences in the same way, so neither function repeats this code.

Each TrimmedSequence is upper-cased, the first rs bases are skipped and the next min.length bases are kept. Loci whose substring is exactly min.length bases long are comparable; they are ordered from most to least missing data, so that the compiled engine, which keeps the later of two duplicates, always keeps the locus with the better call rate.

Value

A list with elements raws (raw vectors, one per locus), idx (indices of comparable loci), ord (idx ordered from worst to best call rate) and n.short (number of loci that are not comparable).

Author(s)

Author(s): Luis Mijangos. Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr


dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.