Hello,
The trick with using p-sex is that you have to manually separate out and label the genotypes above the threshold, which can be done using the make.unique() function from R. Here's an example using the P. ramorum data within poppr:
library("poppr")
# EXAMPLE DATA SETUP -----
data(Pram)
mll(Pram) <- "original"
# NOTE: the data has 98 MLGs
Pram
#>
#> This is a genclone object
#> -------------------------
#> Genotype information:
#>
#> 98 original multilocus genotypes
#> 729 diploid individuals
#> 5 codominant loci
#>
#> Population information:
#>
#> 3 strata - SOURCE, YEAR, STATE
#> 9 populations defined -
#> Nursery_CA, Nursery_OR, JHallCr_OR, ..., Winchuck_OR, ChetcoMain_OR, PistolRSF_OR
# Calculating p-sex and correcting zero-value alleles by 1/(2*rrmlg) with no
# population structure assumed.
Pram_psex <- psex(Pram, by_pop = FALSE, d = "rrmlg", mul = 1/2, method = "multiple")
# retrieve the original mlls as a character vector
mlls <- as.character(mll(Pram))
# create a threshold for individuality
thresholds <- Pram_psex >= 0.05
# append a "p" to all of these MLGs and append a number like
# 22p.4 is the fifth genotype likely sexually derived which is
# identical to MLG 22.
mlls[thresholds] <- make.unique(paste0(mlls[thresholds], "p"))
mll.custom(Pram) <- mlls
# Now the data has 225 MLLs
Pram
#>
#> This is a genclone object
#> -------------------------
#> Genotype information:
#>
#> 225 custom multilocus genotypes
#> 729 diploid individuals
#> 5 codominant loci
#>
#> Population information:
#>
#> 3 strata - SOURCE, YEAR, STATE
#> 9 populations defined -
#> Nursery_CA, Nursery_OR, JHallCr_OR, ..., Winchuck_OR, ChetcoMain_OR, PistolRSF_OR
I hope that helps.
Zhian