Dear all,
I am trying to calculate the genetic diversity of simulated offspring and calculate genetic diversity for simulated offspring.
- First, I simulate offspring
gl_F1 <- gl.sim.offspring(gl_Dad, gl_Mom, noffpermother=10, sexratio= 1)
/// GENLIGHT OBJECT /////////
// 180 genotypes, 3,555 binary SNPs, size: 1.5 Mb
210717 (32.93 %) missing data
// Basic content
@gen: list of 180 SNPbin
@ploidy: ploidy of each individual (range: 2-2)
// Optional content
@ind.names: 180 individual labels
@loc.names: 3555 locus labels
@other: a list containing: sex
- Then, Calculates the observed, expected and unbiased expected
df_report_he <- gl.report.heterozygosity(gl_F1)
Starting gl.report.heterozygosity
Processing genlight object with SNP data
Warning: data include loci that are scored NA across all individuals.
Consider filtering using gl <- gl.filter.allna(gl)
No population assignments detected,
individuals assigned to a single population labelled 'pop1'
Calculating Observed Heterozygosities, averaged across loci, for each population
Calculating Expected Heterozygosities
Error in if (x@other$loc.metrics.flags$monomorphs == FALSE) { :
argument is of length zero
- Then, Diverbasic <- gl.basic.stats(gl_F1, digits = 4, verbose = NULL)
Starting gl.basic.stats
Processing genlight object with SNP data
Warning: data include loci that are scored NA across all individuals.
Consider filtering using gl <- gl.filter.allna(gl)
Error in .nextMethod(x = x, value = value) :
Vector length does no match number of loci
In addition: Warning message:
In df2genind(xx[, ], sep = "/", ncode = 1, ind.names = x...@ind.names, :
Markers with no scored alleles have been removed
I don't know what is the issues here. My question is Can I calculate genetic diversity for simulated offspring? if Yes, how can I fix my script?
Thanks and I really appreciate all your help
Cheers
Nga