[adegenet-forum] Changing Ploidy

Swati... swatipuraanik at gmail.com
Mon Feb 6 13:06:12 CET 2023


Hello,

I have a Genlight object as below:

> SNPs_Ploidy  /// GENLIGHT OBJECT /////////

 // 78 genotypes,  8,368 binary SNPs, size: 33.2 Mb
 23935 (3.67 %) missing data

 // Basic content
   @gen: list of 78 SNPbin
   *@ploidy: ploidy of each individual  (range: 2-2)*

 // Optional content
   @ind.names:  78 individual labels
   @loc.names:  8368 locus labels
   @loc.all:  8368 alleles
   @position: integer storing positions of the SNPs
   @pop: population of each individual (group size range: 3-50)
   @other: a list containing: loc.metrics  ind.metrics
loc.metrics.flags  verbose  history


As you can see @ploidy: ploidy of each individual (range: 2-2). However the
78 individuals in my dataset have all different ploidies ranging from 2X to
6X. I tried using these commands:

> head(ploidy(SNPs_Ploidy), 10)

  Ac-3 Ac-359  Ac-25  Ac-75 Ac-182 Ac-210 Ac-272 Ac-317 Ac-333 Ac-344

     2      2      2      2      2      2      2      2      2      2



> ploidy(SNPs_Ploidy) <- paste("4", "2", "4", "4", "4", "4", "2", "4", "4",
"4", sep=" ")


But I get this error message:

Error in `ploidy<-`(`*tmp*`, value = "4 2 4 4 4 4 2 4 4 4") :
  (converted from warning) NAs introduced by coercion

Is it possible to change the ploidy and what could be the appropriate
commands?

Best Regards
Swati
--------------------------------------------------------------- _
---------- ----------------------
*SWATI PURANIK ,  Ph.D.,  MSCA Fellow*
Junior Researcher
Global Change Research Institute (CzechGlobe), Czech Academy of Sciences
Bělidla 986/4a, 603 00 Brno; Czech Republic
E-mail: s <manoj_prasad at nipgr.ac.in>watipuraanik at gmail.com
Google Scholar
<https://scholar.google.cz/citations?hl=en&user=QTwp1YMAAAAJ&view_op=list_works&gmla=AJsN-F4LFxJUHZv94qOgQg1ss_nyV9cNg6V6j_dF1gJ583sGeqPI69W6l7-SoBBTETQnD57xSf7SBGngfv45kzo-m7yqUWmTLP2FKlR5zx6LQ6ANEkrQ5wo>
 | ResearchGate <https://www.researchgate.net/profile/Swati_Puranik>
ORCID ID: *https://orcid.org/0000-0003-1787-1550
<https://orcid.org/0000-0003-1787-1550>*
----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20230206/5ffac6fe/attachment.html>


More information about the adegenet-forum mailing list