gl.filter.locmetric: Filters loci on the basis of numeric information stored in...

View source: R/gl.filter.locmetric.r

gl.filter.locmetricR Documentation

Filters loci on the basis of numeric information stored in other$loc.metrics in a genlight {adegenet} object

Description

This script uses any field with numeric values stored in $other$loc.metrics to filter loci. The loci to keep can be within the upper and lower thresholds ('within') or outside of the upper and lower thresholds ('outside').

Usage

gl.filter.locmetric(x, metric, upper, lower, keep = "within", verbose = NULL)

Arguments

x

Name of the genlight object containing the SNP data [required].

metric

Name of the metric to be used for filtering [required].

upper

Filter upper threshold [required].

lower

Filter lower threshold [required].

keep

Whether keep loci within of upper and lower thresholds or keep loci outside of upper and lower thresholds [within].

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2, unless specified using gl.set.verbosity].

Details

The fields that are included in dartR, and a short description, are found below. Optionally, the user can also set his/her own filter by adding a vector into $other$loc.metrics as shown in the example.

  1. SnpPosition - position (zero is position 1) in the sequence tag of the defined SNP variant base.

  2. CallRate - proportion of samples for which the genotype call is non-missing (that is, not '-' ).

  3. OneRatioRef - proportion of samples for which the genotype score is 0.

  4. OneRatioSnp - proportion of samples for which the genotype score is 2.

  5. FreqHomRef - proportion of samples homozygous for the Reference allele.

  6. FreqHomSnp - proportion of samples homozygous for the Alternate (SNP) allele.

  7. FreqHets - proportion of samples which score as heterozygous, that is, scored as 1.

  8. PICRef - polymorphism information content (PIC) for the Reference allele.

  9. PICSnp - polymorphism information content (PIC) for the SNP.

  10. AvgPIC - average of the polymorphism information content (PIC) of the Reference and SNP alleles.

  11. AvgCountRef - sum of the tag read counts for all samples, divided by the number of samples with non-zero tag read counts, for the Reference allele row.

  12. AvgCountSnp - sum of the tag read counts for all samples, divided by the number of samples with non-zero tag read counts, for the Alternate (SNP) allele row.

  13. RepAvg - proportion of technical replicate assay pairs for which the marker score is consistent.

Value

The reduced genlight dataset.

Author(s)

Luis Mijangos – Post to https://groups.google.com/d/forum/dartr

See Also

Other filter functions: gl.filter.allna(), gl.filter.callrate(), gl.filter.heterozygosity(), gl.filter.hwe(), gl.filter.ld(), gl.filter.maf(), gl.filter.monomorphs(), gl.filter.overshoot(), gl.filter.parent.offspring(), gl.filter.pa(), gl.filter.rdepth(), gl.filter.reproducibility(), gl.filter.secondaries(), gl.filter.sexlinked(), gl.filter.taglength()

Examples

# adding dummy data
test <- testset.gl
test$other$loc.metrics$test <- 1:nLoc(test)
result <- gl.filter.locmetric(x=test, metric= 'test', upper=255,
lower=200, keep= 'within', verbose=3)

dartR documentation built on June 8, 2023, 6:48 a.m.