Filtering on secondaries

24 views
Skip to first unread message

Peter Kriesner

unread,
Mar 2, 2023, 2:33:08 AM3/2/23
to da...@googlegroups.com
Hi folks,
I'm once again having a problem with filtering on secondaries.

I've previously read in a DArT data set, which had ~80k SNPs initially and then ~50k SNPs after filtering on secondaries as follows:

g2 <- gl.filter.secondaries(g1, method = "best")

I'm now trying to re-import the same data set (having re-assigned some of the individuals to different populations or subpopulations in my metadata). However when I now try to run the above filter it fails to remove any loci.

I have tried installing the latest development version of dartR but still get the same problem.

Also, is there an easy way to reassign individuals in an already imported genlight object to a different population?

Thanks,
Peter

Jose Luis Mijangos

unread,
Mar 2, 2023, 11:23:45 PM3/2/23
to dartR
Hi Peter,

I could not replicate the behavior you mentioned.

Could you please send me a subset of your data that replicates the behavior you see to my personal e-mail: luis.m...@gmail.com. The code below shows how you can subset your data and save it. Please send me the file “test.rds” as in the code example below and also the code you are using.

library(dartR)
# subset loci
# you can increase the number of loci to subsample for example n=400
test <- gl.subsample.loci(your_data.gl,n=200,method = "random")
#subset individuals
# you can increase the number of individuals to subsample by using for example indNames(test)[1:20]
test <- gl.keep.ind(test,ind.list = indNames(test)[1:10])
# saving object in the working directory
saveRDS(test, "test.rds")

You can check the pages 12 and 13 of the below tutorial for some easy ways to reassign individuals to populations.


Cheers,
Luis
Reply all
Reply to author
Forward
0 new messages