Skip to contents

SNP datasets generated by DArT include fragments with more than one SNP and record them separately with the same CloneID (=AlleleID). These multiple SNP loci within a fragment (secondaries) are likely to be linked, and so you may wish to remove secondaries.

This script filters out all but the first sequence tag with the same CloneID after ordering the genlight object on based on repeatability, avgPIC in that order (method='best') or at random (method='random').

The filter has not been implemented for tag presence/absence data.


gl.filter.secondaries(x, method = "random", verbose = NULL)



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


Method of selecting SNP locus to retain, 'best' or 'random' [default 'random'].


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].


The genlight object, with the secondary SNP loci removed.


Custodian: Arthur Georges -- Post to

#> Starting 
#>   Processing genlight object with SNP data
#> Counting ....
#>   Warning: No loci with secondaries, no plot produced
#>   Total number of SNP loci scored: 255 
#>     Number of secondaries: 0 
#> Completed: 
#>                Param       Value
#> 1   255.00000
#> 2 n.SNPs.secondaries     0.00000
#> 3   n.invariant.tags          NA
#> 4 n.tags.secondaries          NA
#> 5          n.inv.gen 15224.00000
#> 6       mean.len.tag    60.70196
#> 7        n.invariant          NA
#> 8             Lambda          NA
result <- gl.filter.secondaries(
#> Starting gl.filter.secondaries 
#>   Processing genlight object with SNP data
#>   Selecting one SNP per sequence tag at random
#> Completed: gl.filter.secondaries