PIC calculation

7 views
Skip to first unread message

Oumar Boro

unread,
May 6, 2024, 12:28:41 PMMay 6
to dartR
Dear all,

I'm using DArTSeq for diversity analysis and I've received the raw data containing "PIC" for each alleles for the whole population. 
However, I'm looking for the PIC for different subsets from the population  (knowing that the PIC for each allele has been calculated for the entire pop).
I'm now looking for any code within DartR package to sort it out.

Regards,

Boro

Jose Luis Mijangos

unread,
May 6, 2024, 9:38:10 PMMay 6
to dartR
Hi Boro,

Here is some code to update the AvgPIC statistic by population. Let us know if that is what you are looking for. 

library(dartR.base)
t1 <- platypus.gl
# separating populations, each population is contained in one genlight object
t2 <- seppop(t1)
# population names of each genlight object  
names(t2)
# recalculating loc metrics, including AvgPIC
t3 <- lapply(t2, gl.recalc.metrics)
# AvgPIC in the updated dataset
head(t3$TENTERFIELD$other$loc.metrics$AvgPIC)
# AvgPIC in the original genlight object
head(t1$other$loc.metrics$AvgPIC)

Cheers,
Luis 

Reply all
Reply to author
Forward
0 new messages