Issues with the gl.report.pca function

46 views
Skip to first unread message

Laura Marilyn Benestan

unread,
Oct 16, 2023, 7:23:53 PM10/16/23
to dartR
The dartR package uses the gl.report.pca function to estimate the absolute difference in allele frequency between populations, this index being equivalent to the FST. 
As I have eDNA samples that I want to compare with RAD-seq samples, I need to use this index and not the FST.

I have tried to use this function but it doesn't work with my genlight file.
I don't understand why, as it works when we compare the population to the whole using method = "one2rest". 

The error reads: Warning: no loci listed to keep! Genlight object returned unchanged...

Do you have any insight ?

Best,

Laura


Jose Luis Mijangos

unread,
Oct 17, 2023, 9:35:49 PM10/17/23
to dartR
Hi Laura,

Try loading your data using the function gl.read.vcf and then run the compliance function (gl.compliance.check) as shown below. Also have a look at our tutorial for loading data other than DArTseq:


### Load libraries
library(dartR)
### Read dataset
genlight <- gl.read.vcf("ednapool_dp20_miss6s_snp_bi_gatk4_v2.recode2.vcf")
#running compliance check function
genlight <- gl.compliance.check(genlight)
# subsample loci
genlight <- gl.subsample.loci(genlight,n=200,method = "random")
### Add pop info
pop_table <- read.table("population-map-intradna.txt", header=TRUE)
cbind(indNames(t1),pop_table$INDIVIDUALS[1:8])
pop(genlight) <- as.factor(pop_table$STRATA[1:8])
### Estimate AFD
afd.pond <- gl.report.pa(genlight, method = "pairwise")

Cheers,
Luis 

Reply all
Reply to author
Forward
0 new messages